From db670e9cb477517299aff468a9aecf560fc20459 Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Fri, 6 Sep 2024 17:15:37 +0300 Subject: [PATCH] fix collect fields have to add test case --- src/execution/collectFields.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/execution/collectFields.ts b/src/execution/collectFields.ts index bfa51f9465..9146312f70 100644 --- a/src/execution/collectFields.ts +++ b/src/execution/collectFields.ts @@ -134,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, ); } }