@@ -26,13 +26,17 @@ import { typeFromAST } from '../utilities/typeFromAST.js';
2626
2727import { getDirectiveValues } from './values.js' ;
2828
29+ export type FieldGroup = ReadonlyArray < FieldNode > ;
30+
31+ export type GroupedFieldSet = Map < string , FieldGroup > ;
32+
2933export interface PatchFields {
3034 label : string | undefined ;
31- fields : Map < string , ReadonlyArray < FieldNode > > ;
35+ fields : GroupedFieldSet ;
3236}
3337
3438export interface FieldsAndPatches {
35- fields : Map < string , ReadonlyArray < FieldNode > > ;
39+ fields : GroupedFieldSet ;
3640 patches : Array < PatchFields > ;
3741}
3842
@@ -85,7 +89,7 @@ export function collectSubfields(
8589 variableValues : { [ variable : string ] : unknown } ,
8690 operation : OperationDefinitionNode ,
8791 returnType : GraphQLObjectType ,
88- fieldNodes : ReadonlyArray < FieldNode > ,
92+ fieldGroup : FieldGroup ,
8993) : FieldsAndPatches {
9094 const subFieldNodes = new AccumulatorMap < string , FieldNode > ( ) ;
9195 const visitedFragmentNames = new Set < string > ( ) ;
@@ -96,7 +100,7 @@ export function collectSubfields(
96100 patches : subPatches ,
97101 } ;
98102
99- for ( const node of fieldNodes ) {
103+ for ( const node of fieldGroup ) {
100104 if ( node . selectionSet ) {
101105 collectFieldsImpl (
102106 schema ,
0 commit comments