Skip to content

Commit c749991

Browse files
authored
revisit fragments if visited initially with defer (#158)
1 parent 3083c1d commit c749991

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/red-otters-share.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'graphql-executor': patch
3+
---
4+
5+
Revisit fragments if visited initially with `@defer`
6+
7+
Fragments visited previously with `@defer` have not been added to the initial group field set, and so must be added.
8+
9+
See: https://github.com/robrichard/defer-stream-wg/discussions/29#discussioncomment-2099307

src/execution/executor.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,6 @@ export class Executor {
25942594
) {
25952595
continue;
25962596
}
2597-
visitedFragmentNames.add(fragName);
25982597

25992598
if (defer) {
26002599
const patchFields = new Map();
@@ -2613,6 +2612,8 @@ export class Executor {
26132612
fields: patchFields,
26142613
});
26152614
} else {
2615+
visitedFragmentNames.add(fragName);
2616+
26162617
this.collectFieldsImpl(
26172618
fragments,
26182619
variableValues,

0 commit comments

Comments
 (0)