File tree Expand file tree Collapse file tree 1 file changed +36
-21
lines changed Expand file tree Collapse file tree 1 file changed +36
-21
lines changed Original file line number Diff line number Diff line change @@ -225,29 +225,44 @@ describe('parse', () => {
225
225
} ) ;
226
226
227
227
it ( 'parses fragment spread arguments' , ( ) => {
228
- expect (
229
- parse ( 'query x { ...x(var: 2) } fragment x($var: Int = 1) on Type { field }' ) . definitions [ 0 ]
230
- ) . toHaveProperty ( 'selectionSet.selections.0' , {
231
- kind : Kind . FRAGMENT_SPREAD ,
232
- directives : undefined ,
233
- name : {
234
- kind : Kind . NAME ,
235
- value : 'x' ,
236
- } ,
237
- arguments : [
238
- {
239
- kind : 'Argument' ,
240
- name : {
241
- kind : 'Name' ,
242
- value : 'var' ,
228
+ expect ( parse ( 'query x { ...x(varA: 2, varB: $var) }' ) . definitions [ 0 ] ) . toHaveProperty (
229
+ 'selectionSet.selections.0' ,
230
+ {
231
+ kind : Kind . FRAGMENT_SPREAD ,
232
+ directives : undefined ,
233
+ name : {
234
+ kind : Kind . NAME ,
235
+ value : 'x' ,
236
+ } ,
237
+ arguments : [
238
+ {
239
+ kind : 'Argument' ,
240
+ name : {
241
+ kind : 'Name' ,
242
+ value : 'varA' ,
243
+ } ,
244
+ value : {
245
+ kind : 'IntValue' ,
246
+ value : '2' ,
247
+ } ,
243
248
} ,
244
- value : {
245
- kind : 'IntValue' ,
246
- value : '2' ,
249
+ {
250
+ kind : 'Argument' ,
251
+ name : {
252
+ kind : 'Name' ,
253
+ value : 'varB' ,
254
+ } ,
255
+ value : {
256
+ kind : 'Variable' ,
257
+ name : {
258
+ kind : 'Name' ,
259
+ value : 'var' ,
260
+ } ,
261
+ } ,
247
262
} ,
248
- } ,
249
- ] ,
250
- } ) ;
263
+ ] ,
264
+ }
265
+ ) ;
251
266
} ) ;
252
267
253
268
it ( 'parses fields' , ( ) => {
You can’t perform that action at this time.
0 commit comments