diff --git a/src/execution/collectFields.ts b/src/execution/collectFields.ts index 94dd2b50bd..9146312f70 100644 --- a/src/execution/collectFields.ts +++ b/src/execution/collectFields.ts @@ -56,7 +56,6 @@ interface CollectFieldsContext { schema: GraphQLSchema; fragments: ObjMap; variableValues: { [variable: string]: unknown }; - fragmentVariableValues?: FragmentVariables; operation: OperationDefinitionNode; runtimeType: GraphQLObjectType; visitedFragmentNames: Set; @@ -135,14 +134,16 @@ export function collectSubfields( const newDeferUsages: Array = []; for (const fieldDetail of fieldGroup) { - const node = fieldDetail.node; - if (node.selectionSet) { + const selectionSet = fieldDetail.node.selectionSet; + if (selectionSet) { + const { deferUsage, fragmentVariables } = fieldDetail; collectFieldsImpl( context, - node.selectionSet, + selectionSet, subGroupedFieldSet, newDeferUsages, - fieldDetail.deferUsage, + deferUsage, + fragmentVariables, ); } }