diff --git a/src/execution/collectFields.ts b/src/execution/collectFields.ts index e6f764da76..bdca1ba9e0 100644 --- a/src/execution/collectFields.ts +++ b/src/execution/collectFields.ts @@ -222,21 +222,9 @@ function collectFieldsImpl( case Kind.FRAGMENT_SPREAD: { const fragName = selection.name.value; - const newDeferUsage = getDeferUsage( - variableValues, - fragmentVariableValues, - selection, - deferUsage, - ); - if ( - !newDeferUsage && - (visitedFragmentNames.has(fragName) || - !shouldIncludeNode( - selection, - variableValues, - fragmentVariableValues, - )) + visitedFragmentNames.has(fragName) || + !shouldIncludeNode(selection, variableValues, fragmentVariableValues) ) { continue; } @@ -249,6 +237,13 @@ function collectFieldsImpl( continue; } + const newDeferUsage = getDeferUsage( + variableValues, + fragmentVariableValues, + selection, + deferUsage, + ); + const fragmentVariableSignatures = fragment.variableSignatures; let newFragmentVariableValues: VariableValues | undefined; if (fragmentVariableSignatures) {