@@ -22,7 +22,6 @@ import {
22
22
} from '../type/directives.js' ;
23
23
import type { GraphQLSchema } from '../type/schema.js' ;
24
24
25
- import { keyForFragmentSpread } from '../utilities/keyForFragmentSpread.js' ;
26
25
import { substituteFragmentArguments } from '../utilities/substituteFragmentArguments.js' ;
27
26
import { typeFromAST } from '../utilities/typeFromAST.js' ;
28
27
@@ -44,7 +43,7 @@ interface CollectFieldsContext {
44
43
variableValues : { [ variable : string ] : unknown } ;
45
44
operation : OperationDefinitionNode ;
46
45
runtimeType : GraphQLObjectType ;
47
- visitedFragmentKeys : Set < string > ;
46
+ visitedFragmentNames : Set < string > ;
48
47
}
49
48
50
49
/**
@@ -70,7 +69,7 @@ export function collectFields(
70
69
variableValues,
71
70
runtimeType,
72
71
operation,
73
- visitedFragmentKeys : new Set ( ) ,
72
+ visitedFragmentNames : new Set ( ) ,
74
73
} ;
75
74
76
75
collectFieldsImpl ( context , operation . selectionSet , groupedFieldSet ) ;
@@ -102,7 +101,7 @@ export function collectSubfields(
102
101
variableValues,
103
102
runtimeType : returnType ,
104
103
operation,
105
- visitedFragmentKeys : new Set ( ) ,
104
+ visitedFragmentNames : new Set ( ) ,
106
105
} ;
107
106
const subGroupedFieldSet = new AccumulatorMap < string , FieldDetails > ( ) ;
108
107
@@ -134,7 +133,7 @@ function collectFieldsImpl(
134
133
variableValues,
135
134
runtimeType,
136
135
operation,
137
- visitedFragmentKeys ,
136
+ visitedFragmentNames ,
138
137
} = context ;
139
138
140
139
for ( const selection of selectionSet . selections ) {
@@ -175,7 +174,7 @@ function collectFieldsImpl(
175
174
break ;
176
175
}
177
176
case Kind . FRAGMENT_SPREAD : {
178
- const fragmentKey = keyForFragmentSpread ( selection ) ;
177
+ const fragmentName = selection . name . value ;
179
178
180
179
const newDeferUsage = getDeferUsage (
181
180
operation ,
@@ -186,13 +185,13 @@ function collectFieldsImpl(
186
185
187
186
if (
188
187
! newDeferUsage &&
189
- ( visitedFragmentKeys . has ( fragmentKey ) ||
188
+ ( visitedFragmentNames . has ( fragmentName ) ||
190
189
! shouldIncludeNode ( variableValues , selection ) )
191
190
) {
192
191
continue ;
193
192
}
194
193
195
- const fragment = fragments [ selection . name . value ] ;
194
+ const fragment = fragments [ fragmentName ] ;
196
195
if (
197
196
fragment == null ||
198
197
! doesFragmentConditionMatch ( schema , fragment , runtimeType )
@@ -201,7 +200,7 @@ function collectFieldsImpl(
201
200
}
202
201
203
202
if ( ! newDeferUsage ) {
204
- visitedFragmentKeys . add ( fragmentKey ) ;
203
+ visitedFragmentNames . add ( fragmentName ) ;
205
204
}
206
205
207
206
const fragmentSelectionSet = substituteFragmentArguments (
0 commit comments