We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 26672e4 commit 4a38de2Copy full SHA for 4a38de2
3 files changed
src/execution/IncrementalPublisher.ts
@@ -584,10 +584,15 @@ export class IncrementalPublisher {
584
}
585
if (isStreamItemsRecord(subsequentResultRecord)) {
586
if (subsequentResultRecord.isFinalRecord) {
587
- newPendingSources.delete(subsequentResultRecord.streamRecord);
588
- completedResults.push(
589
- this._completedRecordToResult(subsequentResultRecord.streamRecord),
590
- );
+ if (newPendingSources.has(subsequentResultRecord.streamRecord)) {
+ newPendingSources.delete(subsequentResultRecord.streamRecord);
+ } else {
+ completedResults.push(
591
+ this._completedRecordToResult(
592
+ subsequentResultRecord.streamRecord,
593
+ ),
594
+ );
595
+ }
596
597
if (subsequentResultRecord.isCompletedAsyncIterator) {
598
// async iterable resolver just finished but there may be pending payloads
@@ -650,10 +655,13 @@ export class IncrementalPublisher {
650
655
);
651
656
652
657
} else {
653
- newPendingSources.delete(subsequentResultRecord);
654
- this._completedRecordToResult(subsequentResultRecord),
658
+ if (newPendingSources.has(subsequentResultRecord)) {
659
+ newPendingSources.delete(subsequentResultRecord);
660
661
662
+ this._completedRecordToResult(subsequentResultRecord),
663
664
665
if (subsequentResultRecord.errors.length > 0) {
666
continue;
667
src/execution/__tests__/defer-test.ts
@@ -1191,11 +1191,7 @@ describe('Execute: defer directive', () => {
1191
path: ['hero', 'nestedObject', 'deeperObject'],
1192
},
1193
],
1194
- completed: [
1195
- { path: ['hero'] },
1196
- { path: ['hero', 'nestedObject'] },
1197
- { path: ['hero', 'nestedObject', 'deeperObject'] },
1198
- ],
+ completed: [{ path: ['hero'] }],
1199
hasNext: false,
1200
1201
]);
@@ -1261,7 +1257,6 @@ describe('Execute: defer directive', () => {
1261
1257
completed: [
1262
1258
{ path: ['hero'] },
1263
1259
{ path: ['hero', 'nestedObject', 'deeperObject'] },
1264
1265
1260
1266
1267
@@ -2094,12 +2089,7 @@ describe('Execute: defer directive', () => {
2094
2089
path: ['hero'],
2095
2090
2096
2091
2097
2098
2099
- { path: ['hero', 'friends', 0] },
2100
- { path: ['hero', 'friends', 1] },
2101
- { path: ['hero', 'friends', 2] },
2102
2092
2103
2093
2104
2105
src/execution/__tests__/stream-test.ts
@@ -355,8 +355,6 @@ describe('Execute: stream directive', () => {
355
356
{ path: ['friendList'] },
357
{ path: ['friendList', 0, 'appearsIn'] },
358
- { path: ['friendList', 1, 'appearsIn'] },
359
- { path: ['friendList', 2, 'appearsIn'] },
360
361
362
@@ -404,15 +402,7 @@ describe('Execute: stream directive', () => {
404
402
path: ['friendList', 0],
405
403
406
407
408
- { path: ['friendList', 0] },
409
- { path: ['friendList'] },
410
- { path: ['friendList', 1] },
411
- { path: ['friendList', 2] },
412
- { path: ['friendList', 0, 'appearsIn'] },
413
414
415
+ completed: [{ path: ['friendList', 0] }, { path: ['friendList'] }],
416
417
418
0 commit comments