Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacovCR committed Dec 27, 2022
1 parent f1a92a3 commit 9bba7ee
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/execution/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,7 @@ async function executeStreamIterator(

if (done) {
asyncPayloadRecord.setIsCompletedIterator();
asyncPayloadRecord.addItems([item]);
asyncPayloadRecord.addItems(null);
break;
}

Expand All @@ -2066,23 +2066,22 @@ async function executeStreamIterator(
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
}

let completedItems: PromiseOrValue<Array<unknown> | null>;
if (isPromise(completedItem)) {
completedItems = completedItemsFromPromisedCompletedStreamedItem(
iterator,
exeContext,
itemType,
fieldNodes,
path,
itemPath,
completedItem,
asyncPayloadRecord,
asyncPayloadRecord.addItems(
completedItemsFromPromisedCompletedStreamedItem(
iterator,
exeContext,
itemType,
fieldNodes,
path,
itemPath,
completedItem,
asyncPayloadRecord,
),
);
} else {
completedItems = [completedItem];
asyncPayloadRecord.addItems([completedItem]);
}

asyncPayloadRecord.addItems(completedItems);
} catch (error) {
handleStreamError(iterator, exeContext, path, asyncPayloadRecord, error);
asyncPayloadRecord.addItems(null);
Expand Down

0 comments on commit 9bba7ee

Please sign in to comment.