graphql 15.5.1 → 15.6.1
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.
- package/index.d.ts +1 -0
- package/language/index.d.ts +1 -0
- package/language/parser.d.ts +456 -1
- package/language/visitor.d.ts +9 -0
- package/package.json +2 -2
- package/type/definition.js +1 -0
- package/type/definition.js.flow +1 -0
- package/type/definition.mjs +1 -0
- package/type/introspection.js +30 -21
- package/type/introspection.js.flow +11 -1
- package/type/introspection.mjs +30 -21
- package/version.js +2 -2
- package/version.js.flow +2 -2
- package/version.mjs +2 -2
package/index.d.ts
CHANGED
package/language/index.d.ts
CHANGED
package/language/parser.d.ts
CHANGED
|
@@ -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 {
|
|
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
|
+
}
|
package/language/visitor.d.ts
CHANGED
|
@@ -49,9 +49,18 @@ export type VisitFn<TAnyNode, TVisitedNode = TAnyNode> = (
|
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* A KeyMap describes each the traversable properties of each kind of node.
|
|
52
|
+
*
|
|
53
|
+
* @deprecated Please using ASTVisitorKeyMap instead
|
|
52
54
|
*/
|
|
53
55
|
export type VisitorKeyMap<T> = { [P in keyof T]: ReadonlyArray<keyof T[P]> };
|
|
54
56
|
|
|
57
|
+
/**
|
|
58
|
+
* A KeyMap describes each the traversable properties of each kind of node.
|
|
59
|
+
*/
|
|
60
|
+
export type ASTVisitorKeyMap = {
|
|
61
|
+
[P in keyof ASTKindToNode]?: ReadonlyArray<keyof ASTKindToNode[P]>;
|
|
62
|
+
};
|
|
63
|
+
|
|
55
64
|
// TODO: Should be `[]`, but that requires TypeScript@3
|
|
56
65
|
type EmptyTuple = Array<never>;
|
|
57
66
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphql",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.6.1",
|
|
4
4
|
"description": "A Query Language and Runtime which can target any service.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index",
|
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">= 10.x"
|
|
24
24
|
}
|
|
25
|
-
}
|
|
25
|
+
}
|
package/type/definition.js
CHANGED
|
@@ -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
|
};
|
package/type/definition.js.flow
CHANGED
|
@@ -1547,6 +1547,7 @@ export class GraphQLInputObjectType {
|
|
|
1547
1547
|
description: field.description,
|
|
1548
1548
|
type: field.type,
|
|
1549
1549
|
defaultValue: field.defaultValue,
|
|
1550
|
+
deprecationReason: field.deprecationReason,
|
|
1550
1551
|
extensions: field.extensions,
|
|
1551
1552
|
astNode: field.astNode,
|
|
1552
1553
|
}));
|
package/type/definition.mjs
CHANGED
|
@@ -1049,6 +1049,7 @@ export var GraphQLInputObjectType = /*#__PURE__*/function () {
|
|
|
1049
1049
|
description: field.description,
|
|
1050
1050
|
type: field.type,
|
|
1051
1051
|
defaultValue: field.defaultValue,
|
|
1052
|
+
deprecationReason: field.deprecationReason,
|
|
1052
1053
|
extensions: field.extensions,
|
|
1053
1054
|
astNode: field.astNode
|
|
1054
1055
|
};
|
package/type/introspection.js
CHANGED
|
@@ -107,8 +107,17 @@ var __Directive = new _definition.GraphQLObjectType({
|
|
|
107
107
|
},
|
|
108
108
|
args: {
|
|
109
109
|
type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))),
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
args: {
|
|
111
|
+
includeDeprecated: {
|
|
112
|
+
type: _scalars.GraphQLBoolean,
|
|
113
|
+
defaultValue: false
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
resolve: function resolve(field, _ref) {
|
|
117
|
+
var includeDeprecated = _ref.includeDeprecated;
|
|
118
|
+
return includeDeprecated ? field.args : field.args.filter(function (arg) {
|
|
119
|
+
return arg.deprecationReason == null;
|
|
120
|
+
});
|
|
112
121
|
}
|
|
113
122
|
}
|
|
114
123
|
};
|
|
@@ -273,8 +282,8 @@ var __Type = new _definition.GraphQLObjectType({
|
|
|
273
282
|
defaultValue: false
|
|
274
283
|
}
|
|
275
284
|
},
|
|
276
|
-
resolve: function resolve(type,
|
|
277
|
-
var includeDeprecated =
|
|
285
|
+
resolve: function resolve(type, _ref2) {
|
|
286
|
+
var includeDeprecated = _ref2.includeDeprecated;
|
|
278
287
|
|
|
279
288
|
if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) {
|
|
280
289
|
var fields = (0, _objectValues.default)(type.getFields());
|
|
@@ -294,8 +303,8 @@ var __Type = new _definition.GraphQLObjectType({
|
|
|
294
303
|
},
|
|
295
304
|
possibleTypes: {
|
|
296
305
|
type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)),
|
|
297
|
-
resolve: function resolve(type, _args, _context,
|
|
298
|
-
var schema =
|
|
306
|
+
resolve: function resolve(type, _args, _context, _ref3) {
|
|
307
|
+
var schema = _ref3.schema;
|
|
299
308
|
|
|
300
309
|
if ((0, _definition.isAbstractType)(type)) {
|
|
301
310
|
return schema.getPossibleTypes(type);
|
|
@@ -310,8 +319,8 @@ var __Type = new _definition.GraphQLObjectType({
|
|
|
310
319
|
defaultValue: false
|
|
311
320
|
}
|
|
312
321
|
},
|
|
313
|
-
resolve: function resolve(type,
|
|
314
|
-
var includeDeprecated =
|
|
322
|
+
resolve: function resolve(type, _ref4) {
|
|
323
|
+
var includeDeprecated = _ref4.includeDeprecated;
|
|
315
324
|
|
|
316
325
|
if ((0, _definition.isEnumType)(type)) {
|
|
317
326
|
var values = type.getValues();
|
|
@@ -329,8 +338,8 @@ var __Type = new _definition.GraphQLObjectType({
|
|
|
329
338
|
defaultValue: false
|
|
330
339
|
}
|
|
331
340
|
},
|
|
332
|
-
resolve: function resolve(type,
|
|
333
|
-
var includeDeprecated =
|
|
341
|
+
resolve: function resolve(type, _ref5) {
|
|
342
|
+
var includeDeprecated = _ref5.includeDeprecated;
|
|
334
343
|
|
|
335
344
|
if ((0, _definition.isInputObjectType)(type)) {
|
|
336
345
|
var values = (0, _objectValues.default)(type.getFields());
|
|
@@ -377,8 +386,8 @@ var __Field = new _definition.GraphQLObjectType({
|
|
|
377
386
|
defaultValue: false
|
|
378
387
|
}
|
|
379
388
|
},
|
|
380
|
-
resolve: function resolve(field,
|
|
381
|
-
var includeDeprecated =
|
|
389
|
+
resolve: function resolve(field, _ref6) {
|
|
390
|
+
var includeDeprecated = _ref6.includeDeprecated;
|
|
382
391
|
return includeDeprecated ? field.args : field.args.filter(function (arg) {
|
|
383
392
|
return arg.deprecationReason == null;
|
|
384
393
|
});
|
|
@@ -555,8 +564,8 @@ var SchemaMetaFieldDef = {
|
|
|
555
564
|
type: new _definition.GraphQLNonNull(__Schema),
|
|
556
565
|
description: 'Access the current type schema of this server.',
|
|
557
566
|
args: [],
|
|
558
|
-
resolve: function resolve(_source, _args, _context,
|
|
559
|
-
var schema =
|
|
567
|
+
resolve: function resolve(_source, _args, _context, _ref7) {
|
|
568
|
+
var schema = _ref7.schema;
|
|
560
569
|
return schema;
|
|
561
570
|
},
|
|
562
571
|
isDeprecated: false,
|
|
@@ -578,9 +587,9 @@ var TypeMetaFieldDef = {
|
|
|
578
587
|
extensions: undefined,
|
|
579
588
|
astNode: undefined
|
|
580
589
|
}],
|
|
581
|
-
resolve: function resolve(_source,
|
|
582
|
-
var name =
|
|
583
|
-
var schema =
|
|
590
|
+
resolve: function resolve(_source, _ref8, _context, _ref9) {
|
|
591
|
+
var name = _ref8.name;
|
|
592
|
+
var schema = _ref9.schema;
|
|
584
593
|
return schema.getType(name);
|
|
585
594
|
},
|
|
586
595
|
isDeprecated: false,
|
|
@@ -594,8 +603,8 @@ var TypeNameMetaFieldDef = {
|
|
|
594
603
|
type: new _definition.GraphQLNonNull(_scalars.GraphQLString),
|
|
595
604
|
description: 'The name of the current Object type at runtime.',
|
|
596
605
|
args: [],
|
|
597
|
-
resolve: function resolve(_source, _args, _context,
|
|
598
|
-
var parentType =
|
|
606
|
+
resolve: function resolve(_source, _args, _context, _ref10) {
|
|
607
|
+
var parentType = _ref10.parentType;
|
|
599
608
|
return parentType.name;
|
|
600
609
|
},
|
|
601
610
|
isDeprecated: false,
|
|
@@ -608,8 +617,8 @@ var introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocati
|
|
|
608
617
|
exports.introspectionTypes = introspectionTypes;
|
|
609
618
|
|
|
610
619
|
function isIntrospectionType(type) {
|
|
611
|
-
return introspectionTypes.some(function (
|
|
612
|
-
var name =
|
|
620
|
+
return introspectionTypes.some(function (_ref11) {
|
|
621
|
+
var name = _ref11.name;
|
|
613
622
|
return type.name === name;
|
|
614
623
|
});
|
|
615
624
|
}
|
|
@@ -107,7 +107,17 @@ export const __Directive = new GraphQLObjectType({
|
|
|
107
107
|
type: new GraphQLNonNull(
|
|
108
108
|
new GraphQLList(new GraphQLNonNull(__InputValue)),
|
|
109
109
|
),
|
|
110
|
-
|
|
110
|
+
args: {
|
|
111
|
+
includeDeprecated: {
|
|
112
|
+
type: GraphQLBoolean,
|
|
113
|
+
defaultValue: false,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
resolve(field, { includeDeprecated }) {
|
|
117
|
+
return includeDeprecated
|
|
118
|
+
? field.args
|
|
119
|
+
: field.args.filter((arg) => arg.deprecationReason == null);
|
|
120
|
+
},
|
|
111
121
|
},
|
|
112
122
|
}: GraphQLFieldConfigMap<GraphQLDirective, mixed>),
|
|
113
123
|
});
|
package/type/introspection.mjs
CHANGED
|
@@ -86,8 +86,17 @@ export var __Directive = new GraphQLObjectType({
|
|
|
86
86
|
},
|
|
87
87
|
args: {
|
|
88
88
|
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
args: {
|
|
90
|
+
includeDeprecated: {
|
|
91
|
+
type: GraphQLBoolean,
|
|
92
|
+
defaultValue: false
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
resolve: function resolve(field, _ref) {
|
|
96
|
+
var includeDeprecated = _ref.includeDeprecated;
|
|
97
|
+
return includeDeprecated ? field.args : field.args.filter(function (arg) {
|
|
98
|
+
return arg.deprecationReason == null;
|
|
99
|
+
});
|
|
91
100
|
}
|
|
92
101
|
}
|
|
93
102
|
};
|
|
@@ -246,8 +255,8 @@ export var __Type = new GraphQLObjectType({
|
|
|
246
255
|
defaultValue: false
|
|
247
256
|
}
|
|
248
257
|
},
|
|
249
|
-
resolve: function resolve(type,
|
|
250
|
-
var includeDeprecated =
|
|
258
|
+
resolve: function resolve(type, _ref2) {
|
|
259
|
+
var includeDeprecated = _ref2.includeDeprecated;
|
|
251
260
|
|
|
252
261
|
if (isObjectType(type) || isInterfaceType(type)) {
|
|
253
262
|
var fields = objectValues(type.getFields());
|
|
@@ -267,8 +276,8 @@ export var __Type = new GraphQLObjectType({
|
|
|
267
276
|
},
|
|
268
277
|
possibleTypes: {
|
|
269
278
|
type: new GraphQLList(new GraphQLNonNull(__Type)),
|
|
270
|
-
resolve: function resolve(type, _args, _context,
|
|
271
|
-
var schema =
|
|
279
|
+
resolve: function resolve(type, _args, _context, _ref3) {
|
|
280
|
+
var schema = _ref3.schema;
|
|
272
281
|
|
|
273
282
|
if (isAbstractType(type)) {
|
|
274
283
|
return schema.getPossibleTypes(type);
|
|
@@ -283,8 +292,8 @@ export var __Type = new GraphQLObjectType({
|
|
|
283
292
|
defaultValue: false
|
|
284
293
|
}
|
|
285
294
|
},
|
|
286
|
-
resolve: function resolve(type,
|
|
287
|
-
var includeDeprecated =
|
|
295
|
+
resolve: function resolve(type, _ref4) {
|
|
296
|
+
var includeDeprecated = _ref4.includeDeprecated;
|
|
288
297
|
|
|
289
298
|
if (isEnumType(type)) {
|
|
290
299
|
var values = type.getValues();
|
|
@@ -302,8 +311,8 @@ export var __Type = new GraphQLObjectType({
|
|
|
302
311
|
defaultValue: false
|
|
303
312
|
}
|
|
304
313
|
},
|
|
305
|
-
resolve: function resolve(type,
|
|
306
|
-
var includeDeprecated =
|
|
314
|
+
resolve: function resolve(type, _ref5) {
|
|
315
|
+
var includeDeprecated = _ref5.includeDeprecated;
|
|
307
316
|
|
|
308
317
|
if (isInputObjectType(type)) {
|
|
309
318
|
var values = objectValues(type.getFields());
|
|
@@ -347,8 +356,8 @@ export var __Field = new GraphQLObjectType({
|
|
|
347
356
|
defaultValue: false
|
|
348
357
|
}
|
|
349
358
|
},
|
|
350
|
-
resolve: function resolve(field,
|
|
351
|
-
var includeDeprecated =
|
|
359
|
+
resolve: function resolve(field, _ref6) {
|
|
360
|
+
var includeDeprecated = _ref6.includeDeprecated;
|
|
352
361
|
return includeDeprecated ? field.args : field.args.filter(function (arg) {
|
|
353
362
|
return arg.deprecationReason == null;
|
|
354
363
|
});
|
|
@@ -513,8 +522,8 @@ export var SchemaMetaFieldDef = {
|
|
|
513
522
|
type: new GraphQLNonNull(__Schema),
|
|
514
523
|
description: 'Access the current type schema of this server.',
|
|
515
524
|
args: [],
|
|
516
|
-
resolve: function resolve(_source, _args, _context,
|
|
517
|
-
var schema =
|
|
525
|
+
resolve: function resolve(_source, _args, _context, _ref7) {
|
|
526
|
+
var schema = _ref7.schema;
|
|
518
527
|
return schema;
|
|
519
528
|
},
|
|
520
529
|
isDeprecated: false,
|
|
@@ -535,9 +544,9 @@ export var TypeMetaFieldDef = {
|
|
|
535
544
|
extensions: undefined,
|
|
536
545
|
astNode: undefined
|
|
537
546
|
}],
|
|
538
|
-
resolve: function resolve(_source,
|
|
539
|
-
var name =
|
|
540
|
-
var schema =
|
|
547
|
+
resolve: function resolve(_source, _ref8, _context, _ref9) {
|
|
548
|
+
var name = _ref8.name;
|
|
549
|
+
var schema = _ref9.schema;
|
|
541
550
|
return schema.getType(name);
|
|
542
551
|
},
|
|
543
552
|
isDeprecated: false,
|
|
@@ -550,8 +559,8 @@ export var TypeNameMetaFieldDef = {
|
|
|
550
559
|
type: new GraphQLNonNull(GraphQLString),
|
|
551
560
|
description: 'The name of the current Object type at runtime.',
|
|
552
561
|
args: [],
|
|
553
|
-
resolve: function resolve(_source, _args, _context,
|
|
554
|
-
var parentType =
|
|
562
|
+
resolve: function resolve(_source, _args, _context, _ref10) {
|
|
563
|
+
var parentType = _ref10.parentType;
|
|
555
564
|
return parentType.name;
|
|
556
565
|
},
|
|
557
566
|
isDeprecated: false,
|
|
@@ -561,8 +570,8 @@ export var TypeNameMetaFieldDef = {
|
|
|
561
570
|
};
|
|
562
571
|
export var introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]);
|
|
563
572
|
export function isIntrospectionType(type) {
|
|
564
|
-
return introspectionTypes.some(function (
|
|
565
|
-
var name =
|
|
573
|
+
return introspectionTypes.some(function (_ref11) {
|
|
574
|
+
var name = _ref11.name;
|
|
566
575
|
return type.name === name;
|
|
567
576
|
});
|
|
568
577
|
}
|
package/version.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.versionInfo = exports.version = void 0;
|
|
|
13
13
|
/**
|
|
14
14
|
* A string containing the version of the GraphQL.js library
|
|
15
15
|
*/
|
|
16
|
-
var version = '15.
|
|
16
|
+
var version = '15.6.1';
|
|
17
17
|
/**
|
|
18
18
|
* An object containing the components of the GraphQL.js version string
|
|
19
19
|
*/
|
|
@@ -21,7 +21,7 @@ var version = '15.5.1';
|
|
|
21
21
|
exports.version = version;
|
|
22
22
|
var versionInfo = Object.freeze({
|
|
23
23
|
major: 15,
|
|
24
|
-
minor:
|
|
24
|
+
minor: 6,
|
|
25
25
|
patch: 1,
|
|
26
26
|
preReleaseTag: null
|
|
27
27
|
});
|
package/version.js.flow
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* A string containing the version of the GraphQL.js library
|
|
9
9
|
*/
|
|
10
|
-
export const version = '15.
|
|
10
|
+
export const version = '15.6.1';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* An object containing the components of the GraphQL.js version string
|
|
14
14
|
*/
|
|
15
15
|
export const versionInfo = Object.freeze({
|
|
16
16
|
major: 15,
|
|
17
|
-
minor:
|
|
17
|
+
minor: 6,
|
|
18
18
|
patch: 1,
|
|
19
19
|
preReleaseTag: null,
|
|
20
20
|
});
|
package/version.mjs
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* A string containing the version of the GraphQL.js library
|
|
8
8
|
*/
|
|
9
|
-
export var version = '15.
|
|
9
|
+
export var version = '15.6.1';
|
|
10
10
|
/**
|
|
11
11
|
* An object containing the components of the GraphQL.js version string
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
export var versionInfo = Object.freeze({
|
|
15
15
|
major: 15,
|
|
16
|
-
minor:
|
|
16
|
+
minor: 6,
|
|
17
17
|
patch: 1,
|
|
18
18
|
preReleaseTag: null
|
|
19
19
|
});
|