@graphql-tools/delegate 9.0.1 → 9.0.2-alpha-20220812030257-76a1a25e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/Subschema.js CHANGED
@@ -15,8 +15,17 @@ class Subschema {
15
15
  this.batchingOptions = config.batchingOptions;
16
16
  this.createProxyingResolver = config.createProxyingResolver;
17
17
  this.transforms = (_a = config.transforms) !== null && _a !== void 0 ? _a : [];
18
- this.transformedSchema = (0, applySchemaTransforms_js_1.applySchemaTransforms)(this.schema, config);
19
18
  this.merge = config.merge;
20
19
  }
20
+ get transformedSchema() {
21
+ if (!this._transformedSchema) {
22
+ console.warn('Transformed schema is not set yet. Returning a dummy one.');
23
+ this._transformedSchema = (0, applySchemaTransforms_js_1.applySchemaTransforms)(this.schema, this);
24
+ }
25
+ return this._transformedSchema;
26
+ }
27
+ set transformedSchema(value) {
28
+ this._transformedSchema = value;
29
+ }
21
30
  }
22
31
  exports.Subschema = Subschema;
package/esm/Subschema.js CHANGED
@@ -11,7 +11,16 @@ export class Subschema {
11
11
  this.batchingOptions = config.batchingOptions;
12
12
  this.createProxyingResolver = config.createProxyingResolver;
13
13
  this.transforms = (_a = config.transforms) !== null && _a !== void 0 ? _a : [];
14
- this.transformedSchema = applySchemaTransforms(this.schema, config);
15
14
  this.merge = config.merge;
16
15
  }
16
+ get transformedSchema() {
17
+ if (!this._transformedSchema) {
18
+ console.warn('Transformed schema is not set yet. Returning a dummy one.');
19
+ this._transformedSchema = applySchemaTransforms(this.schema, this);
20
+ }
21
+ return this._transformedSchema;
22
+ }
23
+ set transformedSchema(value) {
24
+ this._transformedSchema = value;
25
+ }
17
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/delegate",
3
- "version": "9.0.1",
3
+ "version": "9.0.2-alpha-20220812030257-76a1a25e",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
@@ -12,8 +12,10 @@ export declare class Subschema<K = any, V = any, C = K, TContext = Record<string
12
12
  batchingOptions?: BatchingOptions<K, V, C>;
13
13
  createProxyingResolver?: CreateProxyingResolverFn<TContext>;
14
14
  transforms: Array<Transform<any, TContext>>;
15
- transformedSchema: GraphQLSchema;
15
+ private _transformedSchema;
16
16
  merge?: Record<string, MergedTypeConfig<any, any, TContext>>;
17
17
  constructor(config: SubschemaConfig<K, V, C, TContext>);
18
+ get transformedSchema(): GraphQLSchema;
19
+ set transformedSchema(value: GraphQLSchema);
18
20
  }
19
21
  export {};
@@ -12,8 +12,10 @@ export declare class Subschema<K = any, V = any, C = K, TContext = Record<string
12
12
  batchingOptions?: BatchingOptions<K, V, C>;
13
13
  createProxyingResolver?: CreateProxyingResolverFn<TContext>;
14
14
  transforms: Array<Transform<any, TContext>>;
15
- transformedSchema: GraphQLSchema;
15
+ private _transformedSchema;
16
16
  merge?: Record<string, MergedTypeConfig<any, any, TContext>>;
17
17
  constructor(config: SubschemaConfig<K, V, C, TContext>);
18
+ get transformedSchema(): GraphQLSchema;
19
+ set transformedSchema(value: GraphQLSchema);
18
20
  }
19
21
  export {};