graphql 15.4.0 → 15.5.3

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 (72) hide show
  1. package/README.md +10 -0
  2. package/error/GraphQLError.js +3 -3
  3. package/error/GraphQLError.js.flow +1 -1
  4. package/error/GraphQLError.mjs +1 -1
  5. package/execution/execute.js +8 -9
  6. package/execution/execute.js.flow +8 -10
  7. package/execution/execute.mjs +8 -8
  8. package/jsutils/instanceOf.js +15 -9
  9. package/jsutils/instanceOf.js.flow +12 -5
  10. package/jsutils/instanceOf.mjs +13 -5
  11. package/jsutils/isAsyncIterable.js +1 -7
  12. package/jsutils/isAsyncIterable.js.flow +1 -5
  13. package/jsutils/isAsyncIterable.mjs +1 -7
  14. package/jsutils/naturalCompare.js +69 -0
  15. package/jsutils/naturalCompare.js.flow +59 -0
  16. package/jsutils/naturalCompare.mjs +61 -0
  17. package/jsutils/safeArrayFrom.js +73 -0
  18. package/jsutils/safeArrayFrom.js.flow +59 -0
  19. package/jsutils/safeArrayFrom.mjs +66 -0
  20. package/jsutils/suggestionList.js +5 -1
  21. package/jsutils/suggestionList.js.flow +3 -1
  22. package/jsutils/suggestionList.mjs +3 -1
  23. package/language/blockString.js.flow +2 -2
  24. package/language/parser.d.ts +456 -1
  25. package/language/source.js.flow +1 -1
  26. package/package.json +2 -3
  27. package/type/definition.js +1 -0
  28. package/type/definition.js.flow +58 -45
  29. package/type/definition.mjs +1 -0
  30. package/type/directives.js.flow +9 -7
  31. package/type/schema.js.flow +1 -1
  32. package/utilities/TypeInfo.js.flow +1 -1
  33. package/utilities/astFromValue.js +6 -8
  34. package/utilities/astFromValue.js.flow +6 -6
  35. package/utilities/astFromValue.mjs +6 -7
  36. package/utilities/buildClientSchema.js +2 -1
  37. package/utilities/buildClientSchema.js.flow +1 -0
  38. package/utilities/buildClientSchema.mjs +2 -1
  39. package/utilities/coerceInputValue.js +7 -8
  40. package/utilities/coerceInputValue.js.flow +11 -8
  41. package/utilities/coerceInputValue.mjs +7 -7
  42. package/utilities/findBreakingChanges.js +6 -2
  43. package/utilities/findBreakingChanges.js.flow +6 -2
  44. package/utilities/findBreakingChanges.mjs +5 -2
  45. package/utilities/getIntrospectionQuery.d.ts +6 -0
  46. package/utilities/getIntrospectionQuery.js +8 -2
  47. package/utilities/getIntrospectionQuery.js.flow +16 -3
  48. package/utilities/getIntrospectionQuery.mjs +8 -2
  49. package/utilities/introspectionFromSchema.js +3 -1
  50. package/utilities/introspectionFromSchema.js.flow +2 -0
  51. package/utilities/introspectionFromSchema.mjs +3 -1
  52. package/utilities/lexicographicSortSchema.js +3 -1
  53. package/utilities/lexicographicSortSchema.js.flow +3 -2
  54. package/utilities/lexicographicSortSchema.mjs +2 -1
  55. package/utilities/separateOperations.js +44 -40
  56. package/utilities/separateOperations.js.flow +46 -36
  57. package/utilities/separateOperations.mjs +44 -40
  58. package/validation/ValidationContext.js.flow +3 -3
  59. package/validation/rules/FieldsOnCorrectTypeRule.js +3 -1
  60. package/validation/rules/FieldsOnCorrectTypeRule.js.flow +2 -1
  61. package/validation/rules/FieldsOnCorrectTypeRule.mjs +2 -1
  62. package/validation/rules/UniqueDirectiveNamesRule.js +1 -1
  63. package/validation/rules/UniqueDirectiveNamesRule.mjs +1 -1
  64. package/validation/rules/UniqueTypeNamesRule.js +1 -1
  65. package/validation/rules/UniqueTypeNamesRule.mjs +1 -1
  66. package/validation/validate.js.flow +4 -4
  67. package/version.js +3 -3
  68. package/version.js.flow +3 -3
  69. package/version.mjs +3 -3
  70. package/jsutils/isCollection.js +0 -47
  71. package/jsutils/isCollection.js.flow +0 -38
  72. package/jsutils/isCollection.mjs +0 -40
@@ -0,0 +1,59 @@
1
+ // @flow strict
2
+ import { SYMBOL_ITERATOR } from '../polyfills/symbols';
3
+
4
+ /**
5
+ * Safer version of `Array.from` that return `null` if value isn't convertible to array.
6
+ * Also protects against Array-like objects without items.
7
+ *
8
+ * @example
9
+ *
10
+ * safeArrayFrom([ 1, 2, 3 ]) // [1, 2, 3]
11
+ * safeArrayFrom('ABC') // null
12
+ * safeArrayFrom({ length: 1 }) // null
13
+ * safeArrayFrom({ length: 1, 0: 'Alpha' }) // ['Alpha']
14
+ * safeArrayFrom({ key: 'value' }) // null
15
+ * safeArrayFrom(new Map()) // []
16
+ *
17
+ */
18
+ export default function safeArrayFrom<T>(
19
+ collection: mixed,
20
+ mapFn: (elem: mixed, index: number) => T = (item) => ((item: any): T),
21
+ ): Array<T> | null {
22
+ if (collection == null || typeof collection !== 'object') {
23
+ return null;
24
+ }
25
+
26
+ if (Array.isArray(collection)) {
27
+ return collection.map(mapFn);
28
+ }
29
+
30
+ // Is Iterable?
31
+ const iteratorMethod = collection[SYMBOL_ITERATOR];
32
+ if (typeof iteratorMethod === 'function') {
33
+ // $FlowFixMe[incompatible-use]
34
+ const iterator = iteratorMethod.call(collection);
35
+ const result = [];
36
+ let step;
37
+
38
+ for (let i = 0; !(step = iterator.next()).done; ++i) {
39
+ result.push(mapFn(step.value, i));
40
+ }
41
+ return result;
42
+ }
43
+
44
+ // Is Array like?
45
+ const length = collection.length;
46
+ if (typeof length === 'number' && length >= 0 && length % 1 === 0) {
47
+ const result = [];
48
+ for (let i = 0; i < length; ++i) {
49
+ if (!Object.prototype.hasOwnProperty.call(collection, i)) {
50
+ return null;
51
+ }
52
+ result.push(mapFn(collection[String(i)], i));
53
+ }
54
+
55
+ return result;
56
+ }
57
+
58
+ return null;
59
+ }
@@ -0,0 +1,66 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
+
3
+ import { SYMBOL_ITERATOR } from "../polyfills/symbols.mjs";
4
+ /**
5
+ * Safer version of `Array.from` that return `null` if value isn't convertible to array.
6
+ * Also protects against Array-like objects without items.
7
+ *
8
+ * @example
9
+ *
10
+ * safeArrayFrom([ 1, 2, 3 ]) // [1, 2, 3]
11
+ * safeArrayFrom('ABC') // null
12
+ * safeArrayFrom({ length: 1 }) // null
13
+ * safeArrayFrom({ length: 1, 0: 'Alpha' }) // ['Alpha']
14
+ * safeArrayFrom({ key: 'value' }) // null
15
+ * safeArrayFrom(new Map()) // []
16
+ *
17
+ */
18
+
19
+ export default function safeArrayFrom(collection) {
20
+ var mapFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (item) {
21
+ return item;
22
+ };
23
+
24
+ if (collection == null || _typeof(collection) !== 'object') {
25
+ return null;
26
+ }
27
+
28
+ if (Array.isArray(collection)) {
29
+ return collection.map(mapFn);
30
+ } // Is Iterable?
31
+
32
+
33
+ var iteratorMethod = collection[SYMBOL_ITERATOR];
34
+
35
+ if (typeof iteratorMethod === 'function') {
36
+ // $FlowFixMe[incompatible-use]
37
+ var iterator = iteratorMethod.call(collection);
38
+ var result = [];
39
+ var step;
40
+
41
+ for (var i = 0; !(step = iterator.next()).done; ++i) {
42
+ result.push(mapFn(step.value, i));
43
+ }
44
+
45
+ return result;
46
+ } // Is Array like?
47
+
48
+
49
+ var length = collection.length;
50
+
51
+ if (typeof length === 'number' && length >= 0 && length % 1 === 0) {
52
+ var _result = [];
53
+
54
+ for (var _i = 0; _i < length; ++_i) {
55
+ if (!Object.prototype.hasOwnProperty.call(collection, _i)) {
56
+ return null;
57
+ }
58
+
59
+ _result.push(mapFn(collection[String(_i)], _i));
60
+ }
61
+
62
+ return _result;
63
+ }
64
+
65
+ return null;
66
+ }
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = suggestionList;
7
7
 
8
+ var _naturalCompare = _interopRequireDefault(require("./naturalCompare.js"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
8
12
  /**
9
13
  * Given an invalid input string and a list of valid options, returns a filtered
10
14
  * list of valid options sorted based on their similarity with the input.
@@ -25,7 +29,7 @@ function suggestionList(input, options) {
25
29
 
26
30
  return Object.keys(optionsByDistance).sort(function (a, b) {
27
31
  var distanceDiff = optionsByDistance[a] - optionsByDistance[b];
28
- return distanceDiff !== 0 ? distanceDiff : a.localeCompare(b);
32
+ return distanceDiff !== 0 ? distanceDiff : (0, _naturalCompare.default)(a, b);
29
33
  });
30
34
  }
31
35
  /**
@@ -1,4 +1,6 @@
1
1
  // @flow strict
2
+ import naturalCompare from './naturalCompare';
3
+
2
4
  /**
3
5
  * Given an invalid input string and a list of valid options, returns a filtered
4
6
  * list of valid options sorted based on their similarity with the input.
@@ -20,7 +22,7 @@ export default function suggestionList(
20
22
 
21
23
  return Object.keys(optionsByDistance).sort((a, b) => {
22
24
  const distanceDiff = optionsByDistance[a] - optionsByDistance[b];
23
- return distanceDiff !== 0 ? distanceDiff : a.localeCompare(b);
25
+ return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b);
24
26
  });
25
27
  }
26
28
 
@@ -1,7 +1,9 @@
1
+ import naturalCompare from "./naturalCompare.mjs";
1
2
  /**
2
3
  * Given an invalid input string and a list of valid options, returns a filtered
3
4
  * list of valid options sorted based on their similarity with the input.
4
5
  */
6
+
5
7
  export default function suggestionList(input, options) {
6
8
  var optionsByDistance = Object.create(null);
7
9
  var lexicalDistance = new LexicalDistance(input);
@@ -18,7 +20,7 @@ export default function suggestionList(input, options) {
18
20
 
19
21
  return Object.keys(optionsByDistance).sort(function (a, b) {
20
22
  var distanceDiff = optionsByDistance[a] - optionsByDistance[b];
21
- return distanceDiff !== 0 ? distanceDiff : a.localeCompare(b);
23
+ return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b);
22
24
  });
23
25
  }
24
26
  /**
@@ -94,8 +94,8 @@ export function getBlockStringIndentation(value: string): number {
94
94
  */
95
95
  export function printBlockString(
96
96
  value: string,
97
- indentation?: string = '',
98
- preferMultipleLines?: boolean = false,
97
+ indentation: string = '',
98
+ preferMultipleLines: boolean = false,
99
99
  ): string {
100
100
  const isSingleLine = value.indexOf('\n') === -1;
101
101
  const hasLeadingSpace = value[0] === ' ' || value[0] === '\t';
@@ -1,5 +1,55 @@
1
+ import { Maybe } from '../jsutils/Maybe';
2
+ import { GraphQLError } from '..';
3
+
4
+ import { TokenKindEnum } from './tokenKind';
1
5
  import { Source } from './source';
2
- import { TypeNode, ValueNode, DocumentNode } from './ast';
6
+ import {
7
+ TypeNode,
8
+ ValueNode,
9
+ DocumentNode,
10
+ Token,
11
+ Location,
12
+ NameNode,
13
+ DirectiveDefinitionNode,
14
+ InputObjectTypeExtensionNode,
15
+ EnumTypeExtensionNode,
16
+ UnionTypeExtensionNode,
17
+ InterfaceTypeExtensionNode,
18
+ ObjectTypeExtensionNode,
19
+ ScalarTypeExtensionNode,
20
+ SchemaExtensionNode,
21
+ TypeSystemExtensionNode,
22
+ InputValueDefinitionNode,
23
+ InputObjectTypeDefinitionNode,
24
+ EnumValueDefinitionNode,
25
+ EnumTypeDefinitionNode,
26
+ NamedTypeNode,
27
+ UnionTypeDefinitionNode,
28
+ InterfaceTypeDefinitionNode,
29
+ FieldDefinitionNode,
30
+ ObjectTypeDefinitionNode,
31
+ ScalarTypeDefinitionNode,
32
+ OperationTypeDefinitionNode,
33
+ SchemaDefinitionNode,
34
+ StringValueNode,
35
+ DirectiveNode,
36
+ ObjectFieldNode,
37
+ ObjectValueNode,
38
+ FragmentSpreadNode,
39
+ InlineFragmentNode,
40
+ ArgumentNode,
41
+ FieldNode,
42
+ SelectionNode,
43
+ SelectionSetNode,
44
+ VariableNode,
45
+ VariableDefinitionNode,
46
+ OperationTypeNode,
47
+ OperationDefinitionNode,
48
+ DefinitionNode,
49
+ FragmentDefinitionNode,
50
+ ListValueNode,
51
+ } from './ast';
52
+ import { Lexer } from './lexer';
3
53
 
4
54
  /**
5
55
  * Configuration options to control parser behavior
@@ -86,3 +136,408 @@ export function parseType(
86
136
  source: string | Source,
87
137
  options?: ParseOptions,
88
138
  ): TypeNode;
139
+
140
+ export class Parser {
141
+ protected _lexer: Lexer;
142
+ protected _options?: ParseOptions;
143
+ constructor(source: string | Source, options?: ParseOptions);
144
+
145
+ /**
146
+ * Converts a name lex token into a name parse node.
147
+ */
148
+ parseName(): NameNode;
149
+ /**
150
+ * Document : Definition+
151
+ */
152
+ parseDocument(): DocumentNode;
153
+ /**
154
+ * Definition :
155
+ * - ExecutableDefinition
156
+ * - TypeSystemDefinition
157
+ * - TypeSystemExtension
158
+ *
159
+ * ExecutableDefinition :
160
+ * - OperationDefinition
161
+ * - FragmentDefinition
162
+ *
163
+ * TypeSystemDefinition :
164
+ * - SchemaDefinition
165
+ * - TypeDefinition
166
+ * - DirectiveDefinition
167
+ *
168
+ * TypeDefinition :
169
+ * - ScalarTypeDefinition
170
+ * - ObjectTypeDefinition
171
+ * - InterfaceTypeDefinition
172
+ * - UnionTypeDefinition
173
+ * - EnumTypeDefinition
174
+ * - InputObjectTypeDefinition
175
+ */
176
+ parseDefinition(): DefinitionNode;
177
+ /**
178
+ * OperationDefinition :
179
+ * - SelectionSet
180
+ * - OperationType Name? VariableDefinitions? Directives? SelectionSet
181
+ */
182
+ parseOperationDefinition(): OperationDefinitionNode;
183
+ /**
184
+ * OperationType : one of query mutation subscription
185
+ */
186
+ parseOperationType(): OperationTypeNode;
187
+ /**
188
+ * VariableDefinitions : ( VariableDefinition+ )
189
+ */
190
+ parseVariableDefinitions(): Array<VariableDefinitionNode>;
191
+ /**
192
+ * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
193
+ */
194
+ parseVariableDefinition(): VariableDefinitionNode;
195
+ /**
196
+ * Variable : $ Name
197
+ */
198
+ parseVariable(): VariableNode;
199
+ /**
200
+ * ```
201
+ * SelectionSet : { Selection+ }
202
+ * ```
203
+ */
204
+ parseSelectionSet(): SelectionSetNode;
205
+ /**
206
+ * Selection :
207
+ * - Field
208
+ * - FragmentSpread
209
+ * - InlineFragment
210
+ */
211
+ parseSelection(): SelectionNode;
212
+ /**
213
+ * Field : Alias? Name Arguments? Directives? SelectionSet?
214
+ *
215
+ * Alias : Name :
216
+ */
217
+ parseField(): FieldNode;
218
+ /**
219
+ * Arguments[Const] : ( Argument[?Const]+ )
220
+ */
221
+ parseArguments(): Array<ArgumentNode>;
222
+ /**
223
+ * Argument[Const] : Name : Value[?Const]
224
+ */
225
+ parseArgument(): ArgumentNode;
226
+ /**
227
+ * Corresponds to both FragmentSpread and InlineFragment in the spec.
228
+ *
229
+ * FragmentSpread : ... FragmentName Directives?
230
+ *
231
+ * InlineFragment : ... TypeCondition? Directives? SelectionSet
232
+ */
233
+ parseFragment(): FragmentSpreadNode | InlineFragmentNode;
234
+ /**
235
+ * FragmentDefinition :
236
+ * - fragment FragmentName on TypeCondition Directives? SelectionSet
237
+ *
238
+ * TypeCondition : NamedType
239
+ */
240
+ parseFragmentDefinition(): FragmentDefinitionNode;
241
+ /**
242
+ * FragmentName : Name but not `on`
243
+ */
244
+ parseFragmentName(): NameNode;
245
+ /**
246
+ * Value[Const] :
247
+ * - [~Const] Variable
248
+ * - IntValue
249
+ * - FloatValue
250
+ * - StringValue
251
+ * - BooleanValue
252
+ * - NullValue
253
+ * - EnumValue
254
+ * - ListValue[?Const]
255
+ * - ObjectValue[?Const]
256
+ *
257
+ * BooleanValue : one of `true` `false`
258
+ *
259
+ * NullValue : `null`
260
+ *
261
+ * EnumValue : Name but not `true`, `false` or `null`
262
+ */
263
+ parseValueLiteral(): ValueNode;
264
+ parseStringLiteral(): StringValueNode;
265
+ /**
266
+ * ListValue[Const] :
267
+ * - [ ]
268
+ * - [ Value[?Const]+ ]
269
+ */
270
+ parseList(): ListValueNode;
271
+ /**
272
+ * ```
273
+ * ObjectValue[Const] :
274
+ * - { }
275
+ * - { ObjectField[?Const]+ }
276
+ * ```
277
+ */
278
+ parseObject(isConst: boolean): ObjectValueNode;
279
+ /**
280
+ * ObjectField[Const] : Name : Value[?Const]
281
+ */
282
+ parseObjectField: ObjectFieldNode;
283
+ /**
284
+ * Directives[Const] : Directive[?Const]+
285
+ */
286
+ parseDirectives(): Array<DirectiveNode>;
287
+ /**
288
+ * ```
289
+ * Directive[Const] : @ Name Arguments[?Const]?
290
+ * ```
291
+ */
292
+ parseDirective(): DirectiveNode;
293
+ /**
294
+ * Type :
295
+ * - NamedType
296
+ * - ListType
297
+ * - NonNullType
298
+ */
299
+ parseTypeReference(): TypeNode;
300
+ /**
301
+ * NamedType : Name
302
+ */
303
+ parseNamedType(): NamedTypeNode;
304
+ peekDescription(): boolean;
305
+ /**
306
+ * Description : StringValue
307
+ */
308
+ parseDescription(): undefined | StringValueNode;
309
+ /**
310
+ * ```
311
+ * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }
312
+ * ```
313
+ */
314
+ parseSchemaDefinition(): SchemaDefinitionNode;
315
+ /**
316
+ * OperationTypeDefinition : OperationType : NamedType
317
+ */
318
+ parseOperationTypeDefinition(): OperationTypeDefinitionNode;
319
+ /**
320
+ * ScalarTypeDefinition : Description? scalar Name Directives[Const]?
321
+ */
322
+ parseScalarTypeDefinition(): ScalarTypeDefinitionNode;
323
+ /**
324
+ * ObjectTypeDefinition :
325
+ * Description?
326
+ * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
327
+ */
328
+ parseObjectTypeDefinition(): ObjectTypeDefinitionNode;
329
+ /**
330
+ * ImplementsInterfaces :
331
+ * - implements `&`? NamedType
332
+ * - ImplementsInterfaces & NamedType
333
+ */
334
+ parseImplementsInterfaces(): Array<NamedTypeNode>;
335
+ /**
336
+ * ```
337
+ * FieldsDefinition : { FieldDefinition+ }
338
+ * ```
339
+ */
340
+ parseFieldsDefinition(): Array<FieldDefinitionNode>;
341
+ /**
342
+ * FieldDefinition :
343
+ * - Description? Name ArgumentsDefinition? : Type Directives[Const]?
344
+ */
345
+ parseFieldDefinition(): FieldDefinitionNode;
346
+ /**
347
+ * ArgumentsDefinition : ( InputValueDefinition+ )
348
+ */
349
+ parseArgumentDefs(): Array<InputValueDefinitionNode>;
350
+ /**
351
+ * InputValueDefinition :
352
+ * - Description? Name : Type DefaultValue? Directives[Const]?
353
+ */
354
+ parseInputValueDef(): InputValueDefinitionNode;
355
+ /**
356
+ * InterfaceTypeDefinition :
357
+ * - Description? interface Name Directives[Const]? FieldsDefinition?
358
+ */
359
+ parseInterfaceTypeDefinition(): InterfaceTypeDefinitionNode;
360
+ /**
361
+ * UnionTypeDefinition :
362
+ * - Description? union Name Directives[Const]? UnionMemberTypes?
363
+ */
364
+ parseUnionTypeDefinition(): UnionTypeDefinitionNode;
365
+ /**
366
+ * UnionMemberTypes :
367
+ * - = `|`? NamedType
368
+ * - UnionMemberTypes | NamedType
369
+ */
370
+ parseUnionMemberTypes(): Array<NamedTypeNode>;
371
+ /**
372
+ * EnumTypeDefinition :
373
+ * - Description? enum Name Directives[Const]? EnumValuesDefinition?
374
+ */
375
+ parseEnumTypeDefinition(): EnumTypeDefinitionNode;
376
+ /**
377
+ * ```
378
+ * EnumValuesDefinition : { EnumValueDefinition+ }
379
+ * ```
380
+ */
381
+ parseEnumValuesDefinition(): Array<EnumValueDefinitionNode>;
382
+ /**
383
+ * EnumValueDefinition : Description? EnumValue Directives[Const]?
384
+ */
385
+ parseEnumValueDefinition(): EnumValueDefinitionNode;
386
+ /**
387
+ * EnumValue : Name but not `true`, `false` or `null`
388
+ */
389
+ parseEnumValueName(): NameNode;
390
+ /**
391
+ * InputObjectTypeDefinition :
392
+ * - Description? input Name Directives[Const]? InputFieldsDefinition?
393
+ */
394
+ parseInputObjectTypeDefinition(): InputObjectTypeDefinitionNode;
395
+ /**
396
+ * ```
397
+ * InputFieldsDefinition : { InputValueDefinition+ }
398
+ * ```
399
+ */
400
+ parseInputFieldsDefinition(): Array<InputValueDefinitionNode>;
401
+ /**
402
+ * TypeSystemExtension :
403
+ * - SchemaExtension
404
+ * - TypeExtension
405
+ *
406
+ * TypeExtension :
407
+ * - ScalarTypeExtension
408
+ * - ObjectTypeExtension
409
+ * - InterfaceTypeExtension
410
+ * - UnionTypeExtension
411
+ * - EnumTypeExtension
412
+ * - InputObjectTypeDefinition
413
+ */
414
+ parseTypeSystemExtension(): TypeSystemExtensionNode;
415
+ /**
416
+ * ```
417
+ * SchemaExtension :
418
+ * - extend schema Directives[Const]? { OperationTypeDefinition+ }
419
+ * - extend schema Directives[Const]
420
+ * ```
421
+ */
422
+ parseSchemaExtension(): SchemaExtensionNode;
423
+ /**
424
+ * ScalarTypeExtension :
425
+ * - extend scalar Name Directives[Const]
426
+ */
427
+ parseScalarTypeExtension(): ScalarTypeExtensionNode;
428
+ /**
429
+ * ObjectTypeExtension :
430
+ * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
431
+ * - extend type Name ImplementsInterfaces? Directives[Const]
432
+ * - extend type Name ImplementsInterfaces
433
+ */
434
+ parseObjectTypeExtension(): ObjectTypeExtensionNode;
435
+ /**
436
+ * InterfaceTypeExtension :
437
+ * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
438
+ * - extend interface Name ImplementsInterfaces? Directives[Const]
439
+ * - extend interface Name ImplementsInterfaces
440
+ */
441
+ parseInterfaceTypeExtension(): InterfaceTypeExtensionNode;
442
+ /**
443
+ * UnionTypeExtension :
444
+ * - extend union Name Directives[Const]? UnionMemberTypes
445
+ * - extend union Name Directives[Const]
446
+ */
447
+ parseUnionTypeExtension(): UnionTypeExtensionNode;
448
+ /**
449
+ * EnumTypeExtension :
450
+ * - extend enum Name Directives[Const]? EnumValuesDefinition
451
+ * - extend enum Name Directives[Const]
452
+ */
453
+ parseEnumTypeExtension(): EnumTypeExtensionNode;
454
+ /**
455
+ * InputObjectTypeExtension :
456
+ * - extend input Name Directives[Const]? InputFieldsDefinition
457
+ * - extend input Name Directives[Const]
458
+ */
459
+ parseInputObjectTypeExtension(): InputObjectTypeExtensionNode;
460
+ /**
461
+ * ```
462
+ * DirectiveDefinition :
463
+ * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations
464
+ * ```
465
+ */
466
+ parseDirectiveDefinition(): DirectiveDefinitionNode;
467
+ /**
468
+ * DirectiveLocations :
469
+ * - `|`? DirectiveLocation
470
+ * - DirectiveLocations | DirectiveLocation
471
+ */
472
+ parseDirectiveLocations(): Array<NameNode>;
473
+ parseDirectiveLocation(): NameNode;
474
+ /**
475
+ * Returns a location object, used to identify the place in the source that created a given parsed object.
476
+ */
477
+ loc(startToken: Token): Location | undefined;
478
+ /**
479
+ * Determines if the next token is of a given kind
480
+ */
481
+ peek(kind: TokenKindEnum): boolean;
482
+ /**
483
+ * If the next token is of the given kind, return that token after advancing the lexer.
484
+ * Otherwise, do not change the parser state and throw an error.
485
+ */
486
+ expectToken(kind: TokenKindEnum): Token;
487
+ /**
488
+ * If the next token is of the given kind, return "true" after advancing the lexer.
489
+ * Otherwise, do not change the parser state and return "false".
490
+ */
491
+ expectOptionalToken(kind: TokenKindEnum): boolean;
492
+ /**
493
+ * If the next token is a given keyword, advance the lexer.
494
+ * Otherwise, do not change the parser state and throw an error.
495
+ */
496
+ expectKeyword(value: string): void;
497
+ /**
498
+ * If the next token is a given keyword, return "true" after advancing the lexer.
499
+ * Otherwise, do not change the parser state and return "false".
500
+ */
501
+ expectOptionalKeyword(value: string): boolean;
502
+ /**
503
+ * Helper function for creating an error when an unexpected lexed token is encountered.
504
+ */
505
+ unexpected(atToken?: Maybe<Token>): GraphQLError;
506
+ /**
507
+ * Returns a possibly empty list of parse nodes, determined by the parseFn.
508
+ * This list begins with a lex token of openKind and ends with a lex token of closeKind.
509
+ * Advances the parser to the next lex token after the closing token.
510
+ */
511
+ any<T>(
512
+ openKind: TokenKindEnum,
513
+ parseFn: () => T,
514
+ closeKind: TokenKindEnum,
515
+ ): Array<T>;
516
+ /**
517
+ * Returns a list of parse nodes, determined by the parseFn.
518
+ * It can be empty only if open token is missing otherwise it will always return non-empty list
519
+ * that begins with a lex token of openKind and ends with a lex token of closeKind.
520
+ * Advances the parser to the next lex token after the closing token.
521
+ */
522
+ optionalMany<T>(
523
+ openKind: TokenKindEnum,
524
+ parseFn: () => T,
525
+ closeKind: TokenKindEnum,
526
+ ): Array<T>;
527
+ /**
528
+ * Returns a non-empty list of parse nodes, determined by the parseFn.
529
+ * This list begins with a lex token of openKind and ends with a lex token of closeKind.
530
+ * Advances the parser to the next lex token after the closing token.
531
+ */
532
+ many<T>(
533
+ openKind: TokenKindEnum,
534
+ parseFn: () => T,
535
+ closeKind: TokenKindEnum,
536
+ ): Array<T>;
537
+ /**
538
+ * Returns a non-empty list of parse nodes, determined by the parseFn.
539
+ * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
540
+ * Advances the parser to the next lex token after last item in the list.
541
+ */
542
+ delimitedMany<T>(delimiterKind: TokenKindEnum, parseFn: () => T): Array<T>;
543
+ }
@@ -26,7 +26,7 @@ export class Source {
26
26
  body: string,
27
27
  name: string = 'GraphQL request',
28
28
  locationOffset: Location = { line: 1, column: 1 },
29
- ): void {
29
+ ) {
30
30
  devAssert(
31
31
  typeof body === 'string',
32
32
  `Body must be a string. Received: ${inspect(body)}.`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphql",
3
- "version": "15.4.0",
3
+ "version": "15.5.3",
4
4
  "description": "A Query Language and Runtime which can target any service.",
5
5
  "license": "MIT",
6
6
  "main": "index",
@@ -21,6 +21,5 @@
21
21
  ],
22
22
  "engines": {
23
23
  "node": ">= 10.x"
24
- },
25
- "dependencies": {}
24
+ }
26
25
  }
@@ -1166,6 +1166,7 @@ var GraphQLInputObjectType = /*#__PURE__*/function () {
1166
1166
  description: field.description,
1167
1167
  type: field.type,
1168
1168
  defaultValue: field.defaultValue,
1169
+ deprecationReason: field.deprecationReason,
1169
1170
  extensions: field.extensions,
1170
1171
  astNode: field.astNode
1171
1172
  };