@0no-co/graphql.web 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/graphql.web.d.ts +198 -129
  2. package/package.json +3 -3
@@ -24,12 +24,77 @@ type Location =
24
24
  source: Source;
25
25
  };
26
26
 
27
- type GraphQLKind<
28
- Key extends string,
29
- Fallback extends string,
30
- > = Key extends keyof typeof GraphQL.Kind ? (typeof GraphQL.Kind)[Key] : Fallback;
27
+ // When `graphql` isn't installed, `typeof GraphQL.Kind` resolves to `any`. That would make
28
+ // `keyof typeof GraphQL.Kind` match every `Key` and collapse `GraphQLKind` and the `Kind` value
29
+ // itself to `any`, breaking discriminated unions on AST `kind` fields. `IsGraphQLAny` detects that
30
+ // case so we fall back to the literal string kinds instead.
31
+ type IsGraphQLAny = 0 extends 1 & typeof GraphQL.Kind ? true : false;
31
32
 
32
- declare const Kind: typeof GraphQL.Kind & {
33
+ type GraphQLKind<Key extends string, Fallback extends string> = IsGraphQLAny extends true
34
+ ? Fallback
35
+ : Key extends keyof typeof GraphQL.Kind
36
+ ? (typeof GraphQL.Kind)[Key]
37
+ : Fallback;
38
+
39
+ declare const Kind: (IsGraphQLAny extends true ? {} : typeof GraphQL.Kind) & {
40
+ readonly NAME: GraphQLKind<'NAME', 'Name'>;
41
+ readonly DOCUMENT: GraphQLKind<'DOCUMENT', 'Document'>;
42
+ readonly OPERATION_DEFINITION: GraphQLKind<'OPERATION_DEFINITION', 'OperationDefinition'>;
43
+ readonly VARIABLE_DEFINITION: GraphQLKind<'VARIABLE_DEFINITION', 'VariableDefinition'>;
44
+ readonly SELECTION_SET: GraphQLKind<'SELECTION_SET', 'SelectionSet'>;
45
+ readonly FIELD: GraphQLKind<'FIELD', 'Field'>;
46
+ readonly ARGUMENT: GraphQLKind<'ARGUMENT', 'Argument'>;
47
+ readonly FRAGMENT_SPREAD: GraphQLKind<'FRAGMENT_SPREAD', 'FragmentSpread'>;
48
+ readonly INLINE_FRAGMENT: GraphQLKind<'INLINE_FRAGMENT', 'InlineFragment'>;
49
+ readonly FRAGMENT_DEFINITION: GraphQLKind<'FRAGMENT_DEFINITION', 'FragmentDefinition'>;
50
+ readonly VARIABLE: GraphQLKind<'VARIABLE', 'Variable'>;
51
+ readonly INT: GraphQLKind<'INT', 'IntValue'>;
52
+ readonly FLOAT: GraphQLKind<'FLOAT', 'FloatValue'>;
53
+ readonly STRING: GraphQLKind<'STRING', 'StringValue'>;
54
+ readonly BOOLEAN: GraphQLKind<'BOOLEAN', 'BooleanValue'>;
55
+ readonly NULL: GraphQLKind<'NULL', 'NullValue'>;
56
+ readonly ENUM: GraphQLKind<'ENUM', 'EnumValue'>;
57
+ readonly LIST: GraphQLKind<'LIST', 'ListValue'>;
58
+ readonly OBJECT: GraphQLKind<'OBJECT', 'ObjectValue'>;
59
+ readonly OBJECT_FIELD: GraphQLKind<'OBJECT_FIELD', 'ObjectField'>;
60
+ readonly DIRECTIVE: GraphQLKind<'DIRECTIVE', 'Directive'>;
61
+ readonly NAMED_TYPE: GraphQLKind<'NAMED_TYPE', 'NamedType'>;
62
+ readonly LIST_TYPE: GraphQLKind<'LIST_TYPE', 'ListType'>;
63
+ readonly NON_NULL_TYPE: GraphQLKind<'NON_NULL_TYPE', 'NonNullType'>;
64
+ readonly SCHEMA_DEFINITION: GraphQLKind<'SCHEMA_DEFINITION', 'SchemaDefinition'>;
65
+ readonly OPERATION_TYPE_DEFINITION: GraphQLKind<
66
+ 'OPERATION_TYPE_DEFINITION',
67
+ 'OperationTypeDefinition'
68
+ >;
69
+ readonly SCALAR_TYPE_DEFINITION: GraphQLKind<'SCALAR_TYPE_DEFINITION', 'ScalarTypeDefinition'>;
70
+ readonly OBJECT_TYPE_DEFINITION: GraphQLKind<'OBJECT_TYPE_DEFINITION', 'ObjectTypeDefinition'>;
71
+ readonly FIELD_DEFINITION: GraphQLKind<'FIELD_DEFINITION', 'FieldDefinition'>;
72
+ readonly INPUT_VALUE_DEFINITION: GraphQLKind<'INPUT_VALUE_DEFINITION', 'InputValueDefinition'>;
73
+ readonly INTERFACE_TYPE_DEFINITION: GraphQLKind<
74
+ 'INTERFACE_TYPE_DEFINITION',
75
+ 'InterfaceTypeDefinition'
76
+ >;
77
+ readonly UNION_TYPE_DEFINITION: GraphQLKind<'UNION_TYPE_DEFINITION', 'UnionTypeDefinition'>;
78
+ readonly ENUM_TYPE_DEFINITION: GraphQLKind<'ENUM_TYPE_DEFINITION', 'EnumTypeDefinition'>;
79
+ readonly ENUM_VALUE_DEFINITION: GraphQLKind<'ENUM_VALUE_DEFINITION', 'EnumValueDefinition'>;
80
+ readonly INPUT_OBJECT_TYPE_DEFINITION: GraphQLKind<
81
+ 'INPUT_OBJECT_TYPE_DEFINITION',
82
+ 'InputObjectTypeDefinition'
83
+ >;
84
+ readonly DIRECTIVE_DEFINITION: GraphQLKind<'DIRECTIVE_DEFINITION', 'DirectiveDefinition'>;
85
+ readonly SCHEMA_EXTENSION: GraphQLKind<'SCHEMA_EXTENSION', 'SchemaExtension'>;
86
+ readonly SCALAR_TYPE_EXTENSION: GraphQLKind<'SCALAR_TYPE_EXTENSION', 'ScalarTypeExtension'>;
87
+ readonly OBJECT_TYPE_EXTENSION: GraphQLKind<'OBJECT_TYPE_EXTENSION', 'ObjectTypeExtension'>;
88
+ readonly INTERFACE_TYPE_EXTENSION: GraphQLKind<
89
+ 'INTERFACE_TYPE_EXTENSION',
90
+ 'InterfaceTypeExtension'
91
+ >;
92
+ readonly UNION_TYPE_EXTENSION: GraphQLKind<'UNION_TYPE_EXTENSION', 'UnionTypeExtension'>;
93
+ readonly ENUM_TYPE_EXTENSION: GraphQLKind<'ENUM_TYPE_EXTENSION', 'EnumTypeExtension'>;
94
+ readonly INPUT_OBJECT_TYPE_EXTENSION: GraphQLKind<
95
+ 'INPUT_OBJECT_TYPE_EXTENSION',
96
+ 'InputObjectTypeExtension'
97
+ >;
33
98
  /** Coordinates */
34
99
  readonly TYPE_COORDINATE: GraphQLKind<'TYPE_COORDINATE', 'TypeCoordinate'>;
35
100
  readonly MEMBER_COORDINATE: GraphQLKind<'MEMBER_COORDINATE', 'MemberCoordinate'>;
@@ -147,7 +212,7 @@ declare type TypeSystemDefinitionNode = Or<
147
212
  type SchemaDefinitionNode = Or<
148
213
  GraphQL.SchemaDefinitionNode,
149
214
  {
150
- readonly kind;
215
+ readonly kind: Kind.SCHEMA_DEFINITION;
151
216
  readonly loc?: Location;
152
217
  readonly description?: StringValueNode;
153
218
  readonly directives?: ReadonlyArray<ConstDirectiveNode>;
@@ -157,7 +222,7 @@ type SchemaDefinitionNode = Or<
157
222
  type OperationTypeDefinitionNode = Or<
158
223
  GraphQL.OperationTypeDefinitionNode,
159
224
  {
160
- readonly kind;
225
+ readonly kind: Kind.OPERATION_TYPE_DEFINITION;
161
226
  readonly loc?: Location;
162
227
  readonly operation: OperationTypeNode;
163
228
  readonly type: NamedTypeNode;
@@ -176,7 +241,7 @@ declare type TypeDefinitionNode = Or<
176
241
  type ScalarTypeDefinitionNode = Or<
177
242
  GraphQL.ScalarTypeDefinitionNode,
178
243
  {
179
- readonly kind;
244
+ readonly kind: Kind.SCALAR_TYPE_DEFINITION;
180
245
  readonly loc?: Location;
181
246
  readonly description?: StringValueNode;
182
247
  readonly name: NameNode;
@@ -186,7 +251,7 @@ type ScalarTypeDefinitionNode = Or<
186
251
  type ObjectTypeDefinitionNode = Or<
187
252
  GraphQL.ObjectTypeDefinitionNode,
188
253
  {
189
- readonly kind;
254
+ readonly kind: Kind.OBJECT_TYPE_DEFINITION;
190
255
  readonly loc?: Location;
191
256
  readonly description?: StringValueNode;
192
257
  readonly name: NameNode;
@@ -198,7 +263,7 @@ type ObjectTypeDefinitionNode = Or<
198
263
  type FieldDefinitionNode = Or<
199
264
  GraphQL.FieldDefinitionNode,
200
265
  {
201
- readonly kind;
266
+ readonly kind: Kind.FIELD_DEFINITION;
202
267
  readonly loc?: Location;
203
268
  readonly description?: StringValueNode;
204
269
  readonly name: NameNode;
@@ -210,7 +275,7 @@ type FieldDefinitionNode = Or<
210
275
  type InputValueDefinitionNode = Or<
211
276
  GraphQL.InputValueDefinitionNode,
212
277
  {
213
- readonly kind;
278
+ readonly kind: Kind.INPUT_VALUE_DEFINITION;
214
279
  readonly loc?: Location;
215
280
  readonly description?: StringValueNode;
216
281
  readonly name: NameNode;
@@ -222,7 +287,7 @@ type InputValueDefinitionNode = Or<
222
287
  type InterfaceTypeDefinitionNode = Or<
223
288
  GraphQL.InterfaceTypeDefinitionNode,
224
289
  {
225
- readonly kind;
290
+ readonly kind: Kind.INTERFACE_TYPE_DEFINITION;
226
291
  readonly loc?: Location;
227
292
  readonly description?: StringValueNode;
228
293
  readonly name: NameNode;
@@ -234,7 +299,7 @@ type InterfaceTypeDefinitionNode = Or<
234
299
  type UnionTypeDefinitionNode = Or<
235
300
  GraphQL.UnionTypeDefinitionNode,
236
301
  {
237
- readonly kind;
302
+ readonly kind: Kind.UNION_TYPE_DEFINITION;
238
303
  readonly loc?: Location;
239
304
  readonly description?: StringValueNode;
240
305
  readonly name: NameNode;
@@ -245,7 +310,7 @@ type UnionTypeDefinitionNode = Or<
245
310
  type EnumTypeDefinitionNode = Or<
246
311
  GraphQL.EnumTypeDefinitionNode,
247
312
  {
248
- readonly kind;
313
+ readonly kind: Kind.ENUM_TYPE_DEFINITION;
249
314
  readonly loc?: Location;
250
315
  readonly description?: StringValueNode;
251
316
  readonly name: NameNode;
@@ -256,7 +321,7 @@ type EnumTypeDefinitionNode = Or<
256
321
  type EnumValueDefinitionNode = Or<
257
322
  GraphQL.EnumValueDefinitionNode,
258
323
  {
259
- readonly kind;
324
+ readonly kind: Kind.ENUM_VALUE_DEFINITION;
260
325
  readonly loc?: Location;
261
326
  readonly description?: StringValueNode;
262
327
  readonly name: NameNode;
@@ -266,7 +331,7 @@ type EnumValueDefinitionNode = Or<
266
331
  type InputObjectTypeDefinitionNode = Or<
267
332
  GraphQL.InputObjectTypeDefinitionNode,
268
333
  {
269
- readonly kind;
334
+ readonly kind: Kind.INPUT_OBJECT_TYPE_DEFINITION;
270
335
  readonly loc?: Location;
271
336
  readonly description?: StringValueNode;
272
337
  readonly name: NameNode;
@@ -277,7 +342,7 @@ type InputObjectTypeDefinitionNode = Or<
277
342
  type DirectiveDefinitionNode = Or<
278
343
  GraphQL.DirectiveDefinitionNode,
279
344
  {
280
- readonly kind;
345
+ readonly kind: Kind.DIRECTIVE_DEFINITION;
281
346
  readonly loc?: Location;
282
347
  readonly description?: StringValueNode;
283
348
  readonly name: NameNode;
@@ -293,7 +358,7 @@ type TypeSystemExtensionNode = Or<
293
358
  type SchemaExtensionNode = Or<
294
359
  GraphQL.SchemaExtensionNode,
295
360
  {
296
- readonly kind;
361
+ readonly kind: Kind.SCHEMA_EXTENSION;
297
362
  readonly loc?: Location;
298
363
  readonly directives?: ReadonlyArray<ConstDirectiveNode>;
299
364
  readonly operationTypes?: ReadonlyArray<OperationTypeDefinitionNode>;
@@ -311,7 +376,7 @@ declare type TypeExtensionNode = Or<
311
376
  type ScalarTypeExtensionNode = Or<
312
377
  GraphQL.ScalarTypeExtensionNode,
313
378
  {
314
- readonly kind;
379
+ readonly kind: Kind.SCALAR_TYPE_EXTENSION;
315
380
  readonly loc?: Location;
316
381
  readonly name: NameNode;
317
382
  readonly directives?: ReadonlyArray<ConstDirectiveNode>;
@@ -320,7 +385,7 @@ type ScalarTypeExtensionNode = Or<
320
385
  type ObjectTypeExtensionNode = Or<
321
386
  GraphQL.ObjectTypeExtensionNode,
322
387
  {
323
- readonly kind;
388
+ readonly kind: Kind.OBJECT_TYPE_EXTENSION;
324
389
  readonly loc?: Location;
325
390
  readonly name: NameNode;
326
391
  readonly interfaces?: ReadonlyArray<NamedTypeNode>;
@@ -331,7 +396,7 @@ type ObjectTypeExtensionNode = Or<
331
396
  type InterfaceTypeExtensionNode = Or<
332
397
  GraphQL.InterfaceTypeExtensionNode,
333
398
  {
334
- readonly kind;
399
+ readonly kind: Kind.INTERFACE_TYPE_EXTENSION;
335
400
  readonly loc?: Location;
336
401
  readonly name: NameNode;
337
402
  readonly interfaces?: ReadonlyArray<NamedTypeNode>;
@@ -342,7 +407,7 @@ type InterfaceTypeExtensionNode = Or<
342
407
  type UnionTypeExtensionNode = Or<
343
408
  GraphQL.UnionTypeExtensionNode,
344
409
  {
345
- readonly kind;
410
+ readonly kind: Kind.UNION_TYPE_EXTENSION;
346
411
  readonly loc?: Location;
347
412
  readonly name: NameNode;
348
413
  readonly directives?: ReadonlyArray<ConstDirectiveNode>;
@@ -352,7 +417,7 @@ type UnionTypeExtensionNode = Or<
352
417
  type EnumTypeExtensionNode = Or<
353
418
  GraphQL.EnumTypeExtensionNode,
354
419
  {
355
- readonly kind;
420
+ readonly kind: Kind.ENUM_TYPE_EXTENSION;
356
421
  readonly loc?: Location;
357
422
  readonly name: NameNode;
358
423
  readonly directives?: ReadonlyArray<ConstDirectiveNode>;
@@ -362,7 +427,7 @@ type EnumTypeExtensionNode = Or<
362
427
  type InputObjectTypeExtensionNode = Or<
363
428
  GraphQL.InputObjectTypeExtensionNode,
364
429
  {
365
- readonly kind;
430
+ readonly kind: Kind.INPUT_OBJECT_TYPE_EXTENSION;
366
431
  readonly loc?: Location;
367
432
  readonly name: NameNode;
368
433
  readonly directives?: ReadonlyArray<ConstDirectiveNode>;
@@ -377,30 +442,30 @@ declare type SchemaCoordinateNode =
377
442
  | DirectiveCoordinateNode
378
443
  | DirectiveArgumentCoordinateNode;
379
444
  interface TypeCoordinateNode {
380
- readonly kind;
445
+ readonly kind: Kind.TYPE_COORDINATE;
381
446
  readonly loc?: Location;
382
447
  readonly name: NameNode;
383
448
  }
384
449
  interface MemberCoordinateNode {
385
- readonly kind;
450
+ readonly kind: Kind.MEMBER_COORDINATE;
386
451
  readonly loc?: Location;
387
452
  readonly name: NameNode;
388
453
  readonly memberName: NameNode;
389
454
  }
390
455
  interface ArgumentCoordinateNode {
391
- readonly kind;
456
+ readonly kind: Kind.ARGUMENT_COORDINATE;
392
457
  readonly loc?: Location;
393
458
  readonly name: NameNode;
394
459
  readonly fieldName: NameNode;
395
460
  readonly argumentName: NameNode;
396
461
  }
397
462
  interface DirectiveCoordinateNode {
398
- readonly kind;
463
+ readonly kind: Kind.DIRECTIVE_COORDINATE;
399
464
  readonly loc?: Location;
400
465
  readonly name: NameNode;
401
466
  }
402
467
  interface DirectiveArgumentCoordinateNode {
403
- readonly kind;
468
+ readonly kind: Kind.DIRECTIVE_ARGUMENT_COORDINATE;
404
469
  readonly loc?: Location;
405
470
  readonly name: NameNode;
406
471
  readonly argumentName: NameNode;
@@ -461,7 +526,7 @@ type ASTNode = Or<
461
526
  type NameNode = Or<
462
527
  GraphQL.NameNode,
463
528
  {
464
- readonly kind;
529
+ readonly kind: Kind.NAME;
465
530
  readonly value: string;
466
531
  readonly loc?: Location;
467
532
  }
@@ -471,7 +536,7 @@ type DocumentNode = Or<
471
536
  readonly tokenCount?: number;
472
537
  },
473
538
  {
474
- readonly kind;
539
+ readonly kind: Kind.DOCUMENT;
475
540
  readonly definitions: ReadonlyArray<DefinitionNode>;
476
541
  readonly loc?: Location;
477
542
  readonly tokenCount?: number;
@@ -490,7 +555,7 @@ type OperationDefinitionNode = Or<
490
555
  readonly description?: StringValueNode;
491
556
  },
492
557
  {
493
- readonly kind;
558
+ readonly kind: Kind.OPERATION_DEFINITION;
494
559
  readonly operation: OperationTypeNode;
495
560
  readonly name?: NameNode;
496
561
  readonly description?: StringValueNode;
@@ -505,7 +570,7 @@ type VariableDefinitionNode = Or<
505
570
  description?: StringValueNode;
506
571
  },
507
572
  {
508
- readonly kind;
573
+ readonly kind: Kind.VARIABLE_DEFINITION;
509
574
  readonly variable: VariableNode;
510
575
  readonly type: TypeNode;
511
576
  readonly defaultValue?: ConstValueNode;
@@ -517,7 +582,7 @@ type VariableDefinitionNode = Or<
517
582
  type VariableNode = Or<
518
583
  GraphQL.VariableNode,
519
584
  {
520
- readonly kind;
585
+ readonly kind: Kind.VARIABLE;
521
586
  readonly name: NameNode;
522
587
  readonly loc?: Location;
523
588
  }
@@ -525,7 +590,7 @@ type VariableNode = Or<
525
590
  type SelectionSetNode = Or<
526
591
  GraphQL.SelectionSetNode,
527
592
  {
528
- readonly kind;
593
+ readonly kind: Kind.SELECTION_SET;
529
594
  readonly selections: ReadonlyArray<SelectionNode>;
530
595
  readonly loc?: Location;
531
596
  }
@@ -537,7 +602,7 @@ declare type SelectionNode = Or<
537
602
  type FieldNode = Or<
538
603
  GraphQL.FieldNode,
539
604
  {
540
- readonly kind;
605
+ readonly kind: Kind.FIELD;
541
606
  readonly alias?: NameNode;
542
607
  readonly name: NameNode;
543
608
  readonly arguments?: ReadonlyArray<ArgumentNode>;
@@ -549,7 +614,7 @@ type FieldNode = Or<
549
614
  type ArgumentNode = Or<
550
615
  GraphQL.ArgumentNode,
551
616
  {
552
- readonly kind;
617
+ readonly kind: Kind.ARGUMENT;
553
618
  readonly name: NameNode;
554
619
  readonly value: ValueNode;
555
620
  readonly loc?: Location;
@@ -558,7 +623,7 @@ type ArgumentNode = Or<
558
623
  type ConstArgumentNode = Or<
559
624
  GraphQL.ConstArgumentNode,
560
625
  {
561
- readonly kind;
626
+ readonly kind: Kind.ARGUMENT;
562
627
  readonly name: NameNode;
563
628
  readonly value: ConstValueNode;
564
629
  readonly loc?: Location;
@@ -567,7 +632,7 @@ type ConstArgumentNode = Or<
567
632
  type FragmentSpreadNode = Or<
568
633
  GraphQL.FragmentSpreadNode,
569
634
  {
570
- readonly kind;
635
+ readonly kind: Kind.FRAGMENT_SPREAD;
571
636
  readonly name: NameNode;
572
637
  readonly directives?: ReadonlyArray<DirectiveNode>;
573
638
  readonly loc?: Location;
@@ -576,7 +641,7 @@ type FragmentSpreadNode = Or<
576
641
  type InlineFragmentNode = Or<
577
642
  GraphQL.InlineFragmentNode,
578
643
  {
579
- readonly kind;
644
+ readonly kind: Kind.INLINE_FRAGMENT;
580
645
  readonly typeCondition?: NamedTypeNode;
581
646
  readonly directives?: ReadonlyArray<DirectiveNode>;
582
647
  readonly selectionSet: SelectionSetNode;
@@ -588,7 +653,7 @@ type FragmentDefinitionNode = Or<
588
653
  description?: StringValueNode;
589
654
  },
590
655
  {
591
- readonly kind;
656
+ readonly kind: Kind.FRAGMENT_DEFINITION;
592
657
  readonly name: NameNode;
593
658
  readonly description?: StringValueNode;
594
659
  readonly typeCondition: NamedTypeNode;
@@ -623,7 +688,7 @@ type ConstValueNode = Or<
623
688
  type IntValueNode = Or<
624
689
  GraphQL.IntValueNode,
625
690
  {
626
- readonly kind;
691
+ readonly kind: Kind.INT;
627
692
  readonly value: string;
628
693
  readonly loc?: Location;
629
694
  }
@@ -631,7 +696,7 @@ type IntValueNode = Or<
631
696
  type FloatValueNode = Or<
632
697
  GraphQL.FloatValueNode,
633
698
  {
634
- readonly kind;
699
+ readonly kind: Kind.FLOAT;
635
700
  readonly value: string;
636
701
  readonly loc?: Location;
637
702
  }
@@ -639,7 +704,7 @@ type FloatValueNode = Or<
639
704
  type StringValueNode = Or<
640
705
  GraphQL.StringValueNode,
641
706
  {
642
- readonly kind;
707
+ readonly kind: Kind.STRING;
643
708
  readonly value: string;
644
709
  readonly block?: boolean;
645
710
  readonly loc?: Location;
@@ -648,7 +713,7 @@ type StringValueNode = Or<
648
713
  type BooleanValueNode = Or<
649
714
  GraphQL.BooleanValueNode,
650
715
  {
651
- readonly kind;
716
+ readonly kind: Kind.BOOLEAN;
652
717
  readonly value: boolean;
653
718
  readonly loc?: Location;
654
719
  }
@@ -656,14 +721,14 @@ type BooleanValueNode = Or<
656
721
  type NullValueNode = Or<
657
722
  GraphQL.NullValueNode,
658
723
  {
659
- readonly kind;
724
+ readonly kind: Kind.NULL;
660
725
  readonly loc?: Location;
661
726
  }
662
727
  >;
663
728
  type EnumValueNode = Or<
664
729
  GraphQL.EnumValueNode,
665
730
  {
666
- readonly kind;
731
+ readonly kind: Kind.ENUM;
667
732
  readonly value: string;
668
733
  readonly loc?: Location;
669
734
  }
@@ -671,7 +736,7 @@ type EnumValueNode = Or<
671
736
  type ListValueNode = Or<
672
737
  GraphQL.ListValueNode,
673
738
  {
674
- readonly kind;
739
+ readonly kind: Kind.LIST;
675
740
  readonly values: ReadonlyArray<ValueNode>;
676
741
  readonly loc?: Location;
677
742
  }
@@ -679,7 +744,7 @@ type ListValueNode = Or<
679
744
  type ConstListValueNode = Or<
680
745
  GraphQL.ConstListValueNode,
681
746
  {
682
- readonly kind;
747
+ readonly kind: Kind.LIST;
683
748
  readonly values: ReadonlyArray<ConstValueNode>;
684
749
  readonly loc?: Location;
685
750
  }
@@ -687,7 +752,7 @@ type ConstListValueNode = Or<
687
752
  type ObjectValueNode = Or<
688
753
  GraphQL.ObjectValueNode,
689
754
  {
690
- readonly kind;
755
+ readonly kind: Kind.OBJECT;
691
756
  readonly fields: ReadonlyArray<ObjectFieldNode>;
692
757
  readonly loc?: Location;
693
758
  }
@@ -695,7 +760,7 @@ type ObjectValueNode = Or<
695
760
  type ConstObjectValueNode = Or<
696
761
  GraphQL.ConstObjectValueNode,
697
762
  {
698
- readonly kind;
763
+ readonly kind: Kind.OBJECT;
699
764
  readonly fields: ReadonlyArray<ConstObjectFieldNode>;
700
765
  readonly loc?: Location;
701
766
  }
@@ -703,7 +768,7 @@ type ConstObjectValueNode = Or<
703
768
  type ObjectFieldNode = Or<
704
769
  GraphQL.ObjectFieldNode,
705
770
  {
706
- readonly kind;
771
+ readonly kind: Kind.OBJECT_FIELD;
707
772
  readonly name: NameNode;
708
773
  readonly value: ValueNode;
709
774
  readonly loc?: Location;
@@ -712,7 +777,7 @@ type ObjectFieldNode = Or<
712
777
  type ConstObjectFieldNode = Or<
713
778
  GraphQL.ConstObjectFieldNode,
714
779
  {
715
- readonly kind;
780
+ readonly kind: Kind.OBJECT_FIELD;
716
781
  readonly name: NameNode;
717
782
  readonly value: ConstValueNode;
718
783
  readonly loc?: Location;
@@ -721,7 +786,7 @@ type ConstObjectFieldNode = Or<
721
786
  type DirectiveNode = Or<
722
787
  GraphQL.DirectiveNode,
723
788
  {
724
- readonly kind;
789
+ readonly kind: Kind.DIRECTIVE;
725
790
  readonly name: NameNode;
726
791
  readonly arguments?: ReadonlyArray<ArgumentNode>;
727
792
  readonly loc?: Location;
@@ -730,7 +795,7 @@ type DirectiveNode = Or<
730
795
  type ConstDirectiveNode = Or<
731
796
  GraphQL.ConstDirectiveNode,
732
797
  {
733
- readonly kind;
798
+ readonly kind: Kind.DIRECTIVE;
734
799
  readonly name: NameNode;
735
800
  readonly arguments?: ReadonlyArray<ConstArgumentNode>;
736
801
  readonly loc?: Location;
@@ -740,7 +805,7 @@ type TypeNode = Or<GraphQL.TypeNode, NamedTypeNode | ListTypeNode | NonNullTypeN
740
805
  type NamedTypeNode = Or<
741
806
  GraphQL.NamedTypeNode,
742
807
  {
743
- readonly kind;
808
+ readonly kind: Kind.NAMED_TYPE;
744
809
  readonly name: NameNode;
745
810
  readonly loc?: Location;
746
811
  }
@@ -748,7 +813,7 @@ type NamedTypeNode = Or<
748
813
  type ListTypeNode = Or<
749
814
  GraphQL.ListTypeNode,
750
815
  {
751
- readonly kind;
816
+ readonly kind: Kind.LIST_TYPE;
752
817
  readonly type: TypeNode;
753
818
  readonly loc?: Location;
754
819
  }
@@ -756,7 +821,7 @@ type ListTypeNode = Or<
756
821
  type NonNullTypeNode = Or<
757
822
  GraphQL.NonNullTypeNode,
758
823
  {
759
- readonly kind;
824
+ readonly kind: Kind.NON_NULL_TYPE;
760
825
  readonly type: NamedTypeNode | ListTypeNode;
761
826
  readonly loc?: Location;
762
827
  }
@@ -857,81 +922,10 @@ declare function valueFromTypeNode(
857
922
  declare function isSelectionNode(node: ASTNode): node is SelectionNode;
858
923
 
859
924
  export {
860
- type ASTNode,
861
- type ASTReducer,
862
- type ASTVisitFn,
863
- type ASTVisitor,
864
- type ArgumentCoordinateNode,
865
- type ArgumentNode,
866
925
  BREAK,
867
- type BooleanValueNode,
868
- type ConstArgumentNode,
869
- type ConstDirectiveNode,
870
- type ConstListValueNode,
871
- type ConstObjectFieldNode,
872
- type ConstObjectValueNode,
873
- type ConstValueNode,
874
- type DefinitionNode,
875
- type DirectiveArgumentCoordinateNode,
876
- type DirectiveCoordinateNode,
877
- type DirectiveDefinitionNode,
878
- type DirectiveNode,
879
- type DocumentNode,
880
- type EnumTypeDefinitionNode,
881
- type EnumTypeExtensionNode,
882
- type EnumValueDefinitionNode,
883
- type EnumValueNode,
884
- type ExecutableDefinitionNode,
885
- type Extensions,
886
- type FieldDefinitionNode,
887
- type FieldNode,
888
- type FloatValueNode,
889
- type FragmentDefinitionNode,
890
- type FragmentSpreadNode,
891
926
  GraphQLError,
892
- type InlineFragmentNode,
893
- type InputObjectTypeDefinitionNode,
894
- type InputObjectTypeExtensionNode,
895
- type InputValueDefinitionNode,
896
- type IntValueNode,
897
- type InterfaceTypeDefinitionNode,
898
- type InterfaceTypeExtensionNode,
899
927
  Kind,
900
- type ListTypeNode,
901
- type ListValueNode,
902
- type Location,
903
- type MemberCoordinateNode,
904
- type NameNode,
905
- type NamedTypeNode,
906
- type NonNullTypeNode,
907
- type NullValueNode,
908
- type ObjectFieldNode,
909
- type ObjectTypeDefinitionNode,
910
- type ObjectTypeExtensionNode,
911
- type ObjectValueNode,
912
- type OperationDefinitionNode,
913
- type OperationTypeDefinitionNode,
914
928
  OperationTypeNode,
915
- type ScalarTypeDefinitionNode,
916
- type ScalarTypeExtensionNode,
917
- type SchemaCoordinateNode,
918
- type SchemaDefinitionNode,
919
- type SchemaExtensionNode,
920
- type SelectionNode,
921
- type SelectionSetNode,
922
- type Source,
923
- type StringValueNode,
924
- type TypeCoordinateNode,
925
- type TypeDefinitionNode,
926
- type TypeExtensionNode,
927
- type TypeNode,
928
- type TypeSystemDefinitionNode,
929
- type TypeSystemExtensionNode,
930
- type UnionTypeDefinitionNode,
931
- type UnionTypeExtensionNode,
932
- type ValueNode,
933
- type VariableDefinitionNode,
934
- type VariableNode,
935
929
  isSelectionNode,
936
930
  parse,
937
931
  parseType,
@@ -943,3 +937,78 @@ export {
943
937
  valueFromTypeNode,
944
938
  visit,
945
939
  };
940
+ export type {
941
+ ASTNode,
942
+ ASTReducer,
943
+ ASTVisitFn,
944
+ ASTVisitor,
945
+ ArgumentCoordinateNode,
946
+ ArgumentNode,
947
+ BooleanValueNode,
948
+ ConstArgumentNode,
949
+ ConstDirectiveNode,
950
+ ConstListValueNode,
951
+ ConstObjectFieldNode,
952
+ ConstObjectValueNode,
953
+ ConstValueNode,
954
+ DefinitionNode,
955
+ DirectiveArgumentCoordinateNode,
956
+ DirectiveCoordinateNode,
957
+ DirectiveDefinitionNode,
958
+ DirectiveNode,
959
+ DocumentNode,
960
+ EnumTypeDefinitionNode,
961
+ EnumTypeExtensionNode,
962
+ EnumValueDefinitionNode,
963
+ EnumValueNode,
964
+ ExecutableDefinitionNode,
965
+ Extensions,
966
+ FieldDefinitionNode,
967
+ FieldNode,
968
+ FloatValueNode,
969
+ FragmentDefinitionNode,
970
+ FragmentSpreadNode,
971
+ GraphQLKind,
972
+ InlineFragmentNode,
973
+ InputObjectTypeDefinitionNode,
974
+ InputObjectTypeExtensionNode,
975
+ InputValueDefinitionNode,
976
+ IntValueNode,
977
+ InterfaceTypeDefinitionNode,
978
+ InterfaceTypeExtensionNode,
979
+ IsGraphQLAny,
980
+ ListTypeNode,
981
+ ListValueNode,
982
+ Location,
983
+ MemberCoordinateNode,
984
+ NameNode,
985
+ NamedTypeNode,
986
+ NonNullTypeNode,
987
+ NullValueNode,
988
+ ObjectFieldNode,
989
+ ObjectTypeDefinitionNode,
990
+ ObjectTypeExtensionNode,
991
+ ObjectValueNode,
992
+ OperationDefinitionNode,
993
+ OperationTypeDefinitionNode,
994
+ ScalarTypeDefinitionNode,
995
+ ScalarTypeExtensionNode,
996
+ SchemaCoordinateNode,
997
+ SchemaDefinitionNode,
998
+ SchemaExtensionNode,
999
+ SelectionNode,
1000
+ SelectionSetNode,
1001
+ Source,
1002
+ StringValueNode,
1003
+ TypeCoordinateNode,
1004
+ TypeDefinitionNode,
1005
+ TypeExtensionNode,
1006
+ TypeNode,
1007
+ TypeSystemDefinitionNode,
1008
+ TypeSystemExtensionNode,
1009
+ UnionTypeDefinitionNode,
1010
+ UnionTypeExtensionNode,
1011
+ ValueNode,
1012
+ VariableDefinitionNode,
1013
+ VariableNode,
1014
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@0no-co/graphql.web",
3
3
  "description": "A spec-compliant client-side GraphQL implementation",
4
- "version": "1.3.0",
4
+ "version": "1.3.2",
5
5
  "author": "0no.co <hi@0no.co>",
6
6
  "source": "./src/index.ts",
7
7
  "main": "./dist/graphql.web",
@@ -96,9 +96,9 @@
96
96
  "rimraf": "^5.0.5",
97
97
  "rollup": "^4.9.6",
98
98
  "rollup-plugin-cjs-check": "^1.0.3",
99
- "rollup-plugin-dts": "^6.1.0",
99
+ "rollup-plugin-dts": "^6.4.1",
100
100
  "terser": "^5.27.0",
101
- "typescript": "^5.3.3",
101
+ "typescript": "^5.9.3",
102
102
  "vitest": "^1.2.2"
103
103
  },
104
104
  "publishConfig": {