@@ -378,16 +378,18 @@ to that effect within the initial result, while the `pending` entry for
378378
379379Delivery group nodes may have three different types of child nodes:
380380
381- 1 . Other delivery group nodes, i.e. the node representing ` SlowFragment ` should
381+ 1 . Child Delivery Group nodes, i.e. the node representing ` SlowFragment ` should
382382 have a child node representing ` SlowestFragment ` .
383- 2 . Pending incremental data nodes, i.e. the node for ` SlowFragment ` should
383+ 2 . Pending Incremental Data nodes, i.e. the node for ` SlowFragment ` should
384384 initially have a node for ` slowField ` .
385- 3 . Completed incremental data nodes, i.e. when ` slowField ` is completed, the
385+ 3 . Completed Incremental Data nodes, i.e. when ` slowField ` is completed, the
386386 pending incremental data node for ` slowField ` should be replaced with a node
387387 representing the completed data.
388388
389389The {YieldIncrementalResults()} algorithm is responsible for updating the graph
390- as it yields the incremental results.
390+ as it yields the incremental results. When a delivery group contains only
391+ completed incremental data nodes, the group is removed from the graph as it is
392+ delivered.
391393
392394YieldIncrementalResults(data, errors, incrementalDataRecords):
393395
@@ -413,7 +415,7 @@ YieldIncrementalResults(data, errors, incrementalDataRecords):
413415 - Let {resultIncrementalDataRecords} be {incrementalDataRecords} on {result}.
414416 - Update {graph} to {GraphFromRecords(resultIncrementalDataRecords, graph)}.
415417 - Let {completedDeferredFragments} be the set of root nodes in {graph} without
416- any child Pending Data nodes.
418+ any child Pending Incremental Data nodes.
417419 - Let {completedIncrementalDataNodes} be the set of completed Incremental Data
418420 nodes that are children of {completedDeferredFragments}.
419421 - If {completedIncrementalDataNodes} is empty, continue to the next completed
@@ -438,17 +440,39 @@ YieldIncrementalResults(data, errors, incrementalDataRecords):
438440 pending)}.
439441- Complete this incremental result stream.
440442
443+ New Incremental Data Records are added to the {graph} by the
444+ {GraphFromRecords()} algorithm as Pending Incremental Data nodes directed from
445+ the Deferred Fragments they incrementally complete.
446+
441447GraphFromRecords(incrementalDataRecords, graph):
442448
443449- If {graph} is not provided, initialize to an empty graph.
444450- Let {newGraph} be a new directed acyclic graph containing all of the nodes and
445451 edges in {graph}.
446452- For each {incrementalDataRecord} of {incrementalDataRecords}:
447- - Add {incrementalDataRecord} to {newGraph} as a new Pending Data node
448- directed from the {pendingResults} that it completes, adding each of
449- {pendingResults} to {newGraph} as a new node directed from its {parent},
450- recursively adding each {parent} until {incrementalDataRecord} is connected
451- to {newGraph}, or the {parent} is not defined.
453+ - Let {deferredFragments} be the Deferred Fragments incrementally completed by
454+ {incrementalDataRecord}.
455+ - For each {deferredFragment} of {deferredFragments}:
456+ - Reset {newGraph} to the result of
457+ {GraphWithDeferredFragmentRecord(deferredFragment, newGraph)}.
458+ - Add {incrementalDataRecord} to {newGraph} as a new Pending Incremental Data
459+ node directed from the {deferredFragments} that it completes.
460+ - Return {newGraph}.
461+
462+ The {GraphWithDeferredFragmentRecord()} algorithm returns a new graph containing
463+ the provided Deferred Fragment Record, recursively adding its parent Deferred
464+ Fragment nodes.
465+
466+ GraphWithDeferredFragmentRecord(deferredFragment, graph):
467+
468+ - If {graph} contains a Deferred Fragment node representing {deferredFragment},
469+ return {graph}.
470+ - Let {parent} be the parent Deferred Fragment of {deferredFragment}.
471+ - If {parent} is defined, let {newGraph} be the result of
472+ {GraphWithDeferredFragmentRecord(parent, graph)}; otherwise, let {newGraph} be
473+ a new directed acyclic graph containing all of the nodes and edges in {graph}.
474+ - Add {deferredFragment} to {newGraph} as a new Deferred Fragment node directed
475+ from {parent}, if defined.
452476- Return {newGraph}.
453477
454478The {GetNewRootNodes()} algorithm is responsible for determining the new root
0 commit comments