@@ -7,7 +7,6 @@ import type {
7
7
GraphQLObjectType ,
8
8
GraphQLOutputType ,
9
9
OperationDefinitionNode ,
10
- ValidatedExecutionArgs ,
11
10
} from 'graphql' ;
12
11
import {
13
12
getDirectiveValues ,
@@ -80,14 +79,13 @@ interface StreamUsage {
80
79
81
80
const collectSubfields = memoize3 (
82
81
(
83
- validatedExecutionArgs : ValidatedExecutionArgs ,
82
+ context : TransformationContext ,
84
83
returnType : GraphQLObjectType ,
85
84
fieldDetailsList : ReadonlyArray < FieldDetails > ,
86
85
) => {
87
- const { schema, fragments, variableValues, hideSuggestions } =
88
- validatedExecutionArgs ;
86
+ const { superschema, fragments, variableValues, hideSuggestions } = context ;
89
87
return _collectSubfields (
90
- schema ,
88
+ superschema ,
91
89
fragments ,
92
90
variableValues ,
93
91
returnType ,
@@ -118,14 +116,14 @@ export function completeInitialResult(
118
116
incrementalDataRecords : [ ] ,
119
117
} ;
120
118
121
- const { schema , variableValues, hideSuggestions } = context . argsWithNewLabels ;
119
+ const { superschema , variableValues, hideSuggestions } = context ;
122
120
123
- const rootType = schema . getRootType ( operation . operation ) ;
121
+ const rootType = superschema . getRootType ( operation . operation ) ;
124
122
invariant ( rootType != null ) ;
125
123
126
124
const { groupedFieldSet : originalGroupedFieldSet , newDeferUsages } =
127
125
collectFields (
128
- schema ,
126
+ superschema ,
129
127
fragments ,
130
128
variableValues ,
131
129
rootType ,
@@ -261,7 +259,7 @@ function completeValue(
261
259
262
260
invariant ( isObjectLike ( result ) ) ;
263
261
264
- const { prefix, argsWithNewLabels } = context ;
262
+ const { prefix, superschema } = context ;
265
263
266
264
const typeName = result [ prefix ] ;
267
265
@@ -271,12 +269,12 @@ function completeValue(
271
269
272
270
invariant ( typeof typeName === 'string' ) ;
273
271
274
- const runtimeType = argsWithNewLabels . schema . getType ( typeName ) ;
272
+ const runtimeType = superschema . getType ( typeName ) ;
275
273
276
274
invariant ( isObjectType ( runtimeType ) ) ;
277
275
278
276
const { groupedFieldSet : originalGroupedFieldSet , newDeferUsages } =
279
- collectSubfields ( argsWithNewLabels , runtimeType , fieldDetailsList ) ;
277
+ collectSubfields ( context , runtimeType , fieldDetailsList ) ;
280
278
281
279
const { groupedFieldSet, newGroupedFieldSets } = buildSubExecutionPlan (
282
280
context ,
@@ -373,9 +371,7 @@ function completeObjectValue(
373
371
incrementalContext : IncrementalContext ,
374
372
deferMap : ReadonlyMap < DeferUsage , DeferredFragment > | undefined ,
375
373
) : ObjMap < unknown > {
376
- const {
377
- argsWithNewLabels : { schema } ,
378
- } = context ;
374
+ const superschema = context . superschema ;
379
375
const completedObject = Object . create ( null ) ;
380
376
381
377
const objectFieldTransformers =
@@ -386,7 +382,7 @@ function completeObjectValue(
386
382
continue ;
387
383
}
388
384
const fieldName = fieldDetailsList [ 0 ] . node . name . value ;
389
- const fieldDef = schema . getField ( runtimeType , fieldName ) ;
385
+ const fieldDef = superschema . getField ( runtimeType , fieldName ) ;
390
386
391
387
if ( fieldDef ) {
392
388
const fieldType = fieldDef . type ;
@@ -719,7 +715,7 @@ function getStreamUsage(
719
715
const stream = getDirectiveValues (
720
716
GraphQLStreamDirective ,
721
717
fieldDetails . node ,
722
- context . argsWithNewLabels . variableValues ,
718
+ context . variableValues ,
723
719
fieldDetails . fragmentVariableValues ,
724
720
) ;
725
721
0 commit comments