@@ -106,7 +106,7 @@ async def anext(iterator: AsyncIterator) -> Any: # noqa: A001
106
106
"subscribe" ,
107
107
"AsyncPayloadRecord" ,
108
108
"DeferredFragmentRecord" ,
109
- "StreamRecord " ,
109
+ "StreamItemsRecord " ,
110
110
"ExecutionResult" ,
111
111
"ExecutionContext" ,
112
112
"ExperimentalIncrementalExecutionResults" ,
@@ -1772,7 +1772,7 @@ def execute_stream_field(
1772
1772
) -> AsyncPayloadRecord :
1773
1773
"""Execute stream field."""
1774
1774
is_awaitable = self .is_awaitable
1775
- async_payload_record = StreamRecord (
1775
+ async_payload_record = StreamItemsRecord (
1776
1776
label , item_path , None , parent_context , self
1777
1777
)
1778
1778
completed_item : Any
@@ -1865,7 +1865,7 @@ async def execute_stream_async_iterator_item(
1865
1865
field_group : FieldGroup ,
1866
1866
info : GraphQLResolveInfo ,
1867
1867
item_type : GraphQLOutputType ,
1868
- async_payload_record : StreamRecord ,
1868
+ async_payload_record : StreamItemsRecord ,
1869
1869
item_path : Path ,
1870
1870
) -> Any :
1871
1871
"""Execute stream iterator item."""
@@ -1910,7 +1910,7 @@ async def execute_stream_async_iterator(
1910
1910
1911
1911
while True :
1912
1912
item_path = Path (path , index , None )
1913
- async_payload_record = StreamRecord (
1913
+ async_payload_record = StreamItemsRecord (
1914
1914
label , item_path , async_iterator , previous_async_payload_record , self
1915
1915
)
1916
1916
@@ -1961,7 +1961,10 @@ def filter_subsequent_payloads(
1961
1961
# async_record points to a path unaffected by this payload
1962
1962
continue
1963
1963
# async_record path points to nulled error field
1964
- if isinstance (async_record , StreamRecord ) and async_record .async_iterator :
1964
+ if (
1965
+ isinstance (async_record , StreamItemsRecord )
1966
+ and async_record .async_iterator
1967
+ ):
1965
1968
self ._canceled_iterators .add (async_record .async_iterator )
1966
1969
del self .subsequent_payloads [async_record ]
1967
1970
@@ -1975,7 +1978,7 @@ def get_completed_incremental_results(self) -> list[IncrementalResult]:
1975
1978
if not async_payload_record .completed .is_set ():
1976
1979
continue
1977
1980
del self .subsequent_payloads [async_payload_record ]
1978
- if isinstance (async_payload_record , StreamRecord ):
1981
+ if isinstance (async_payload_record , StreamItemsRecord ):
1979
1982
items = async_payload_record .items
1980
1983
if async_payload_record .is_completed_async_iterator :
1981
1984
# async iterable resolver finished but there may be pending payload
@@ -2659,7 +2662,7 @@ def add_data(self, data: AwaitableOrValue[dict[str, Any] | None]) -> None:
2659
2662
self ._data_added .set ()
2660
2663
2661
2664
2662
- class StreamRecord :
2665
+ class StreamItemsRecord :
2663
2666
"""A record collecting items marked with the stream directive"""
2664
2667
2665
2668
errors : list [GraphQLError ]
@@ -2735,4 +2738,4 @@ def set_is_completed_async_iterator(self) -> None:
2735
2738
self ._items_added .set ()
2736
2739
2737
2740
2738
- AsyncPayloadRecord = Union [DeferredFragmentRecord , StreamRecord ]
2741
+ AsyncPayloadRecord = Union [DeferredFragmentRecord , StreamItemsRecord ]
0 commit comments