Skip to content

Commit

Permalink
revisit fragments if visited initially with defer (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacovCR authored Mar 4, 2022
1 parent 3083c1d commit c749991
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .changeset/red-otters-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'graphql-executor': patch
---

Revisit fragments if visited initially with `@defer`

Fragments visited previously with `@defer` have not been added to the initial group field set, and so must be added.

See: https://github.com/robrichard/defer-stream-wg/discussions/29#discussioncomment-2099307
3 changes: 2 additions & 1 deletion src/execution/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2594,7 +2594,6 @@ export class Executor {
) {
continue;
}
visitedFragmentNames.add(fragName);

if (defer) {
const patchFields = new Map();
Expand All @@ -2613,6 +2612,8 @@ export class Executor {
fields: patchFields,
});
} else {
visitedFragmentNames.add(fragName);

this.collectFieldsImpl(
fragments,
variableValues,
Expand Down

0 comments on commit c749991

Please sign in to comment.