Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
deferred fragments can be skipped if non-deferred
now that we do not have duplication
  • Loading branch information
yaacovCR committed Jan 9, 2025
commit ae933eaccd9fae4911b9d2d19a29f16f97dc43d6
23 changes: 9 additions & 14 deletions src/execution/collectFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -249,6 +237,13 @@ function collectFieldsImpl(
continue;
}

const newDeferUsage = getDeferUsage(
variableValues,
fragmentVariableValues,
selection,
deferUsage,
);

const fragmentVariableSignatures = fragment.variableSignatures;
let newFragmentVariableValues: VariableValues | undefined;
if (fragmentVariableSignatures) {
Expand Down
Loading