Skip to content

Commit 6d7ccdb

Browse files
committed
incrementalDelivery: fix iterable streaming with errors
Replicates graphql/graphql-js@065a343
1 parent a71f6a9 commit 6d7ccdb

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/graphql/execution/execute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,6 @@ def execute_stream_field(
17021702
label, item_path, None, parent_context, self
17031703
)
17041704
completed_item: Any
1705-
completed_items: Any
17061705
try:
17071706
try:
17081707
if self.is_awaitable(item):
@@ -1771,6 +1770,7 @@ async def await_completed_item() -> Any:
17711770
async_payload_record.add_items(None)
17721771
return async_payload_record
17731772

1773+
completed_items: AwaitableOrValue[Optional[List[Any]]]
17741774
if self.is_awaitable(complete_item):
17751775

17761776
async def await_completed_items() -> Optional[List[Any]]:

tests/execution/test_stream.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -992,10 +992,7 @@ async def handles_error_thrown_in_complete_value_after_initial_count_is_reached(
992992
)
993993

994994
async def scalar_list(_info):
995-
await sleep(0)
996-
yield friends[0].name
997-
await sleep(0)
998-
yield {}
995+
return [friends[0].name, {}]
999996

1000997
result = await complete(document, {"scalarList": scalar_list})
1001998
assert result == [

0 commit comments

Comments
 (0)