Skip to content

Commit

Permalink
rename feature flag to experimentalDefer
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/type/schema.js
  • Loading branch information
robrichard committed Jan 2, 2020
1 parent 7efad59 commit 7f8e2f0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/starWarsSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
4 changes: 2 additions & 2 deletions src/execution/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ export function collectFields(
continue;
}

const patchLabel = exeContext.schema.__experimentalDeferFragmentSpreads
const patchLabel = exeContext.schema.__experimentalDefer
? getDeferredNodeLabel(exeContext, selection)
: '';

Expand Down Expand Up @@ -582,7 +582,7 @@ export function collectFields(
continue;
}

const patchLabel = exeContext.schema.__experimentalDeferFragmentSpreads
const patchLabel = exeContext.schema.__experimentalDefer
? getDeferredNodeLabel(exeContext, selection)
: '';

Expand Down
10 changes: 5 additions & 5 deletions src/type/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class GraphQLSchema {
// Used as a cache for validateSchema().
__validationErrors: ?$ReadOnlyArray<GraphQLError>;
// Referenced by execute()
__experimentalDeferFragmentSpreads: boolean;
__experimentalDefer: boolean;
__experimentalStream: boolean;

constructor(config: $ReadOnly<GraphQLSchemaConfig>): void {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -335,7 +335,7 @@ export type GraphQLSchemaValidationOptions = {|
*
* Default: false
*/
experimentalDeferFragmentSpreads?: boolean,
experimentalDefer?: boolean,

/**
*
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/buildASTSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export function buildASTSchema(

if (
options &&
options.experimentalDeferFragmentSpreads &&
options.experimentalDefer &&
!directives.some(directive => directive.name === 'defer')
) {
directives.push(GraphQLDeferDirective);
Expand Down

0 comments on commit 7f8e2f0

Please sign in to comment.