tangled
alpha
login
or
join now
kitten.sh
/
graphql.web
0
fork
atom
Mirror: The spec-compliant minimum of client-side GraphQL.
0
fork
atom
overview
issues
pulls
pipelines
Add initial template test
kitten.sh
3 years ago
1f2e0cc0
482d6a4e
+796
-1
4 changed files
expand all
collapse all
unified
split
package.json
pnpm-lock.yaml
src
__tests__
__snapshots__
parser.test.ts.snap
parser.test.ts
+4
package.json
···
74
74
"eslint-config-prettier": "^8.7.0",
75
75
"eslint-plugin-prettier": "^4.2.1",
76
76
"eslint-plugin-tsdoc": "^0.2.17",
77
77
+
"graphql": "^16.6.0",
77
78
"husky-v4": "^4.3.8",
78
79
"lint-staged": "^13.2.0",
79
80
"npm-run-all": "^4.1.5",
···
85
86
"terser": "^5.16.6",
86
87
"typescript": "^5.0.2",
87
88
"vitest": "^0.29.3"
89
89
+
},
90
90
+
"publishConfig": {
91
91
+
"access": "public"
88
92
}
89
93
}
+2
-1
pnpm-lock.yaml
···
17
17
eslint-config-prettier: ^8.7.0
18
18
eslint-plugin-prettier: ^4.2.1
19
19
eslint-plugin-tsdoc: ^0.2.17
20
20
+
graphql: ^16.6.0
20
21
husky-v4: ^4.3.8
21
22
lint-staged: ^13.2.0
22
23
npm-run-all: ^4.1.5
···
42
43
eslint-config-prettier: 8.7.0_eslint@8.36.0
43
44
eslint-plugin-prettier: 4.2.1_eqzx3hpkgx5nnvxls3azrcc7dm
44
45
eslint-plugin-tsdoc: 0.2.17
46
46
+
graphql: 16.6.0
45
47
husky-v4: 4.3.8
46
48
lint-staged: 13.2.0
47
49
npm-run-all: 4.1.5
···
2110
2112
/graphql/16.6.0:
2111
2113
resolution: {integrity: sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==}
2112
2114
engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0}
2113
2113
-
dev: false
2114
2115
2115
2116
/hard-rejection/2.1.0:
2116
2117
resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==}
+779
src/__tests__/__snapshots__/parser.test.ts.snap
···
1
1
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
+
3
3
+
exports[`parse > parses the kitchen sink query 1`] = `
4
4
+
{
5
5
+
"definitions": [
6
6
+
{
7
7
+
"directives": [
8
8
+
{
9
9
+
"arguments": [],
10
10
+
"kind": "Directive",
11
11
+
"name": {
12
12
+
"kind": "Name",
13
13
+
"value": "onQuery",
14
14
+
},
15
15
+
},
16
16
+
],
17
17
+
"kind": "OperationDefinition",
18
18
+
"name": {
19
19
+
"kind": "Name",
20
20
+
"value": "queryName",
21
21
+
},
22
22
+
"operation": "query",
23
23
+
"selectionSet": {
24
24
+
"kind": "SelectionSet",
25
25
+
"selections": [
26
26
+
{
27
27
+
"alias": {
28
28
+
"kind": "Name",
29
29
+
"value": "whoever123is",
30
30
+
},
31
31
+
"arguments": [
32
32
+
{
33
33
+
"kind": "Argument",
34
34
+
"name": {
35
35
+
"kind": "Name",
36
36
+
"value": "id",
37
37
+
},
38
38
+
"value": {
39
39
+
"kind": "ListValue",
40
40
+
"values": [
41
41
+
{
42
42
+
"kind": "FloatValue",
43
43
+
"value": "123",
44
44
+
},
45
45
+
{
46
46
+
"kind": "FloatValue",
47
47
+
"value": "456",
48
48
+
},
49
49
+
],
50
50
+
},
51
51
+
},
52
52
+
],
53
53
+
"directives": [],
54
54
+
"kind": "Field",
55
55
+
"name": {
56
56
+
"kind": "Name",
57
57
+
"value": "node",
58
58
+
},
59
59
+
"selectionSet": {
60
60
+
"kind": "SelectionSet",
61
61
+
"selections": [
62
62
+
{
63
63
+
"alias": undefined,
64
64
+
"arguments": [],
65
65
+
"directives": [],
66
66
+
"kind": "Field",
67
67
+
"name": {
68
68
+
"kind": "Name",
69
69
+
"value": "id",
70
70
+
},
71
71
+
"selectionSet": undefined,
72
72
+
},
73
73
+
{
74
74
+
"directives": [],
75
75
+
"kind": "FragmentSpread",
76
76
+
"name": {
77
77
+
"kind": "Name",
78
78
+
"value": "on",
79
79
+
},
80
80
+
},
81
81
+
{
82
82
+
"alias": undefined,
83
83
+
"arguments": [],
84
84
+
"directives": [
85
85
+
{
86
86
+
"arguments": [],
87
87
+
"kind": "Directive",
88
88
+
"name": {
89
89
+
"kind": "Name",
90
90
+
"value": "onInlineFragment",
91
91
+
},
92
92
+
},
93
93
+
],
94
94
+
"kind": "Field",
95
95
+
"name": {
96
96
+
"kind": "Name",
97
97
+
"value": "User",
98
98
+
},
99
99
+
"selectionSet": {
100
100
+
"kind": "SelectionSet",
101
101
+
"selections": [
102
102
+
{
103
103
+
"alias": undefined,
104
104
+
"arguments": [],
105
105
+
"directives": [],
106
106
+
"kind": "Field",
107
107
+
"name": {
108
108
+
"kind": "Name",
109
109
+
"value": "field2",
110
110
+
},
111
111
+
"selectionSet": {
112
112
+
"kind": "SelectionSet",
113
113
+
"selections": [
114
114
+
{
115
115
+
"alias": undefined,
116
116
+
"arguments": [],
117
117
+
"directives": [],
118
118
+
"kind": "Field",
119
119
+
"name": {
120
120
+
"kind": "Name",
121
121
+
"value": "id",
122
122
+
},
123
123
+
"selectionSet": undefined,
124
124
+
},
125
125
+
{
126
126
+
"alias": {
127
127
+
"kind": "Name",
128
128
+
"value": "alias",
129
129
+
},
130
130
+
"arguments": [
131
131
+
{
132
132
+
"kind": "Argument",
133
133
+
"name": {
134
134
+
"kind": "Name",
135
135
+
"value": "first",
136
136
+
},
137
137
+
"value": {
138
138
+
"kind": "FloatValue",
139
139
+
"value": "10",
140
140
+
},
141
141
+
},
142
142
+
{
143
143
+
"kind": "Argument",
144
144
+
"name": {
145
145
+
"kind": "Name",
146
146
+
"value": "after",
147
147
+
},
148
148
+
"value": {
149
149
+
"kind": "Variable",
150
150
+
"name": {
151
151
+
"kind": "Name",
152
152
+
"value": "foo",
153
153
+
},
154
154
+
},
155
155
+
},
156
156
+
],
157
157
+
"directives": [
158
158
+
{
159
159
+
"arguments": [
160
160
+
{
161
161
+
"kind": "Argument",
162
162
+
"name": {
163
163
+
"kind": "Name",
164
164
+
"value": "if",
165
165
+
},
166
166
+
"value": {
167
167
+
"kind": "Variable",
168
168
+
"name": {
169
169
+
"kind": "Name",
170
170
+
"value": "foo",
171
171
+
},
172
172
+
},
173
173
+
},
174
174
+
],
175
175
+
"kind": "Directive",
176
176
+
"name": {
177
177
+
"kind": "Name",
178
178
+
"value": "include",
179
179
+
},
180
180
+
},
181
181
+
],
182
182
+
"kind": "Field",
183
183
+
"name": {
184
184
+
"kind": "Name",
185
185
+
"value": "field1",
186
186
+
},
187
187
+
"selectionSet": {
188
188
+
"kind": "SelectionSet",
189
189
+
"selections": [
190
190
+
{
191
191
+
"alias": undefined,
192
192
+
"arguments": [],
193
193
+
"directives": [],
194
194
+
"kind": "Field",
195
195
+
"name": {
196
196
+
"kind": "Name",
197
197
+
"value": "id",
198
198
+
},
199
199
+
"selectionSet": undefined,
200
200
+
},
201
201
+
{
202
202
+
"directives": [
203
203
+
{
204
204
+
"arguments": [],
205
205
+
"kind": "Directive",
206
206
+
"name": {
207
207
+
"kind": "Name",
208
208
+
"value": "onFragmentSpread",
209
209
+
},
210
210
+
},
211
211
+
],
212
212
+
"kind": "FragmentSpread",
213
213
+
"name": {
214
214
+
"kind": "Name",
215
215
+
"value": "frag",
216
216
+
},
217
217
+
},
218
218
+
],
219
219
+
},
220
220
+
},
221
221
+
],
222
222
+
},
223
223
+
},
224
224
+
],
225
225
+
},
226
226
+
},
227
227
+
{
228
228
+
"directives": [
229
229
+
{
230
230
+
"arguments": [
231
231
+
{
232
232
+
"kind": "Argument",
233
233
+
"name": {
234
234
+
"kind": "Name",
235
235
+
"value": "unless",
236
236
+
},
237
237
+
"value": {
238
238
+
"kind": "Variable",
239
239
+
"name": {
240
240
+
"kind": "Name",
241
241
+
"value": "foo",
242
242
+
},
243
243
+
},
244
244
+
},
245
245
+
],
246
246
+
"kind": "Directive",
247
247
+
"name": {
248
248
+
"kind": "Name",
249
249
+
"value": "skip",
250
250
+
},
251
251
+
},
252
252
+
],
253
253
+
"kind": "InlineFragment",
254
254
+
"selectionSet": {
255
255
+
"kind": "SelectionSet",
256
256
+
"selections": [
257
257
+
{
258
258
+
"alias": undefined,
259
259
+
"arguments": [],
260
260
+
"directives": [],
261
261
+
"kind": "Field",
262
262
+
"name": {
263
263
+
"kind": "Name",
264
264
+
"value": "id",
265
265
+
},
266
266
+
"selectionSet": undefined,
267
267
+
},
268
268
+
],
269
269
+
},
270
270
+
"typeCondition": undefined,
271
271
+
},
272
272
+
{
273
273
+
"directives": [],
274
274
+
"kind": "InlineFragment",
275
275
+
"selectionSet": {
276
276
+
"kind": "SelectionSet",
277
277
+
"selections": [
278
278
+
{
279
279
+
"alias": undefined,
280
280
+
"arguments": [],
281
281
+
"directives": [],
282
282
+
"kind": "Field",
283
283
+
"name": {
284
284
+
"kind": "Name",
285
285
+
"value": "id",
286
286
+
},
287
287
+
"selectionSet": undefined,
288
288
+
},
289
289
+
],
290
290
+
},
291
291
+
"typeCondition": undefined,
292
292
+
},
293
293
+
],
294
294
+
},
295
295
+
},
296
296
+
],
297
297
+
},
298
298
+
"variableDefinitions": [
299
299
+
{
300
300
+
"defaultValue": undefined,
301
301
+
"directives": [],
302
302
+
"kind": "VariableDefinition",
303
303
+
"type": {
304
304
+
"kind": "NamedType",
305
305
+
"name": {
306
306
+
"kind": "Name",
307
307
+
"value": "ComplexType",
308
308
+
},
309
309
+
},
310
310
+
"variable": {
311
311
+
"kind": "Variable",
312
312
+
"name": {
313
313
+
"kind": "Name",
314
314
+
"value": "foo",
315
315
+
},
316
316
+
},
317
317
+
},
318
318
+
{
319
319
+
"defaultValue": {
320
320
+
"kind": "EnumValue",
321
321
+
"value": "MOBILE",
322
322
+
},
323
323
+
"directives": [],
324
324
+
"kind": "VariableDefinition",
325
325
+
"type": {
326
326
+
"kind": "NamedType",
327
327
+
"name": {
328
328
+
"kind": "Name",
329
329
+
"value": "Site",
330
330
+
},
331
331
+
},
332
332
+
"variable": {
333
333
+
"kind": "Variable",
334
334
+
"name": {
335
335
+
"kind": "Name",
336
336
+
"value": "site",
337
337
+
},
338
338
+
},
339
339
+
},
340
340
+
],
341
341
+
},
342
342
+
{
343
343
+
"directives": [
344
344
+
{
345
345
+
"arguments": [],
346
346
+
"kind": "Directive",
347
347
+
"name": {
348
348
+
"kind": "Name",
349
349
+
"value": "onMutation",
350
350
+
},
351
351
+
},
352
352
+
],
353
353
+
"kind": "OperationDefinition",
354
354
+
"name": {
355
355
+
"kind": "Name",
356
356
+
"value": "likeStory",
357
357
+
},
358
358
+
"operation": "mutation",
359
359
+
"selectionSet": {
360
360
+
"kind": "SelectionSet",
361
361
+
"selections": [
362
362
+
{
363
363
+
"alias": undefined,
364
364
+
"arguments": [
365
365
+
{
366
366
+
"kind": "Argument",
367
367
+
"name": {
368
368
+
"kind": "Name",
369
369
+
"value": "story",
370
370
+
},
371
371
+
"value": {
372
372
+
"kind": "FloatValue",
373
373
+
"value": "123",
374
374
+
},
375
375
+
},
376
376
+
],
377
377
+
"directives": [
378
378
+
{
379
379
+
"arguments": [],
380
380
+
"kind": "Directive",
381
381
+
"name": {
382
382
+
"kind": "Name",
383
383
+
"value": "onField",
384
384
+
},
385
385
+
},
386
386
+
],
387
387
+
"kind": "Field",
388
388
+
"name": {
389
389
+
"kind": "Name",
390
390
+
"value": "like",
391
391
+
},
392
392
+
"selectionSet": {
393
393
+
"kind": "SelectionSet",
394
394
+
"selections": [
395
395
+
{
396
396
+
"alias": undefined,
397
397
+
"arguments": [],
398
398
+
"directives": [],
399
399
+
"kind": "Field",
400
400
+
"name": {
401
401
+
"kind": "Name",
402
402
+
"value": "story",
403
403
+
},
404
404
+
"selectionSet": {
405
405
+
"kind": "SelectionSet",
406
406
+
"selections": [
407
407
+
{
408
408
+
"alias": undefined,
409
409
+
"arguments": [],
410
410
+
"directives": [
411
411
+
{
412
412
+
"arguments": [],
413
413
+
"kind": "Directive",
414
414
+
"name": {
415
415
+
"kind": "Name",
416
416
+
"value": "onField",
417
417
+
},
418
418
+
},
419
419
+
],
420
420
+
"kind": "Field",
421
421
+
"name": {
422
422
+
"kind": "Name",
423
423
+
"value": "id",
424
424
+
},
425
425
+
"selectionSet": undefined,
426
426
+
},
427
427
+
],
428
428
+
},
429
429
+
},
430
430
+
],
431
431
+
},
432
432
+
},
433
433
+
],
434
434
+
},
435
435
+
"variableDefinitions": [],
436
436
+
},
437
437
+
{
438
438
+
"directives": [
439
439
+
{
440
440
+
"arguments": [],
441
441
+
"kind": "Directive",
442
442
+
"name": {
443
443
+
"kind": "Name",
444
444
+
"value": "onSubscription",
445
445
+
},
446
446
+
},
447
447
+
],
448
448
+
"kind": "OperationDefinition",
449
449
+
"name": {
450
450
+
"kind": "Name",
451
451
+
"value": "StoryLikeSubscription",
452
452
+
},
453
453
+
"operation": "subscription",
454
454
+
"selectionSet": {
455
455
+
"kind": "SelectionSet",
456
456
+
"selections": [
457
457
+
{
458
458
+
"alias": undefined,
459
459
+
"arguments": [
460
460
+
{
461
461
+
"kind": "Argument",
462
462
+
"name": {
463
463
+
"kind": "Name",
464
464
+
"value": "input",
465
465
+
},
466
466
+
"value": {
467
467
+
"kind": "Variable",
468
468
+
"name": {
469
469
+
"kind": "Name",
470
470
+
"value": "input",
471
471
+
},
472
472
+
},
473
473
+
},
474
474
+
],
475
475
+
"directives": [],
476
476
+
"kind": "Field",
477
477
+
"name": {
478
478
+
"kind": "Name",
479
479
+
"value": "storyLikeSubscribe",
480
480
+
},
481
481
+
"selectionSet": {
482
482
+
"kind": "SelectionSet",
483
483
+
"selections": [
484
484
+
{
485
485
+
"alias": undefined,
486
486
+
"arguments": [],
487
487
+
"directives": [],
488
488
+
"kind": "Field",
489
489
+
"name": {
490
490
+
"kind": "Name",
491
491
+
"value": "story",
492
492
+
},
493
493
+
"selectionSet": {
494
494
+
"kind": "SelectionSet",
495
495
+
"selections": [
496
496
+
{
497
497
+
"alias": undefined,
498
498
+
"arguments": [],
499
499
+
"directives": [],
500
500
+
"kind": "Field",
501
501
+
"name": {
502
502
+
"kind": "Name",
503
503
+
"value": "likers",
504
504
+
},
505
505
+
"selectionSet": {
506
506
+
"kind": "SelectionSet",
507
507
+
"selections": [
508
508
+
{
509
509
+
"alias": undefined,
510
510
+
"arguments": [],
511
511
+
"directives": [],
512
512
+
"kind": "Field",
513
513
+
"name": {
514
514
+
"kind": "Name",
515
515
+
"value": "count",
516
516
+
},
517
517
+
"selectionSet": undefined,
518
518
+
},
519
519
+
],
520
520
+
},
521
521
+
},
522
522
+
{
523
523
+
"alias": undefined,
524
524
+
"arguments": [],
525
525
+
"directives": [],
526
526
+
"kind": "Field",
527
527
+
"name": {
528
528
+
"kind": "Name",
529
529
+
"value": "likeSentence",
530
530
+
},
531
531
+
"selectionSet": {
532
532
+
"kind": "SelectionSet",
533
533
+
"selections": [
534
534
+
{
535
535
+
"alias": undefined,
536
536
+
"arguments": [],
537
537
+
"directives": [],
538
538
+
"kind": "Field",
539
539
+
"name": {
540
540
+
"kind": "Name",
541
541
+
"value": "text",
542
542
+
},
543
543
+
"selectionSet": undefined,
544
544
+
},
545
545
+
],
546
546
+
},
547
547
+
},
548
548
+
],
549
549
+
},
550
550
+
},
551
551
+
],
552
552
+
},
553
553
+
},
554
554
+
],
555
555
+
},
556
556
+
"variableDefinitions": [
557
557
+
{
558
558
+
"defaultValue": undefined,
559
559
+
"directives": [],
560
560
+
"kind": "VariableDefinition",
561
561
+
"type": {
562
562
+
"kind": "NamedType",
563
563
+
"name": {
564
564
+
"kind": "Name",
565
565
+
"value": "StoryLikeSubscribeInput",
566
566
+
},
567
567
+
},
568
568
+
"variable": {
569
569
+
"kind": "Variable",
570
570
+
"name": {
571
571
+
"kind": "Name",
572
572
+
"value": "input",
573
573
+
},
574
574
+
},
575
575
+
},
576
576
+
],
577
577
+
},
578
578
+
{
579
579
+
"directives": [
580
580
+
{
581
581
+
"arguments": [],
582
582
+
"kind": "Directive",
583
583
+
"name": {
584
584
+
"kind": "Name",
585
585
+
"value": "onFragmentDefinition",
586
586
+
},
587
587
+
},
588
588
+
],
589
589
+
"kind": "FragmentDefinition",
590
590
+
"name": {
591
591
+
"kind": "Name",
592
592
+
"value": "frag",
593
593
+
},
594
594
+
"selectionSet": {
595
595
+
"kind": "SelectionSet",
596
596
+
"selections": [
597
597
+
{
598
598
+
"alias": undefined,
599
599
+
"arguments": [
600
600
+
{
601
601
+
"kind": "Argument",
602
602
+
"name": {
603
603
+
"kind": "Name",
604
604
+
"value": "size",
605
605
+
},
606
606
+
"value": {
607
607
+
"kind": "Variable",
608
608
+
"name": {
609
609
+
"kind": "Name",
610
610
+
"value": "site",
611
611
+
},
612
612
+
},
613
613
+
},
614
614
+
{
615
615
+
"kind": "Argument",
616
616
+
"name": {
617
617
+
"kind": "Name",
618
618
+
"value": "bar",
619
619
+
},
620
620
+
"value": {
621
621
+
"kind": "FloatValue",
622
622
+
"value": "12",
623
623
+
},
624
624
+
},
625
625
+
{
626
626
+
"kind": "Argument",
627
627
+
"name": {
628
628
+
"kind": "Name",
629
629
+
"value": "obj",
630
630
+
},
631
631
+
"value": {
632
632
+
"fields": [
633
633
+
{
634
634
+
"kind": "ObjectField",
635
635
+
"name": {
636
636
+
"kind": "Name",
637
637
+
"value": "key",
638
638
+
},
639
639
+
"value": {
640
640
+
"block": false,
641
641
+
"kind": "StringValue",
642
642
+
"value": "value",
643
643
+
},
644
644
+
},
645
645
+
{
646
646
+
"kind": "ObjectField",
647
647
+
"name": {
648
648
+
"kind": "Name",
649
649
+
"value": "block",
650
650
+
},
651
651
+
"value": {
652
652
+
"block": true,
653
653
+
"kind": "StringValue",
654
654
+
"value": "block string uses \\\\\\"\\"\\"",
655
655
+
},
656
656
+
},
657
657
+
],
658
658
+
"kind": "ObjectValue",
659
659
+
},
660
660
+
},
661
661
+
],
662
662
+
"directives": [],
663
663
+
"kind": "Field",
664
664
+
"name": {
665
665
+
"kind": "Name",
666
666
+
"value": "foo",
667
667
+
},
668
668
+
"selectionSet": undefined,
669
669
+
},
670
670
+
],
671
671
+
},
672
672
+
"typeCondition": {
673
673
+
"kind": "NamedType",
674
674
+
"name": {
675
675
+
"kind": "Name",
676
676
+
"value": "Friend",
677
677
+
},
678
678
+
},
679
679
+
},
680
680
+
{
681
681
+
"directives": [],
682
682
+
"kind": "OperationDefinition",
683
683
+
"name": {
684
684
+
"kind": "Name",
685
685
+
"value": "teeny",
686
686
+
},
687
687
+
"operation": "query",
688
688
+
"selectionSet": {
689
689
+
"kind": "SelectionSet",
690
690
+
"selections": [
691
691
+
{
692
692
+
"alias": undefined,
693
693
+
"arguments": [
694
694
+
{
695
695
+
"kind": "Argument",
696
696
+
"name": {
697
697
+
"kind": "Name",
698
698
+
"value": "truthy",
699
699
+
},
700
700
+
"value": {
701
701
+
"kind": "BooleanValue",
702
702
+
"value": true,
703
703
+
},
704
704
+
},
705
705
+
{
706
706
+
"kind": "Argument",
707
707
+
"name": {
708
708
+
"kind": "Name",
709
709
+
"value": "falsey",
710
710
+
},
711
711
+
"value": {
712
712
+
"kind": "BooleanValue",
713
713
+
"value": false,
714
714
+
},
715
715
+
},
716
716
+
{
717
717
+
"kind": "Argument",
718
718
+
"name": {
719
719
+
"kind": "Name",
720
720
+
"value": "nullish",
721
721
+
},
722
722
+
"value": {
723
723
+
"kind": "NullValue",
724
724
+
},
725
725
+
},
726
726
+
],
727
727
+
"directives": [],
728
728
+
"kind": "Field",
729
729
+
"name": {
730
730
+
"kind": "Name",
731
731
+
"value": "unnamed",
732
732
+
},
733
733
+
"selectionSet": undefined,
734
734
+
},
735
735
+
{
736
736
+
"alias": undefined,
737
737
+
"arguments": [],
738
738
+
"directives": [],
739
739
+
"kind": "Field",
740
740
+
"name": {
741
741
+
"kind": "Name",
742
742
+
"value": "query",
743
743
+
},
744
744
+
"selectionSet": undefined,
745
745
+
},
746
746
+
],
747
747
+
},
748
748
+
"variableDefinitions": [],
749
749
+
},
750
750
+
{
751
751
+
"directives": [],
752
752
+
"kind": "OperationDefinition",
753
753
+
"name": {
754
754
+
"kind": "Name",
755
755
+
"value": "tiny",
756
756
+
},
757
757
+
"operation": "query",
758
758
+
"selectionSet": {
759
759
+
"kind": "SelectionSet",
760
760
+
"selections": [
761
761
+
{
762
762
+
"alias": undefined,
763
763
+
"arguments": [],
764
764
+
"directives": [],
765
765
+
"kind": "Field",
766
766
+
"name": {
767
767
+
"kind": "Name",
768
768
+
"value": "__typename",
769
769
+
},
770
770
+
"selectionSet": undefined,
771
771
+
},
772
772
+
],
773
773
+
},
774
774
+
"variableDefinitions": [],
775
775
+
},
776
776
+
],
777
777
+
"kind": "Document",
778
778
+
}
779
779
+
`;
+11
src/__tests__/parser.test.ts
···
1
1
+
import { describe, it, expect } from 'vitest';
2
2
+
import { readFileSync } from 'fs';
3
3
+
4
4
+
import { parse } from '../parser';
5
5
+
6
6
+
describe('parse', () => {
7
7
+
it('parses the kitchen sink query', () => {
8
8
+
const sink = readFileSync(__dirname + '/../../benchmark/kitchen_sink.graphql', { encoding: 'utf8' });
9
9
+
expect(parse(sink)).toMatchSnapshot();
10
10
+
})
11
11
+
});