@@ -386,13 +386,13 @@ YieldSubsequentPayloads(subsequentPayloads):
386
386
- Let {record} be the first item in {subsequentPayloads} with a completed
387
387
{dataExecution}.
388
388
- Remove {record} from {subsequentPayloads}.
389
- - Let {payload} be the completed result returned by {dataExecution}.
390
- - If {payload} is {null}:
389
+ - If {isCompletedIterator} on {record} is {true}:
391
390
- If {subsequentPayloads} is empty:
392
391
- Yield a map containing a field ` hasNext ` with the value {false}.
393
392
- Return.
394
393
- If {subsequentPayloads} is not empty:
395
394
- Continue to the next record in {subsequentPayloads}.
395
+ - Let {payload} be the completed result returned by {dataExecution}.
396
396
- If {record} is not the final element in {subsequentPayloads}:
397
397
- Add an entry to {payload} named ` hasNext ` with the value {true}.
398
398
- If {record} is the final element in {subsequentPayloads}:
@@ -681,6 +681,8 @@ All Async Payload Records are structures containing:
681
681
- {path}: a list of field names and indices from root to the location of the
682
682
corresponding ` @defer ` or ` @stream ` directive.
683
683
- {iterator}: The underlying iterator if created from a ` @stream ` directive.
684
+ - {isCompletedIterator}: a boolean indicating the payload record was generated
685
+ from an iterator that has completed.
684
686
- {errors}: a list of field errors encountered during execution.
685
687
- {dataExecution}: A result that can notify when the corresponding execution has
686
688
completed.
@@ -863,6 +865,7 @@ variableValues, subsequentPayloads):
863
865
- Let {dataExecution} be the asynchronous future value of:
864
866
- Wait for the next item from {iterator}.
865
867
- If an item is not retrieved because {iterator} has completed:
868
+ - Set {isCompletedIterator} to {true} on {streamRecord}.
866
869
- Return {null}.
867
870
- Let {payload} be an unordered map.
868
871
- Let {item} be the item retrieved from {iterator}.
0 commit comments