1
+ import type { Kind } from './kinds' ;
1
2
import type { Source } from './source' ;
2
3
import type { TokenKindEnum } from './tokenKind' ;
3
4
@@ -332,15 +333,15 @@ export function isNode(maybeNode: any): maybeNode is ASTNode {
332
333
/** Name */
333
334
334
335
export interface NameNode {
335
- readonly kind : 'Name' ;
336
+ readonly kind : typeof Kind . NAME ;
336
337
readonly loc ?: Location ;
337
338
readonly value : string ;
338
339
}
339
340
340
341
/** Document */
341
342
342
343
export interface DocumentNode {
343
- readonly kind : 'Document' ;
344
+ readonly kind : typeof Kind . DOCUMENT ;
344
345
readonly loc ?: Location ;
345
346
readonly definitions : ReadonlyArray < DefinitionNode > ;
346
347
}
@@ -355,7 +356,7 @@ export type ExecutableDefinitionNode =
355
356
| FragmentDefinitionNode ;
356
357
357
358
export interface OperationDefinitionNode {
358
- readonly kind : 'OperationDefinition' ;
359
+ readonly kind : typeof Kind . OPERATION_DEFINITION ;
359
360
readonly loc ?: Location ;
360
361
readonly operation : OperationTypeNode ;
361
362
readonly name ?: NameNode ;
@@ -367,7 +368,7 @@ export interface OperationDefinitionNode {
367
368
export type OperationTypeNode = 'query' | 'mutation' | 'subscription' ;
368
369
369
370
export interface VariableDefinitionNode {
370
- readonly kind : 'VariableDefinition' ;
371
+ readonly kind : typeof Kind . VARIABLE_DEFINITION ;
371
372
readonly loc ?: Location ;
372
373
readonly variable : VariableNode ;
373
374
readonly type : TypeNode ;
@@ -376,21 +377,21 @@ export interface VariableDefinitionNode {
376
377
}
377
378
378
379
export interface VariableNode {
379
- readonly kind : 'Variable' ;
380
+ readonly kind : typeof Kind . VARIABLE ;
380
381
readonly loc ?: Location ;
381
382
readonly name : NameNode ;
382
383
}
383
384
384
385
export interface SelectionSetNode {
385
- kind : 'SelectionSet' ;
386
+ kind : typeof Kind . SELECTION_SET ;
386
387
loc ?: Location ;
387
388
selections : ReadonlyArray < SelectionNode > ;
388
389
}
389
390
390
391
export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode ;
391
392
392
393
export interface FieldNode {
393
- readonly kind : 'Field' ;
394
+ readonly kind : typeof Kind . FIELD ;
394
395
readonly loc ?: Location ;
395
396
readonly alias ?: NameNode ;
396
397
readonly name : NameNode ;
@@ -400,7 +401,7 @@ export interface FieldNode {
400
401
}
401
402
402
403
export interface ArgumentNode {
403
- readonly kind : 'Argument' ;
404
+ readonly kind : typeof Kind . ARGUMENT ;
404
405
readonly loc ?: Location ;
405
406
readonly name : NameNode ;
406
407
readonly value : ValueNode ;
@@ -416,22 +417,22 @@ export interface ConstArgumentNode {
416
417
/** Fragments */
417
418
418
419
export interface FragmentSpreadNode {
419
- readonly kind : 'FragmentSpread' ;
420
+ readonly kind : typeof Kind . FRAGMENT_SPREAD ;
420
421
readonly loc ?: Location ;
421
422
readonly name : NameNode ;
422
423
readonly directives ?: ReadonlyArray < DirectiveNode > ;
423
424
}
424
425
425
426
export interface InlineFragmentNode {
426
- readonly kind : 'InlineFragment' ;
427
+ readonly kind : typeof Kind . INLINE_FRAGMENT ;
427
428
readonly loc ?: Location ;
428
429
readonly typeCondition ?: NamedTypeNode ;
429
430
readonly directives ?: ReadonlyArray < DirectiveNode > ;
430
431
readonly selectionSet : SelectionSetNode ;
431
432
}
432
433
433
434
export interface FragmentDefinitionNode {
434
- readonly kind : 'FragmentDefinition' ;
435
+ readonly kind : typeof Kind . FRAGMENT_DEFINITION ;
435
436
readonly loc ?: Location ;
436
437
readonly name : NameNode ;
437
438
/** @deprecated variableDefinitions will be removed in v17.0.0 */
@@ -465,43 +466,43 @@ export type ConstValueNode =
465
466
| ConstObjectValueNode ;
466
467
467
468
export interface IntValueNode {
468
- readonly kind : 'IntValue' ;
469
+ readonly kind : typeof Kind . INT ;
469
470
readonly loc ?: Location ;
470
471
readonly value : string ;
471
472
}
472
473
473
474
export interface FloatValueNode {
474
- readonly kind : 'FloatValue' ;
475
+ readonly kind : typeof Kind . FLOAT ;
475
476
readonly loc ?: Location ;
476
477
readonly value : string ;
477
478
}
478
479
479
480
export interface StringValueNode {
480
- readonly kind : 'StringValue' ;
481
+ readonly kind : typeof Kind . STRING ;
481
482
readonly loc ?: Location ;
482
483
readonly value : string ;
483
484
readonly block ?: boolean ;
484
485
}
485
486
486
487
export interface BooleanValueNode {
487
- readonly kind : 'BooleanValue' ;
488
+ readonly kind : typeof Kind . BOOLEAN ;
488
489
readonly loc ?: Location ;
489
490
readonly value : boolean ;
490
491
}
491
492
492
493
export interface NullValueNode {
493
- readonly kind : 'NullValue' ;
494
+ readonly kind : typeof Kind . NULL ;
494
495
readonly loc ?: Location ;
495
496
}
496
497
497
498
export interface EnumValueNode {
498
- readonly kind : 'EnumValue' ;
499
+ readonly kind : typeof Kind . ENUM ;
499
500
readonly loc ?: Location ;
500
501
readonly value : string ;
501
502
}
502
503
503
504
export interface ListValueNode {
504
- readonly kind : 'ListValue' ;
505
+ readonly kind : typeof Kind . LIST ;
505
506
readonly loc ?: Location ;
506
507
readonly values : ReadonlyArray < ValueNode > ;
507
508
}
@@ -513,7 +514,7 @@ export interface ConstListValueNode {
513
514
}
514
515
515
516
export interface ObjectValueNode {
516
- readonly kind : 'ObjectValue' ;
517
+ readonly kind : typeof Kind . OBJECT ;
517
518
readonly loc ?: Location ;
518
519
readonly fields : ReadonlyArray < ObjectFieldNode > ;
519
520
}
@@ -525,7 +526,7 @@ export interface ConstObjectValueNode {
525
526
}
526
527
527
528
export interface ObjectFieldNode {
528
- readonly kind : 'ObjectField' ;
529
+ readonly kind : typeof Kind . OBJECT_FIELD ;
529
530
readonly loc ?: Location ;
530
531
readonly name : NameNode ;
531
532
readonly value : ValueNode ;
@@ -541,7 +542,7 @@ export interface ConstObjectFieldNode {
541
542
/** Directives */
542
543
543
544
export interface DirectiveNode {
544
- readonly kind : 'Directive' ;
545
+ readonly kind : typeof Kind . DIRECTIVE ;
545
546
readonly loc ?: Location ;
546
547
readonly name : NameNode ;
547
548
readonly arguments ?: ReadonlyArray < ArgumentNode > ;
@@ -559,19 +560,19 @@ export interface ConstDirectiveNode {
559
560
export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode ;
560
561
561
562
export interface NamedTypeNode {
562
- readonly kind : 'NamedType' ;
563
+ readonly kind : typeof Kind . NAMED_TYPE ;
563
564
readonly loc ?: Location ;
564
565
readonly name : NameNode ;
565
566
}
566
567
567
568
export interface ListTypeNode {
568
- readonly kind : 'ListType' ;
569
+ readonly kind : typeof Kind . LIST_TYPE ;
569
570
readonly loc ?: Location ;
570
571
readonly type : TypeNode ;
571
572
}
572
573
573
574
export interface NonNullTypeNode {
574
- readonly kind : 'NonNullType' ;
575
+ readonly kind : typeof Kind . NON_NULL_TYPE ;
575
576
readonly loc ?: Location ;
576
577
readonly type : NamedTypeNode | ListTypeNode ;
577
578
}
@@ -584,15 +585,15 @@ export type TypeSystemDefinitionNode =
584
585
| DirectiveDefinitionNode ;
585
586
586
587
export interface SchemaDefinitionNode {
587
- readonly kind : 'SchemaDefinition' ;
588
+ readonly kind : typeof Kind . SCHEMA_DEFINITION ;
588
589
readonly loc ?: Location ;
589
590
readonly description ?: StringValueNode ;
590
591
readonly directives ?: ReadonlyArray < ConstDirectiveNode > ;
591
592
readonly operationTypes : ReadonlyArray < OperationTypeDefinitionNode > ;
592
593
}
593
594
594
595
export interface OperationTypeDefinitionNode {
595
- readonly kind : 'OperationTypeDefinition' ;
596
+ readonly kind : typeof Kind . OPERATION_TYPE_DEFINITION ;
596
597
readonly loc ?: Location ;
597
598
readonly operation : OperationTypeNode ;
598
599
readonly type : NamedTypeNode ;
@@ -609,15 +610,15 @@ export type TypeDefinitionNode =
609
610
| InputObjectTypeDefinitionNode ;
610
611
611
612
export interface ScalarTypeDefinitionNode {
612
- readonly kind : 'ScalarTypeDefinition' ;
613
+ readonly kind : typeof Kind . SCALAR_TYPE_DEFINITION ;
613
614
readonly loc ?: Location ;
614
615
readonly description ?: StringValueNode ;
615
616
readonly name : NameNode ;
616
617
readonly directives ?: ReadonlyArray < ConstDirectiveNode > ;
617
618
}
618
619
619
620
export interface ObjectTypeDefinitionNode {
620
- readonly kind : 'ObjectTypeDefinition' ;
621
+ readonly kind : typeof Kind . OBJECT_TYPE_DEFINITION ;
621
622
readonly loc ?: Location ;
622
623
readonly description ?: StringValueNode ;
623
624
readonly name : NameNode ;
@@ -627,7 +628,7 @@ export interface ObjectTypeDefinitionNode {
627
628
}
628
629
629
630
export interface FieldDefinitionNode {
630
- readonly kind : 'FieldDefinition' ;
631
+ readonly kind : typeof Kind . FIELD_DEFINITION ;
631
632
readonly loc ?: Location ;
632
633
readonly description ?: StringValueNode ;
633
634
readonly name : NameNode ;
@@ -637,7 +638,7 @@ export interface FieldDefinitionNode {
637
638
}
638
639
639
640
export interface InputValueDefinitionNode {
640
- readonly kind : 'InputValueDefinition' ;
641
+ readonly kind : typeof Kind . INPUT_VALUE_DEFINITION ;
641
642
readonly loc ?: Location ;
642
643
readonly description ?: StringValueNode ;
643
644
readonly name : NameNode ;
@@ -647,7 +648,7 @@ export interface InputValueDefinitionNode {
647
648
}
648
649
649
650
export interface InterfaceTypeDefinitionNode {
650
- readonly kind : 'InterfaceTypeDefinition' ;
651
+ readonly kind : typeof Kind . INTERFACE_TYPE_DEFINITION ;
651
652
readonly loc ?: Location ;
652
653
readonly description ?: StringValueNode ;
653
654
readonly name : NameNode ;
@@ -657,7 +658,7 @@ export interface InterfaceTypeDefinitionNode {
657
658
}
658
659
659
660
export interface UnionTypeDefinitionNode {
660
- readonly kind : 'UnionTypeDefinition' ;
661
+ readonly kind : typeof Kind . UNION_TYPE_DEFINITION ;
661
662
readonly loc ?: Location ;
662
663
readonly description ?: StringValueNode ;
663
664
readonly name : NameNode ;
@@ -666,7 +667,7 @@ export interface UnionTypeDefinitionNode {
666
667
}
667
668
668
669
export interface EnumTypeDefinitionNode {
669
- readonly kind : 'EnumTypeDefinition' ;
670
+ readonly kind : typeof Kind . ENUM_TYPE_DEFINITION ;
670
671
readonly loc ?: Location ;
671
672
readonly description ?: StringValueNode ;
672
673
readonly name : NameNode ;
@@ -675,15 +676,15 @@ export interface EnumTypeDefinitionNode {
675
676
}
676
677
677
678
export interface EnumValueDefinitionNode {
678
- readonly kind : 'EnumValueDefinition' ;
679
+ readonly kind : typeof Kind . ENUM_VALUE_DEFINITION ;
679
680
readonly loc ?: Location ;
680
681
readonly description ?: StringValueNode ;
681
682
readonly name : NameNode ;
682
683
readonly directives ?: ReadonlyArray < ConstDirectiveNode > ;
683
684
}
684
685
685
686
export interface InputObjectTypeDefinitionNode {
686
- readonly kind : 'InputObjectTypeDefinition' ;
687
+ readonly kind : typeof Kind . INPUT_OBJECT_TYPE_DEFINITION ;
687
688
readonly loc ?: Location ;
688
689
readonly description ?: StringValueNode ;
689
690
readonly name : NameNode ;
@@ -694,7 +695,7 @@ export interface InputObjectTypeDefinitionNode {
694
695
/** Directive Definitions */
695
696
696
697
export interface DirectiveDefinitionNode {
697
- readonly kind : 'DirectiveDefinition' ;
698
+ readonly kind : typeof Kind . DIRECTIVE_DEFINITION ;
698
699
readonly loc ?: Location ;
699
700
readonly description ?: StringValueNode ;
700
701
readonly name : NameNode ;
@@ -708,7 +709,7 @@ export interface DirectiveDefinitionNode {
708
709
export type TypeSystemExtensionNode = SchemaExtensionNode | TypeExtensionNode ;
709
710
710
711
export interface SchemaExtensionNode {
711
- readonly kind : 'SchemaExtension' ;
712
+ readonly kind : typeof Kind . SCHEMA_EXTENSION ;
712
713
readonly loc ?: Location ;
713
714
readonly directives ?: ReadonlyArray < ConstDirectiveNode > ;
714
715
readonly operationTypes ?: ReadonlyArray < OperationTypeDefinitionNode > ;
@@ -725,14 +726,14 @@ export type TypeExtensionNode =
725
726
| InputObjectTypeExtensionNode ;
726
727
727
728
export interface ScalarTypeExtensionNode {
728
- readonly kind : 'ScalarTypeExtension' ;
729
+ readonly kind : typeof Kind . SCALAR_TYPE_EXTENSION ;
729
730
readonly loc ?: Location ;
730
731
readonly name : NameNode ;
731
732
readonly directives ?: ReadonlyArray < ConstDirectiveNode > ;
732
733
}
733
734
734
735
export interface ObjectTypeExtensionNode {
735
- readonly kind : 'ObjectTypeExtension' ;
736
+ readonly kind : typeof Kind . OBJECT_TYPE_EXTENSION ;
736
737
readonly loc ?: Location ;
737
738
readonly name : NameNode ;
738
739
readonly interfaces ?: ReadonlyArray < NamedTypeNode > ;
@@ -741,7 +742,7 @@ export interface ObjectTypeExtensionNode {
741
742
}
742
743
743
744
export interface InterfaceTypeExtensionNode {
744
- readonly kind : 'InterfaceTypeExtension' ;
745
+ readonly kind : typeof Kind . INTERFACE_TYPE_EXTENSION ;
745
746
readonly loc ?: Location ;
746
747
readonly name : NameNode ;
747
748
readonly interfaces ?: ReadonlyArray < NamedTypeNode > ;
@@ -750,23 +751,23 @@ export interface InterfaceTypeExtensionNode {
750
751
}
751
752
752
753
export interface UnionTypeExtensionNode {
753
- readonly kind : 'UnionTypeExtension' ;
754
+ readonly kind : typeof Kind . UNION_TYPE_EXTENSION ;
754
755
readonly loc ?: Location ;
755
756
readonly name : NameNode ;
756
757
readonly directives ?: ReadonlyArray < ConstDirectiveNode > ;
757
758
readonly types ?: ReadonlyArray < NamedTypeNode > ;
758
759
}
759
760
760
761
export interface EnumTypeExtensionNode {
761
- readonly kind : 'EnumTypeExtension' ;
762
+ readonly kind : typeof Kind . ENUM_TYPE_EXTENSION ;
762
763
readonly loc ?: Location ;
763
764
readonly name : NameNode ;
764
765
readonly directives ?: ReadonlyArray < ConstDirectiveNode > ;
765
766
readonly values ?: ReadonlyArray < EnumValueDefinitionNode > ;
766
767
}
767
768
768
769
export interface InputObjectTypeExtensionNode {
769
- readonly kind : 'InputObjectTypeExtension' ;
770
+ readonly kind : typeof Kind . INPUT_OBJECT_TYPE_EXTENSION ;
770
771
readonly loc ?: Location ;
771
772
readonly name : NameNode ;
772
773
readonly directives ?: ReadonlyArray < ConstDirectiveNode > ;
0 commit comments