@@ -26,13 +26,17 @@ import { typeFromAST } from '../utilities/typeFromAST.js';
26
26
27
27
import { getDirectiveValues } from './values.js' ;
28
28
29
+ export type FieldGroup = ReadonlyArray < FieldNode > ;
30
+
31
+ export type GroupedFieldSet = Map < string , FieldGroup > ;
32
+
29
33
export interface PatchFields {
30
34
label : string | undefined ;
31
- fields : Map < string , ReadonlyArray < FieldNode > > ;
35
+ fields : GroupedFieldSet ;
32
36
}
33
37
34
38
export interface FieldsAndPatches {
35
- fields : Map < string , ReadonlyArray < FieldNode > > ;
39
+ fields : GroupedFieldSet ;
36
40
patches : Array < PatchFields > ;
37
41
}
38
42
@@ -85,7 +89,7 @@ export function collectSubfields(
85
89
variableValues : { [ variable : string ] : unknown } ,
86
90
operation : OperationDefinitionNode ,
87
91
returnType : GraphQLObjectType ,
88
- fieldNodes : ReadonlyArray < FieldNode > ,
92
+ fieldGroup : FieldGroup ,
89
93
) : FieldsAndPatches {
90
94
const subFieldNodes = new AccumulatorMap < string , FieldNode > ( ) ;
91
95
const visitedFragmentNames = new Set < string > ( ) ;
@@ -96,7 +100,7 @@ export function collectSubfields(
96
100
patches : subPatches ,
97
101
} ;
98
102
99
- for ( const node of fieldNodes ) {
103
+ for ( const node of fieldGroup ) {
100
104
if ( node . selectionSet ) {
101
105
collectFieldsImpl (
102
106
schema ,
0 commit comments