@@ -246,17 +246,22 @@ function value(constant: boolean): ast.ValueNode {
246
246
} ;
247
247
}
248
248
249
- function arguments_ ( constant : boolean ) : ast . ArgumentNode [ ] | undefined {
249
+ function arguments_ (
250
+ constant : boolean ,
251
+ fragmentArgument ?: boolean
252
+ ) : ast . ArgumentNode [ ] | ast . FragmentArgumentNode [ ] | undefined {
250
253
if ( input . charCodeAt ( idx ) === 40 /*'('*/ ) {
251
- const args : ast . ArgumentNode [ ] = [ ] ;
254
+ const args : ast . ArgumentNode [ ] | ast . FragmentArgumentNode [ ] = [ ] ;
252
255
idx ++ ;
253
256
ignored ( ) ;
254
257
do {
255
258
const name = nameNode ( ) ;
256
259
if ( input . charCodeAt ( idx ++ ) !== 58 /*':'*/ ) throw error ( 'Argument' ) ;
257
260
ignored ( ) ;
258
261
args . push ( {
259
- kind : 'Argument' as Kind . ARGUMENT ,
262
+ kind : fragmentArgument
263
+ ? ( 'FragmentArgument' as Kind . FRAGMENT_ARGUMENT )
264
+ : ( 'Argument' as Kind . ARGUMENT ) ,
260
265
name,
261
266
value : value ( constant ) ,
262
267
} ) ;
@@ -358,7 +363,8 @@ function selectionSet(): ast.SelectionSetNode {
358
363
selections . push ( {
359
364
kind : 'FragmentSpread' as Kind . FRAGMENT_SPREAD ,
360
365
name : nameNode ( ) ,
361
- arguments : arguments_ ( false ) ,
366
+ // @ts -expect-error
367
+ arguments : arguments_ ( false , true ) as readonly ast . FragmentArgumentNode [ ] ,
362
368
directives : directives ( false ) ,
363
369
} ) ;
364
370
}
@@ -379,7 +385,8 @@ function selectionSet(): ast.SelectionSetNode {
379
385
selections . push ( {
380
386
kind : 'FragmentSpread' as Kind . FRAGMENT_SPREAD ,
381
387
name : nameNode ( ) ,
382
- arguments : arguments_ ( false ) ,
388
+ // @ts -expect-error
389
+ arguments : arguments_ ( false , true ) as readonly ast . FragmentArgumentNode [ ] ,
383
390
directives : directives ( false ) ,
384
391
} ) ;
385
392
}
0 commit comments