Skip to content

Commit b9f45cc

Browse files
add __experimentalDeferFragmentSpreads flag
1 parent 2349ab7 commit b9f45cc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/type/schema.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ export class GraphQLSchema {
134134
_subTypeMap: ObjMap<ObjMap<boolean>>;
135135
// Used as a cache for validateSchema().
136136
__validationErrors: ?$ReadOnlyArray<GraphQLError>;
137+
// Referenced by execute()
138+
__experimentalDeferFragmentSpreads: boolean;
137139

138140
constructor(config: $ReadOnly<GraphQLSchemaConfig>): void {
139141
// If this schema was built from a source known to be valid, then it may be
@@ -161,6 +163,8 @@ export class GraphQLSchema {
161163
this.astNode = config.astNode;
162164
this.extensionASTNodes = config.extensionASTNodes;
163165

166+
this.__experimentalDeferFragmentSpreads =
167+
config.experimentalDeferFragmentSpreads || false;
164168
this._queryType = config.query;
165169
this._mutationType = config.mutation;
166170
this._subscriptionType = config.subscription;
@@ -304,6 +308,18 @@ export type GraphQLSchemaValidationOptions = {|
304308
* Default: false
305309
*/
306310
assumeValid?: boolean,
311+
312+
/**
313+
*
314+
* EXPERIMENTAL:
315+
*
316+
* If enabled, processed fields from fragment spreads with @defer directive
317+
* are not returned from the iniital query and the respective data is returned
318+
* in patches after the initial result from the synchronous query.
319+
*
320+
* Default: false
321+
*/
322+
experimentalDeferFragmentSpreads?: boolean,
307323
|};
308324

309325
export type GraphQLSchemaConfig = {|

0 commit comments

Comments
 (0)