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