1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
//! This is a generated file, please do not edit manually. Changes can be
//! made in codegeneration that lives in `xtask` top-level dir.

use crate::{
    ast::{support, AstChildren, AstNode},
    SyntaxKind::{self, *},
    SyntaxNode, SyntaxToken, S,
};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Name {
    pub(crate) syntax: SyntaxNode,
}
impl Name {
    pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![ident]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Document {
    pub(crate) syntax: SyntaxNode,
}
impl Document {
    pub fn definitions(&self) -> AstChildren<Definition> { support::children(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct OperationDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl OperationDefinition {
    pub fn operation_type(&self) -> Option<OperationType> { support::child(&self.syntax) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn variable_definitions(&self) -> Option<VariableDefinitions> {
        support::child(&self.syntax)
    }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn selection_set(&self) -> Option<SelectionSet> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FragmentDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl FragmentDefinition {
    pub fn fragment_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![fragment])
    }
    pub fn fragment_name(&self) -> Option<FragmentName> { support::child(&self.syntax) }
    pub fn type_condition(&self) -> Option<TypeCondition> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn selection_set(&self) -> Option<SelectionSet> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct DirectiveDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl DirectiveDefinition {
    pub fn description(&self) -> Option<Description> { support::child(&self.syntax) }
    pub fn directive_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![directive])
    }
    pub fn at_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![@]) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn arguments_definition(&self) -> Option<ArgumentsDefinition> {
        support::child(&self.syntax)
    }
    pub fn repeatable_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![repeatable])
    }
    pub fn on_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![on]) }
    pub fn directive_locations(&self) -> Option<DirectiveLocations> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SchemaDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl SchemaDefinition {
    pub fn description(&self) -> Option<Description> { support::child(&self.syntax) }
    pub fn schema_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![schema]) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['{']) }
    pub fn root_operation_type_definitions(&self) -> AstChildren<RootOperationTypeDefinition> {
        support::children(&self.syntax)
    }
    pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ScalarTypeDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl ScalarTypeDefinition {
    pub fn description(&self) -> Option<Description> { support::child(&self.syntax) }
    pub fn scalar_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![scalar]) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ObjectTypeDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl ObjectTypeDefinition {
    pub fn description(&self) -> Option<Description> { support::child(&self.syntax) }
    pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![type]) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn implements_interfaces(&self) -> Option<ImplementsInterfaces> {
        support::child(&self.syntax)
    }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn fields_definition(&self) -> Option<FieldsDefinition> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct InterfaceTypeDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl InterfaceTypeDefinition {
    pub fn description(&self) -> Option<Description> { support::child(&self.syntax) }
    pub fn interface_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![interface])
    }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn implements_interfaces(&self) -> Option<ImplementsInterfaces> {
        support::child(&self.syntax)
    }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn fields_definition(&self) -> Option<FieldsDefinition> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct UnionTypeDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl UnionTypeDefinition {
    pub fn description(&self) -> Option<Description> { support::child(&self.syntax) }
    pub fn union_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![union]) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn union_member_types(&self) -> Option<UnionMemberTypes> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct EnumTypeDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl EnumTypeDefinition {
    pub fn description(&self) -> Option<Description> { support::child(&self.syntax) }
    pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![enum]) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn enum_values_definition(&self) -> Option<EnumValuesDefinition> {
        support::child(&self.syntax)
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct InputObjectTypeDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl InputObjectTypeDefinition {
    pub fn description(&self) -> Option<Description> { support::child(&self.syntax) }
    pub fn input_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![input]) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn input_fields_definition(&self) -> Option<InputFieldsDefinition> {
        support::child(&self.syntax)
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SchemaExtension {
    pub(crate) syntax: SyntaxNode,
}
impl SchemaExtension {
    pub fn extend_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![extend]) }
    pub fn schema_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![schema]) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['{']) }
    pub fn root_operation_type_definitions(&self) -> AstChildren<RootOperationTypeDefinition> {
        support::children(&self.syntax)
    }
    pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ScalarTypeExtension {
    pub(crate) syntax: SyntaxNode,
}
impl ScalarTypeExtension {
    pub fn extend_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![extend]) }
    pub fn scalar_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![scalar]) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ObjectTypeExtension {
    pub(crate) syntax: SyntaxNode,
}
impl ObjectTypeExtension {
    pub fn extend_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![extend]) }
    pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![type]) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn implements_interfaces(&self) -> Option<ImplementsInterfaces> {
        support::child(&self.syntax)
    }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn fields_definition(&self) -> Option<FieldsDefinition> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct InterfaceTypeExtension {
    pub(crate) syntax: SyntaxNode,
}
impl InterfaceTypeExtension {
    pub fn extend_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![extend]) }
    pub fn interface_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![interface])
    }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn implements_interfaces(&self) -> Option<ImplementsInterfaces> {
        support::child(&self.syntax)
    }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn fields_definition(&self) -> Option<FieldsDefinition> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct UnionTypeExtension {
    pub(crate) syntax: SyntaxNode,
}
impl UnionTypeExtension {
    pub fn extend_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![extend]) }
    pub fn union_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![union]) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn union_member_types(&self) -> Option<UnionMemberTypes> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct EnumTypeExtension {
    pub(crate) syntax: SyntaxNode,
}
impl EnumTypeExtension {
    pub fn extend_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![extend]) }
    pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![enum]) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn enum_values_definition(&self) -> Option<EnumValuesDefinition> {
        support::child(&self.syntax)
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct InputObjectTypeExtension {
    pub(crate) syntax: SyntaxNode,
}
impl InputObjectTypeExtension {
    pub fn extend_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![extend]) }
    pub fn input_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![input]) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn input_fields_definition(&self) -> Option<InputFieldsDefinition> {
        support::child(&self.syntax)
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct OperationType {
    pub(crate) syntax: SyntaxNode,
}
impl OperationType {
    pub fn query_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![query]) }
    pub fn mutation_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![mutation])
    }
    pub fn subscription_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![subscription])
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct VariableDefinitions {
    pub(crate) syntax: SyntaxNode,
}
impl VariableDefinitions {
    pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['(']) }
    pub fn variable_definitions(&self) -> AstChildren<VariableDefinition> {
        support::children(&self.syntax)
    }
    pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Directives {
    pub(crate) syntax: SyntaxNode,
}
impl Directives {
    pub fn directives(&self) -> AstChildren<Directive> { support::children(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SelectionSet {
    pub(crate) syntax: SyntaxNode,
}
impl SelectionSet {
    pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['{']) }
    pub fn selections(&self) -> AstChildren<Selection> { support::children(&self.syntax) }
    pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Field {
    pub(crate) syntax: SyntaxNode,
}
impl Field {
    pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn arguments(&self) -> Option<Arguments> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn selection_set(&self) -> Option<SelectionSet> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FragmentSpread {
    pub(crate) syntax: SyntaxNode,
}
impl FragmentSpread {
    pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![...]) }
    pub fn fragment_name(&self) -> Option<FragmentName> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct InlineFragment {
    pub(crate) syntax: SyntaxNode,
}
impl InlineFragment {
    pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![...]) }
    pub fn type_condition(&self) -> Option<TypeCondition> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
    pub fn selection_set(&self) -> Option<SelectionSet> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Alias {
    pub(crate) syntax: SyntaxNode,
}
impl Alias {
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![:]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Arguments {
    pub(crate) syntax: SyntaxNode,
}
impl Arguments {
    pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['(']) }
    pub fn arguments(&self) -> AstChildren<Argument> { support::children(&self.syntax) }
    pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Argument {
    pub(crate) syntax: SyntaxNode,
}
impl Argument {
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![:]) }
    pub fn value(&self) -> Option<Value> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FragmentName {
    pub(crate) syntax: SyntaxNode,
}
impl FragmentName {
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TypeCondition {
    pub(crate) syntax: SyntaxNode,
}
impl TypeCondition {
    pub fn on_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![on]) }
    pub fn named_type(&self) -> Option<NamedType> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct NamedType {
    pub(crate) syntax: SyntaxNode,
}
impl NamedType {
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Variable {
    pub(crate) syntax: SyntaxNode,
}
impl Variable {
    pub fn dollar_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![$]) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct StringValue {
    pub(crate) syntax: SyntaxNode,
}
impl StringValue {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FloatValue {
    pub(crate) syntax: SyntaxNode,
}
impl FloatValue {
    pub fn float_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![float]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct IntValue {
    pub(crate) syntax: SyntaxNode,
}
impl IntValue {
    pub fn int_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![int]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct BooleanValue {
    pub(crate) syntax: SyntaxNode,
}
impl BooleanValue {
    pub fn true_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![true]) }
    pub fn false_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![false]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct NullValue {
    pub(crate) syntax: SyntaxNode,
}
impl NullValue {
    pub fn null_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![null]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct EnumValue {
    pub(crate) syntax: SyntaxNode,
}
impl EnumValue {
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ListValue {
    pub(crate) syntax: SyntaxNode,
}
impl ListValue {
    pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['[']) }
    pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![']']) }
    pub fn values(&self) -> AstChildren<Value> { support::children(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ObjectValue {
    pub(crate) syntax: SyntaxNode,
}
impl ObjectValue {
    pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['{']) }
    pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['}']) }
    pub fn object_fields(&self) -> AstChildren<ObjectField> { support::children(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ObjectField {
    pub(crate) syntax: SyntaxNode,
}
impl ObjectField {
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![:]) }
    pub fn value(&self) -> Option<Value> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct VariableDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl VariableDefinition {
    pub fn variable(&self) -> Option<Variable> { support::child(&self.syntax) }
    pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![:]) }
    pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
    pub fn default_value(&self) -> Option<DefaultValue> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct DefaultValue {
    pub(crate) syntax: SyntaxNode,
}
impl DefaultValue {
    pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![=]) }
    pub fn value(&self) -> Option<Value> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ListType {
    pub(crate) syntax: SyntaxNode,
}
impl ListType {
    pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['[']) }
    pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
    pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![']']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct NonNullType {
    pub(crate) syntax: SyntaxNode,
}
impl NonNullType {
    pub fn named_type(&self) -> Option<NamedType> { support::child(&self.syntax) }
    pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![!]) }
    pub fn list_type(&self) -> Option<ListType> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Directive {
    pub(crate) syntax: SyntaxNode,
}
impl Directive {
    pub fn at_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![@]) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn arguments(&self) -> Option<Arguments> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Description {
    pub(crate) syntax: SyntaxNode,
}
impl Description {
    pub fn string_value(&self) -> Option<StringValue> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RootOperationTypeDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl RootOperationTypeDefinition {
    pub fn operation_type(&self) -> Option<OperationType> { support::child(&self.syntax) }
    pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![:]) }
    pub fn named_type(&self) -> Option<NamedType> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ImplementsInterfaces {
    pub(crate) syntax: SyntaxNode,
}
impl ImplementsInterfaces {
    pub fn implements_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![implements])
    }
    pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![&]) }
    pub fn named_types(&self) -> AstChildren<NamedType> { support::children(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FieldsDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl FieldsDefinition {
    pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['{']) }
    pub fn field_definitions(&self) -> AstChildren<FieldDefinition> {
        support::children(&self.syntax)
    }
    pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FieldDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl FieldDefinition {
    pub fn description(&self) -> Option<Description> { support::child(&self.syntax) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn arguments_definition(&self) -> Option<ArgumentsDefinition> {
        support::child(&self.syntax)
    }
    pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![:]) }
    pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ArgumentsDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl ArgumentsDefinition {
    pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['(']) }
    pub fn input_value_definitions(&self) -> AstChildren<InputValueDefinition> {
        support::children(&self.syntax)
    }
    pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct InputValueDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl InputValueDefinition {
    pub fn description(&self) -> Option<Description> { support::child(&self.syntax) }
    pub fn name(&self) -> Option<Name> { support::child(&self.syntax) }
    pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![:]) }
    pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
    pub fn default_value(&self) -> Option<DefaultValue> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct UnionMemberTypes {
    pub(crate) syntax: SyntaxNode,
}
impl UnionMemberTypes {
    pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![=]) }
    pub fn pipe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![|]) }
    pub fn named_types(&self) -> AstChildren<NamedType> { support::children(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct EnumValuesDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl EnumValuesDefinition {
    pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['{']) }
    pub fn enum_value_definitions(&self) -> AstChildren<EnumValueDefinition> {
        support::children(&self.syntax)
    }
    pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct EnumValueDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl EnumValueDefinition {
    pub fn description(&self) -> Option<Description> { support::child(&self.syntax) }
    pub fn enum_value(&self) -> Option<EnumValue> { support::child(&self.syntax) }
    pub fn directives(&self) -> Option<Directives> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct InputFieldsDefinition {
    pub(crate) syntax: SyntaxNode,
}
impl InputFieldsDefinition {
    pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['{']) }
    pub fn input_value_definitions(&self) -> AstChildren<InputValueDefinition> {
        support::children(&self.syntax)
    }
    pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct DirectiveLocations {
    pub(crate) syntax: SyntaxNode,
}
impl DirectiveLocations {
    pub fn directive_locations(&self) -> AstChildren<DirectiveLocation> {
        support::children(&self.syntax)
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct DirectiveLocation {
    pub(crate) syntax: SyntaxNode,
}
impl DirectiveLocation {
    pub fn query_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![QUERY]) }
    pub fn mutation_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![MUTATION])
    }
    pub fn subscription_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![SUBSCRIPTION])
    }
    pub fn field_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![FIELD]) }
    pub fn fragment_definition_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![FRAGMENT_DEFINITION])
    }
    pub fn fragment_spread_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![FRAGMENT_SPREAD])
    }
    pub fn inline_fragment_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![INLINE_FRAGMENT])
    }
    pub fn variable_definition_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![VARIABLE_DEFINITION])
    }
    pub fn schema_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![SCHEMA]) }
    pub fn scalar_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![SCALAR]) }
    pub fn object_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![OBJECT]) }
    pub fn field_definition_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![FIELD_DEFINITION])
    }
    pub fn argument_definition_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![ARGUMENT_DEFINITION])
    }
    pub fn interface_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![INTERFACE])
    }
    pub fn union_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![UNION]) }
    pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, S![ENUM]) }
    pub fn enum_value_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![ENUM_VALUE])
    }
    pub fn input_object_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![INPUT_OBJECT])
    }
    pub fn input_field_definition_token(&self) -> Option<SyntaxToken> {
        support::token(&self.syntax, S![INPUT_FIELD_DEFINITION])
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Definition {
    OperationDefinition(OperationDefinition),
    FragmentDefinition(FragmentDefinition),
    DirectiveDefinition(DirectiveDefinition),
    SchemaDefinition(SchemaDefinition),
    ScalarTypeDefinition(ScalarTypeDefinition),
    ObjectTypeDefinition(ObjectTypeDefinition),
    InterfaceTypeDefinition(InterfaceTypeDefinition),
    UnionTypeDefinition(UnionTypeDefinition),
    EnumTypeDefinition(EnumTypeDefinition),
    InputObjectTypeDefinition(InputObjectTypeDefinition),
    SchemaExtension(SchemaExtension),
    ScalarTypeExtension(ScalarTypeExtension),
    ObjectTypeExtension(ObjectTypeExtension),
    InterfaceTypeExtension(InterfaceTypeExtension),
    UnionTypeExtension(UnionTypeExtension),
    EnumTypeExtension(EnumTypeExtension),
    InputObjectTypeExtension(InputObjectTypeExtension),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Selection {
    Field(Field),
    FragmentSpread(FragmentSpread),
    InlineFragment(InlineFragment),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Value {
    Variable(Variable),
    StringValue(StringValue),
    FloatValue(FloatValue),
    IntValue(IntValue),
    BooleanValue(BooleanValue),
    NullValue(NullValue),
    EnumValue(EnumValue),
    ListValue(ListValue),
    ObjectValue(ObjectValue),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Type {
    NamedType(NamedType),
    ListType(ListType),
    NonNullType(NonNullType),
}
impl AstNode for Name {
    fn can_cast(kind: SyntaxKind) -> bool { kind == NAME }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Document {
    fn can_cast(kind: SyntaxKind) -> bool { kind == DOCUMENT }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for OperationDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == OPERATION_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for FragmentDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == FRAGMENT_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for DirectiveDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == DIRECTIVE_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for SchemaDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == SCHEMA_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ScalarTypeDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == SCALAR_TYPE_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ObjectTypeDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == OBJECT_TYPE_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for InterfaceTypeDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == INTERFACE_TYPE_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for UnionTypeDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == UNION_TYPE_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for EnumTypeDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_TYPE_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for InputObjectTypeDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == INPUT_OBJECT_TYPE_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for SchemaExtension {
    fn can_cast(kind: SyntaxKind) -> bool { kind == SCHEMA_EXTENSION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ScalarTypeExtension {
    fn can_cast(kind: SyntaxKind) -> bool { kind == SCALAR_TYPE_EXTENSION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ObjectTypeExtension {
    fn can_cast(kind: SyntaxKind) -> bool { kind == OBJECT_TYPE_EXTENSION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for InterfaceTypeExtension {
    fn can_cast(kind: SyntaxKind) -> bool { kind == INTERFACE_TYPE_EXTENSION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for UnionTypeExtension {
    fn can_cast(kind: SyntaxKind) -> bool { kind == UNION_TYPE_EXTENSION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for EnumTypeExtension {
    fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_TYPE_EXTENSION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for InputObjectTypeExtension {
    fn can_cast(kind: SyntaxKind) -> bool { kind == INPUT_OBJECT_TYPE_EXTENSION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for OperationType {
    fn can_cast(kind: SyntaxKind) -> bool { kind == OPERATION_TYPE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for VariableDefinitions {
    fn can_cast(kind: SyntaxKind) -> bool { kind == VARIABLE_DEFINITIONS }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Directives {
    fn can_cast(kind: SyntaxKind) -> bool { kind == DIRECTIVES }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for SelectionSet {
    fn can_cast(kind: SyntaxKind) -> bool { kind == SELECTION_SET }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Field {
    fn can_cast(kind: SyntaxKind) -> bool { kind == FIELD }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for FragmentSpread {
    fn can_cast(kind: SyntaxKind) -> bool { kind == FRAGMENT_SPREAD }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for InlineFragment {
    fn can_cast(kind: SyntaxKind) -> bool { kind == INLINE_FRAGMENT }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Alias {
    fn can_cast(kind: SyntaxKind) -> bool { kind == ALIAS }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Arguments {
    fn can_cast(kind: SyntaxKind) -> bool { kind == ARGUMENTS }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Argument {
    fn can_cast(kind: SyntaxKind) -> bool { kind == ARGUMENT }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for FragmentName {
    fn can_cast(kind: SyntaxKind) -> bool { kind == FRAGMENT_NAME }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TypeCondition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_CONDITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for NamedType {
    fn can_cast(kind: SyntaxKind) -> bool { kind == NAMED_TYPE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Variable {
    fn can_cast(kind: SyntaxKind) -> bool { kind == VARIABLE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for StringValue {
    fn can_cast(kind: SyntaxKind) -> bool { kind == STRING_VALUE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for FloatValue {
    fn can_cast(kind: SyntaxKind) -> bool { kind == FLOAT_VALUE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for IntValue {
    fn can_cast(kind: SyntaxKind) -> bool { kind == INT_VALUE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for BooleanValue {
    fn can_cast(kind: SyntaxKind) -> bool { kind == BOOLEAN_VALUE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for NullValue {
    fn can_cast(kind: SyntaxKind) -> bool { kind == NULL_VALUE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for EnumValue {
    fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_VALUE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ListValue {
    fn can_cast(kind: SyntaxKind) -> bool { kind == LIST_VALUE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ObjectValue {
    fn can_cast(kind: SyntaxKind) -> bool { kind == OBJECT_VALUE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ObjectField {
    fn can_cast(kind: SyntaxKind) -> bool { kind == OBJECT_FIELD }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for VariableDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == VARIABLE_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for DefaultValue {
    fn can_cast(kind: SyntaxKind) -> bool { kind == DEFAULT_VALUE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ListType {
    fn can_cast(kind: SyntaxKind) -> bool { kind == LIST_TYPE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for NonNullType {
    fn can_cast(kind: SyntaxKind) -> bool { kind == NON_NULL_TYPE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Directive {
    fn can_cast(kind: SyntaxKind) -> bool { kind == DIRECTIVE }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Description {
    fn can_cast(kind: SyntaxKind) -> bool { kind == DESCRIPTION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RootOperationTypeDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == ROOT_OPERATION_TYPE_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ImplementsInterfaces {
    fn can_cast(kind: SyntaxKind) -> bool { kind == IMPLEMENTS_INTERFACES }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for FieldsDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == FIELDS_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for FieldDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == FIELD_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ArgumentsDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == ARGUMENTS_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for InputValueDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == INPUT_VALUE_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for UnionMemberTypes {
    fn can_cast(kind: SyntaxKind) -> bool { kind == UNION_MEMBER_TYPES }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for EnumValuesDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_VALUES_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for EnumValueDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_VALUE_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for InputFieldsDefinition {
    fn can_cast(kind: SyntaxKind) -> bool { kind == INPUT_FIELDS_DEFINITION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for DirectiveLocations {
    fn can_cast(kind: SyntaxKind) -> bool { kind == DIRECTIVE_LOCATIONS }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for DirectiveLocation {
    fn can_cast(kind: SyntaxKind) -> bool { kind == DIRECTIVE_LOCATION }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        if Self::can_cast(syntax.kind()) {
            Some(Self { syntax })
        } else {
            None
        }
    }
    fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl From<OperationDefinition> for Definition {
    fn from(node: OperationDefinition) -> Definition { Definition::OperationDefinition(node) }
}
impl From<FragmentDefinition> for Definition {
    fn from(node: FragmentDefinition) -> Definition { Definition::FragmentDefinition(node) }
}
impl From<DirectiveDefinition> for Definition {
    fn from(node: DirectiveDefinition) -> Definition { Definition::DirectiveDefinition(node) }
}
impl From<SchemaDefinition> for Definition {
    fn from(node: SchemaDefinition) -> Definition { Definition::SchemaDefinition(node) }
}
impl From<ScalarTypeDefinition> for Definition {
    fn from(node: ScalarTypeDefinition) -> Definition { Definition::ScalarTypeDefinition(node) }
}
impl From<ObjectTypeDefinition> for Definition {
    fn from(node: ObjectTypeDefinition) -> Definition { Definition::ObjectTypeDefinition(node) }
}
impl From<InterfaceTypeDefinition> for Definition {
    fn from(node: InterfaceTypeDefinition) -> Definition {
        Definition::InterfaceTypeDefinition(node)
    }
}
impl From<UnionTypeDefinition> for Definition {
    fn from(node: UnionTypeDefinition) -> Definition { Definition::UnionTypeDefinition(node) }
}
impl From<EnumTypeDefinition> for Definition {
    fn from(node: EnumTypeDefinition) -> Definition { Definition::EnumTypeDefinition(node) }
}
impl From<InputObjectTypeDefinition> for Definition {
    fn from(node: InputObjectTypeDefinition) -> Definition {
        Definition::InputObjectTypeDefinition(node)
    }
}
impl From<SchemaExtension> for Definition {
    fn from(node: SchemaExtension) -> Definition { Definition::SchemaExtension(node) }
}
impl From<ScalarTypeExtension> for Definition {
    fn from(node: ScalarTypeExtension) -> Definition { Definition::ScalarTypeExtension(node) }
}
impl From<ObjectTypeExtension> for Definition {
    fn from(node: ObjectTypeExtension) -> Definition { Definition::ObjectTypeExtension(node) }
}
impl From<InterfaceTypeExtension> for Definition {
    fn from(node: InterfaceTypeExtension) -> Definition { Definition::InterfaceTypeExtension(node) }
}
impl From<UnionTypeExtension> for Definition {
    fn from(node: UnionTypeExtension) -> Definition { Definition::UnionTypeExtension(node) }
}
impl From<EnumTypeExtension> for Definition {
    fn from(node: EnumTypeExtension) -> Definition { Definition::EnumTypeExtension(node) }
}
impl From<InputObjectTypeExtension> for Definition {
    fn from(node: InputObjectTypeExtension) -> Definition {
        Definition::InputObjectTypeExtension(node)
    }
}
impl AstNode for Definition {
    fn can_cast(kind: SyntaxKind) -> bool {
        matches!(
            kind,
            OPERATION_DEFINITION
                | FRAGMENT_DEFINITION
                | DIRECTIVE_DEFINITION
                | SCHEMA_DEFINITION
                | SCALAR_TYPE_DEFINITION
                | OBJECT_TYPE_DEFINITION
                | INTERFACE_TYPE_DEFINITION
                | UNION_TYPE_DEFINITION
                | ENUM_TYPE_DEFINITION
                | INPUT_OBJECT_TYPE_DEFINITION
                | SCHEMA_EXTENSION
                | SCALAR_TYPE_EXTENSION
                | OBJECT_TYPE_EXTENSION
                | INTERFACE_TYPE_EXTENSION
                | UNION_TYPE_EXTENSION
                | ENUM_TYPE_EXTENSION
                | INPUT_OBJECT_TYPE_EXTENSION
        )
    }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        let res = match syntax.kind() {
            OPERATION_DEFINITION => Definition::OperationDefinition(OperationDefinition { syntax }),
            FRAGMENT_DEFINITION => Definition::FragmentDefinition(FragmentDefinition { syntax }),
            DIRECTIVE_DEFINITION => Definition::DirectiveDefinition(DirectiveDefinition { syntax }),
            SCHEMA_DEFINITION => Definition::SchemaDefinition(SchemaDefinition { syntax }),
            SCALAR_TYPE_DEFINITION => {
                Definition::ScalarTypeDefinition(ScalarTypeDefinition { syntax })
            }
            OBJECT_TYPE_DEFINITION => {
                Definition::ObjectTypeDefinition(ObjectTypeDefinition { syntax })
            }
            INTERFACE_TYPE_DEFINITION => {
                Definition::InterfaceTypeDefinition(InterfaceTypeDefinition { syntax })
            }
            UNION_TYPE_DEFINITION => {
                Definition::UnionTypeDefinition(UnionTypeDefinition { syntax })
            }
            ENUM_TYPE_DEFINITION => Definition::EnumTypeDefinition(EnumTypeDefinition { syntax }),
            INPUT_OBJECT_TYPE_DEFINITION => {
                Definition::InputObjectTypeDefinition(InputObjectTypeDefinition { syntax })
            }
            SCHEMA_EXTENSION => Definition::SchemaExtension(SchemaExtension { syntax }),
            SCALAR_TYPE_EXTENSION => {
                Definition::ScalarTypeExtension(ScalarTypeExtension { syntax })
            }
            OBJECT_TYPE_EXTENSION => {
                Definition::ObjectTypeExtension(ObjectTypeExtension { syntax })
            }
            INTERFACE_TYPE_EXTENSION => {
                Definition::InterfaceTypeExtension(InterfaceTypeExtension { syntax })
            }
            UNION_TYPE_EXTENSION => Definition::UnionTypeExtension(UnionTypeExtension { syntax }),
            ENUM_TYPE_EXTENSION => Definition::EnumTypeExtension(EnumTypeExtension { syntax }),
            INPUT_OBJECT_TYPE_EXTENSION => {
                Definition::InputObjectTypeExtension(InputObjectTypeExtension { syntax })
            }
            _ => return None,
        };
        Some(res)
    }
    fn syntax(&self) -> &SyntaxNode {
        match self {
            Definition::OperationDefinition(it) => it.syntax(),
            Definition::FragmentDefinition(it) => it.syntax(),
            Definition::DirectiveDefinition(it) => it.syntax(),
            Definition::SchemaDefinition(it) => it.syntax(),
            Definition::ScalarTypeDefinition(it) => it.syntax(),
            Definition::ObjectTypeDefinition(it) => it.syntax(),
            Definition::InterfaceTypeDefinition(it) => it.syntax(),
            Definition::UnionTypeDefinition(it) => it.syntax(),
            Definition::EnumTypeDefinition(it) => it.syntax(),
            Definition::InputObjectTypeDefinition(it) => it.syntax(),
            Definition::SchemaExtension(it) => it.syntax(),
            Definition::ScalarTypeExtension(it) => it.syntax(),
            Definition::ObjectTypeExtension(it) => it.syntax(),
            Definition::InterfaceTypeExtension(it) => it.syntax(),
            Definition::UnionTypeExtension(it) => it.syntax(),
            Definition::EnumTypeExtension(it) => it.syntax(),
            Definition::InputObjectTypeExtension(it) => it.syntax(),
        }
    }
}
impl From<Field> for Selection {
    fn from(node: Field) -> Selection { Selection::Field(node) }
}
impl From<FragmentSpread> for Selection {
    fn from(node: FragmentSpread) -> Selection { Selection::FragmentSpread(node) }
}
impl From<InlineFragment> for Selection {
    fn from(node: InlineFragment) -> Selection { Selection::InlineFragment(node) }
}
impl AstNode for Selection {
    fn can_cast(kind: SyntaxKind) -> bool {
        matches!(kind, FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT)
    }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        let res = match syntax.kind() {
            FIELD => Selection::Field(Field { syntax }),
            FRAGMENT_SPREAD => Selection::FragmentSpread(FragmentSpread { syntax }),
            INLINE_FRAGMENT => Selection::InlineFragment(InlineFragment { syntax }),
            _ => return None,
        };
        Some(res)
    }
    fn syntax(&self) -> &SyntaxNode {
        match self {
            Selection::Field(it) => it.syntax(),
            Selection::FragmentSpread(it) => it.syntax(),
            Selection::InlineFragment(it) => it.syntax(),
        }
    }
}
impl From<Variable> for Value {
    fn from(node: Variable) -> Value { Value::Variable(node) }
}
impl From<StringValue> for Value {
    fn from(node: StringValue) -> Value { Value::StringValue(node) }
}
impl From<FloatValue> for Value {
    fn from(node: FloatValue) -> Value { Value::FloatValue(node) }
}
impl From<IntValue> for Value {
    fn from(node: IntValue) -> Value { Value::IntValue(node) }
}
impl From<BooleanValue> for Value {
    fn from(node: BooleanValue) -> Value { Value::BooleanValue(node) }
}
impl From<NullValue> for Value {
    fn from(node: NullValue) -> Value { Value::NullValue(node) }
}
impl From<EnumValue> for Value {
    fn from(node: EnumValue) -> Value { Value::EnumValue(node) }
}
impl From<ListValue> for Value {
    fn from(node: ListValue) -> Value { Value::ListValue(node) }
}
impl From<ObjectValue> for Value {
    fn from(node: ObjectValue) -> Value { Value::ObjectValue(node) }
}
impl AstNode for Value {
    fn can_cast(kind: SyntaxKind) -> bool {
        matches!(
            kind,
            VARIABLE
                | STRING_VALUE
                | FLOAT_VALUE
                | INT_VALUE
                | BOOLEAN_VALUE
                | NULL_VALUE
                | ENUM_VALUE
                | LIST_VALUE
                | OBJECT_VALUE
        )
    }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        let res = match syntax.kind() {
            VARIABLE => Value::Variable(Variable { syntax }),
            STRING_VALUE => Value::StringValue(StringValue { syntax }),
            FLOAT_VALUE => Value::FloatValue(FloatValue { syntax }),
            INT_VALUE => Value::IntValue(IntValue { syntax }),
            BOOLEAN_VALUE => Value::BooleanValue(BooleanValue { syntax }),
            NULL_VALUE => Value::NullValue(NullValue { syntax }),
            ENUM_VALUE => Value::EnumValue(EnumValue { syntax }),
            LIST_VALUE => Value::ListValue(ListValue { syntax }),
            OBJECT_VALUE => Value::ObjectValue(ObjectValue { syntax }),
            _ => return None,
        };
        Some(res)
    }
    fn syntax(&self) -> &SyntaxNode {
        match self {
            Value::Variable(it) => it.syntax(),
            Value::StringValue(it) => it.syntax(),
            Value::FloatValue(it) => it.syntax(),
            Value::IntValue(it) => it.syntax(),
            Value::BooleanValue(it) => it.syntax(),
            Value::NullValue(it) => it.syntax(),
            Value::EnumValue(it) => it.syntax(),
            Value::ListValue(it) => it.syntax(),
            Value::ObjectValue(it) => it.syntax(),
        }
    }
}
impl From<NamedType> for Type {
    fn from(node: NamedType) -> Type { Type::NamedType(node) }
}
impl From<ListType> for Type {
    fn from(node: ListType) -> Type { Type::ListType(node) }
}
impl From<NonNullType> for Type {
    fn from(node: NonNullType) -> Type { Type::NonNullType(node) }
}
impl AstNode for Type {
    fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, NAMED_TYPE | LIST_TYPE | NON_NULL_TYPE) }
    fn cast(syntax: SyntaxNode) -> Option<Self> {
        let res = match syntax.kind() {
            NAMED_TYPE => Type::NamedType(NamedType { syntax }),
            LIST_TYPE => Type::ListType(ListType { syntax }),
            NON_NULL_TYPE => Type::NonNullType(NonNullType { syntax }),
            _ => return None,
        };
        Some(res)
    }
    fn syntax(&self) -> &SyntaxNode {
        match self {
            Type::NamedType(it) => it.syntax(),
            Type::ListType(it) => it.syntax(),
            Type::NonNullType(it) => it.syntax(),
        }
    }
}