Skip to content

Commit 81ef8aa

Browse files
committed
polish(incremental): move check for empty state to end of batch
Replicates graphql/graphql-js@dfcc4e5
1 parent 258cc64 commit 81ef8aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/graphql/execution/incremental_graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ def _remove_root_node(
164164
) -> None:
165165
"""Remove root node."""
166166
del self._root_nodes[subsequent_result_record]
167-
if not self._root_nodes:
168-
self.stop_incremental_data()
169167

170168
def _add_incremental_data_records(
171169
self,
@@ -337,6 +335,8 @@ def _yield_current_completed_incremental_data(
337335
queue = self._completed_queue
338336
while queue:
339337
yield queue.pop(0)
338+
if not self._root_nodes:
339+
self.stop_incremental_data()
340340

341341
def _enqueue(self, completed: IncrementalDataRecordResult) -> None:
342342
"""Enqueue completed incremental data record result."""

0 commit comments

Comments
 (0)