@@ -7,12 +7,12 @@ import type { GraphQLError } from '../error/GraphQLError.js';
77
88import type {
99 DeferredFragmentRecord ,
10+ DeliveryGroup ,
1011 IncrementalDataRecord ,
1112 IncrementalDataRecordResult ,
1213 PendingExecutionGroup ,
1314 StreamItemRecord ,
1415 StreamRecord ,
15- SubsequentResultRecord ,
1616 SuccessfulExecutionGroup ,
1717} from './types.js' ;
1818import { isDeferredFragmentRecord , isPendingExecutionGroup } from './types.js' ;
@@ -21,7 +21,7 @@ import { isDeferredFragmentRecord, isPendingExecutionGroup } from './types.js';
2121 * @internal
2222 */
2323export class IncrementalGraph {
24- private _rootNodes : Set < SubsequentResultRecord > ;
24+ private _rootNodes : Set < DeliveryGroup > ;
2525
2626 private _completedQueue : Array < IncrementalDataRecordResult > ;
2727 private _nextQueue : Array <
@@ -36,8 +36,8 @@ export class IncrementalGraph {
3636
3737 getNewRootNodes (
3838 incrementalDataRecords : ReadonlyArray < IncrementalDataRecord > ,
39- ) : ReadonlyArray < SubsequentResultRecord > {
40- const initialResultChildren = new Set < SubsequentResultRecord > ( ) ;
39+ ) : ReadonlyArray < DeliveryGroup > {
40+ const initialResultChildren = new Set < DeliveryGroup > ( ) ;
4141 this . _addIncrementalDataRecords (
4242 incrementalDataRecords ,
4343 undefined ,
@@ -103,7 +103,7 @@ export class IncrementalGraph {
103103
104104 completeDeferredFragment ( deferredFragmentRecord : DeferredFragmentRecord ) :
105105 | {
106- newRootNodes : ReadonlyArray < SubsequentResultRecord > ;
106+ newRootNodes : ReadonlyArray < DeliveryGroup > ;
107107 successfulExecutionGroups : ReadonlyArray < SuccessfulExecutionGroup > ;
108108 }
109109 | undefined {
@@ -145,16 +145,14 @@ export class IncrementalGraph {
145145 this . _removeRootNode ( streamRecord ) ;
146146 }
147147
148- private _removeRootNode (
149- subsequentResultRecord : SubsequentResultRecord ,
150- ) : void {
151- this . _rootNodes . delete ( subsequentResultRecord ) ;
148+ private _removeRootNode ( deliveryGroup : DeliveryGroup ) : void {
149+ this . _rootNodes . delete ( deliveryGroup ) ;
152150 }
153151
154152 private _addIncrementalDataRecords (
155153 incrementalDataRecords : ReadonlyArray < IncrementalDataRecord > ,
156154 parents : ReadonlyArray < DeferredFragmentRecord > | undefined ,
157- initialResultChildren ?: Set < SubsequentResultRecord > | undefined ,
155+ initialResultChildren ?: Set < DeliveryGroup > | undefined ,
158156 ) : void {
159157 for ( const incrementalDataRecord of incrementalDataRecords ) {
160158 if ( isPendingExecutionGroup ( incrementalDataRecord ) ) {
@@ -183,9 +181,9 @@ export class IncrementalGraph {
183181 }
184182
185183 private _promoteNonEmptyToRoot (
186- maybeEmptyNewRootNodes : Set < SubsequentResultRecord > ,
187- ) : ReadonlyArray < SubsequentResultRecord > {
188- const newRootNodes : Array < SubsequentResultRecord > = [ ] ;
184+ maybeEmptyNewRootNodes : Set < DeliveryGroup > ,
185+ ) : ReadonlyArray < DeliveryGroup > {
186+ const newRootNodes : Array < DeliveryGroup > = [ ] ;
189187 for ( const node of maybeEmptyNewRootNodes ) {
190188 if ( isDeferredFragmentRecord ( node ) ) {
191189 if ( node . pendingExecutionGroups . size > 0 ) {
@@ -222,7 +220,7 @@ export class IncrementalGraph {
222220
223221 private _addDeferredFragment (
224222 deferredFragmentRecord : DeferredFragmentRecord ,
225- initialResultChildren : Set < SubsequentResultRecord > | undefined ,
223+ initialResultChildren : Set < DeliveryGroup > | undefined ,
226224 ) : void {
227225 if ( this . _rootNodes . has ( deferredFragmentRecord ) ) {
228226 return ;
0 commit comments