Skip to content

Commit 82c4e3c

Browse files
robrichardlilianammmatos
authored andcommitted
rename feature flag to experimentalDefer
# Conflicts: # src/type/schema.js
1 parent a94e619 commit 82c4e3c

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

src/__tests__/starWarsSchema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,6 @@ export const StarWarsSchema: GraphQLSchema = new GraphQLSchema({
314314
export const StarWarsSchemaDeferStreamEnabled = new GraphQLSchema({
315315
query: queryType,
316316
types: [humanType, droidType],
317-
experimentalDeferFragmentSpreads: true,
317+
experimentalDefer: true,
318318
experimentalStream: true,
319319
});

src/execution/execute.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ export function collectFields(
550550
continue;
551551
}
552552

553-
const patchLabel = exeContext.schema.__experimentalDeferFragmentSpreads
553+
const patchLabel = exeContext.schema.__experimentalDefer
554554
? getDeferredNodeLabel(exeContext, selection)
555555
: '';
556556

@@ -586,7 +586,7 @@ export function collectFields(
586586
continue;
587587
}
588588

589-
const patchLabel = exeContext.schema.__experimentalDeferFragmentSpreads
589+
const patchLabel = exeContext.schema.__experimentalDefer
590590
? getDeferredNodeLabel(exeContext, selection)
591591
: '';
592592

src/type/schema.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class GraphQLSchema {
142142
// Used as a cache for validateSchema().
143143
__validationErrors: ?$ReadOnlyArray<GraphQLError>;
144144
// Referenced by execute()
145-
__experimentalDeferFragmentSpreads: boolean;
145+
__experimentalDefer: boolean;
146146
__experimentalStream: boolean;
147147

148148
constructor(config: $ReadOnly<GraphQLSchemaConfig>): void {
@@ -184,11 +184,12 @@ export class GraphQLSchema {
184184
collectReferencedTypes(type, allReferencedTypes);
185185
}
186186
}
187-
if (config.experimentalDeferFragmentSpreads) {
188-
this.__experimentalDeferFragmentSpreads = true;
187+
188+
if (config.__experimentalDefer) {
189+
this.____experimentalDefer = true;
189190
this._directives = [].concat(this._directives, [GraphQLDeferDirective]);
190191
} else {
191-
this.__experimentalDeferFragmentSpreads = false;
192+
this.____experimentalDefer = false;
192193
}
193194

194195
if (config.experimentalStream) {
@@ -394,7 +395,7 @@ export type GraphQLSchemaValidationOptions = {|
394395
*
395396
* Default: false
396397
*/
397-
experimentalDeferFragmentSpreads?: boolean,
398+
experimentalDefer?: boolean,
398399

399400
/**
400401
*

src/utilities/buildASTSchema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export function buildASTSchema(
109109

110110
if (
111111
options &&
112-
options.experimentalDeferFragmentSpreads &&
112+
options.experimentalDefer &&
113113
!directives.some(directive => directive.name === 'defer')
114114
) {
115115
directives.push(GraphQLDeferDirective);

0 commit comments

Comments
 (0)