diff --git a/src/__tests__/starWarsSchema.js b/src/__tests__/starWarsSchema.js index 0a9ded69dc..2869d9eded 100644 --- a/src/__tests__/starWarsSchema.js +++ b/src/__tests__/starWarsSchema.js @@ -309,6 +309,6 @@ export const StarWarsSchema = new GraphQLSchema({ export const StarWarsSchemaDeferStreamEnabled = new GraphQLSchema({ query: queryType, types: [humanType, droidType], - experimentalDeferFragmentSpreads: true, + experimentalDefer: true, experimentalStream: true, }); diff --git a/src/execution/execute.js b/src/execution/execute.js index b7f7c397fb..77dff38573 100644 --- a/src/execution/execute.js +++ b/src/execution/execute.js @@ -546,7 +546,7 @@ export function collectFields( continue; } - const patchLabel = exeContext.schema.__experimentalDeferFragmentSpreads + const patchLabel = exeContext.schema.__experimentalDefer ? getDeferredNodeLabel(exeContext, selection) : ''; @@ -582,7 +582,7 @@ export function collectFields( continue; } - const patchLabel = exeContext.schema.__experimentalDeferFragmentSpreads + const patchLabel = exeContext.schema.__experimentalDefer ? getDeferredNodeLabel(exeContext, selection) : ''; diff --git a/src/type/schema.js b/src/type/schema.js index 7ebd771ab5..2b56f54fc5 100644 --- a/src/type/schema.js +++ b/src/type/schema.js @@ -137,7 +137,7 @@ export class GraphQLSchema { // Used as a cache for validateSchema(). __validationErrors: ?$ReadOnlyArray; // Referenced by execute() - __experimentalDeferFragmentSpreads: boolean; + __experimentalDefer: boolean; __experimentalStream: boolean; constructor(config: $ReadOnly): void { @@ -173,11 +173,11 @@ export class GraphQLSchema { // Provide specified directives (e.g. @include and @skip) by default. this._directives = config.directives || specifiedDirectives; - if (config.experimentalDeferFragmentSpreads) { - this.__experimentalDeferFragmentSpreads = true; + if (config.__experimentalDefer) { + this.____experimentalDefer = true; this._directives = [].concat(this._directives, [GraphQLDeferDirective]); } else { - this.__experimentalDeferFragmentSpreads = false; + this.____experimentalDefer = false; } if (config.experimentalStream) { @@ -335,7 +335,7 @@ export type GraphQLSchemaValidationOptions = {| * * Default: false */ - experimentalDeferFragmentSpreads?: boolean, + experimentalDefer?: boolean, /** * diff --git a/src/utilities/buildASTSchema.js b/src/utilities/buildASTSchema.js index 251b965b35..85e9beb661 100644 --- a/src/utilities/buildASTSchema.js +++ b/src/utilities/buildASTSchema.js @@ -109,7 +109,7 @@ export function buildASTSchema( if ( options && - options.experimentalDeferFragmentSpreads && + options.experimentalDefer && !directives.some(directive => directive.name === 'defer') ) { directives.push(GraphQLDeferDirective);