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 @@ -193,29 +193,44 @@ describe('parse', () => {
193
193
} ) ;
194
194
195
195
it ( 'parses fragment spread arguments' , ( ) => {
196
- expect (
197
- parse ( 'query x { ...x(var: 2) } fragment x($var: Int = 1) on Type { field }' ) . definitions [ 0 ]
198
- ) . toHaveProperty ( 'selectionSet.selections.0' , {
199
- kind : Kind . FRAGMENT_SPREAD ,
200
- directives : undefined ,
201
- name : {
202
- kind : Kind . NAME ,
203
- value : 'x' ,
204
- } ,
205
- arguments : [
206
- {
207
- kind : 'Argument' ,
208
- name : {
209
- kind : 'Name' ,
210
- value : 'var' ,
196
+ expect ( parse ( 'query x { ...x(varA: 2, varB: $var) }' ) . definitions [ 0 ] ) . toHaveProperty (
197
+ 'selectionSet.selections.0' ,
198
+ {
199
+ kind : Kind . FRAGMENT_SPREAD ,
200
+ directives : undefined ,
201
+ name : {
202
+ kind : Kind . NAME ,
203
+ value : 'x' ,
204
+ } ,
205
+ arguments : [
206
+ {
207
+ kind : 'Argument' ,
208
+ name : {
209
+ kind : 'Name' ,
210
+ value : 'varA' ,
211
+ } ,
212
+ value : {
213
+ kind : 'IntValue' ,
214
+ value : '2' ,
215
+ } ,
211
216
} ,
212
- value : {
213
- kind : 'IntValue' ,
214
- value : '2' ,
217
+ {
218
+ kind : 'Argument' ,
219
+ name : {
220
+ kind : 'Name' ,
221
+ value : 'varB' ,
222
+ } ,
223
+ value : {
224
+ kind : 'Variable' ,
225
+ name : {
226
+ kind : 'Name' ,
227
+ value : 'var' ,
228
+ } ,
229
+ } ,
215
230
} ,
216
- } ,
217
- ] ,
218
- } ) ;
231
+ ] ,
232
+ }
233
+ ) ;
219
234
} ) ;
220
235
221
236
it ( 'parses fields' , ( ) => {
You can’t perform that action at this time.
0 commit comments