graphql 16.2.0 → 16.3.0-canary.pr.3479.undefined
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/error/GraphQLError.d.ts +17 -1
- package/error/GraphQLError.js +24 -9
- package/error/GraphQLError.mjs +24 -18
- package/execution/collectFields.d.ts +2 -2
- package/execution/collectFields.js +2 -2
- package/execution/collectFields.mjs +1 -1
- package/execution/execute.d.ts +5 -5
- package/execution/execute.js +12 -12
- package/execution/execute.mjs +14 -14
- package/execution/index.d.ts +1 -1
- package/execution/index.js +6 -0
- package/execution/index.mjs +1 -1
- package/execution/subscribe.d.ts +1 -1
- package/execution/subscribe.js +4 -4
- package/execution/subscribe.mjs +2 -2
- package/execution/values.d.ts +3 -5
- package/execution/values.js +4 -6
- package/execution/values.mjs +2 -4
- package/graphql.js +4 -4
- package/graphql.mjs +1 -1
- package/index.d.ts +3 -62
- package/index.js +6 -0
- package/index.mjs +60 -114
- package/jsutils/promiseReduce.mjs +1 -1
- package/language/index.d.ts +0 -1
- package/language/lexer.d.ts +1 -1
- package/language/lexer.js +2 -2
- package/language/lexer.mjs +2 -2
- package/language/parser.d.ts +40 -40
- package/language/parser.js +6 -6
- package/language/parser.mjs +4 -4
- package/language/predicates.d.ts +4 -4
- package/language/printLocation.d.ts +1 -1
- package/language/printLocation.mjs +1 -1
- package/language/printer.js +2 -2
- package/language/printer.mjs +1 -1
- package/language/source.js +2 -2
- package/language/source.mjs +1 -1
- package/language/visitor.js +10 -12
- package/language/visitor.mjs +9 -11
- package/package.json +3 -3
- package/type/assertName.mjs +1 -1
- package/type/definition.d.ts +14 -14
- package/type/definition.js +11 -11
- package/type/definition.mjs +8 -13
- package/type/directives.js +6 -6
- package/type/directives.mjs +4 -4
- package/type/index.d.ts +1 -28
- package/type/index.mjs +23 -42
- package/type/introspection.d.ts +2 -2
- package/type/introspection.js +4 -4
- package/type/introspection.mjs +8 -8
- package/type/scalars.js +2 -2
- package/type/scalars.mjs +1 -1
- package/type/schema.d.ts +3 -3
- package/type/schema.js +6 -6
- package/type/schema.mjs +7 -7
- package/type/validate.js +4 -4
- package/type/validate.mjs +7 -7
- package/utilities/TypeInfo.d.ts +9 -9
- package/utilities/TypeInfo.js +2 -2
- package/utilities/TypeInfo.mjs +7 -7
- package/utilities/astFromValue.js +4 -4
- package/utilities/astFromValue.mjs +3 -3
- package/utilities/buildASTSchema.d.ts +1 -1
- package/utilities/buildASTSchema.js +2 -2
- package/utilities/buildASTSchema.mjs +2 -2
- package/utilities/buildClientSchema.js +7 -7
- package/utilities/buildClientSchema.mjs +15 -15
- package/utilities/coerceInputValue.js +5 -5
- package/utilities/coerceInputValue.mjs +5 -5
- package/utilities/extendSchema.d.ts +1 -1
- package/utilities/extendSchema.js +10 -10
- package/utilities/extendSchema.mjs +31 -31
- package/utilities/findBreakingChanges.js +5 -20
- package/utilities/findBreakingChanges.mjs +9 -20
- package/utilities/getIntrospectionQuery.d.ts +4 -0
- package/utilities/getIntrospectionQuery.js +4 -0
- package/utilities/getIntrospectionQuery.mjs +4 -0
- package/utilities/getOperationRootType.d.ts +1 -1
- package/utilities/index.d.ts +0 -25
- package/utilities/index.mjs +21 -44
- package/utilities/introspectionFromSchema.d.ts +1 -1
- package/utilities/lexicographicSortSchema.js +2 -2
- package/utilities/lexicographicSortSchema.mjs +10 -10
- package/utilities/printSchema.d.ts +1 -1
- package/utilities/printSchema.js +5 -5
- package/utilities/printSchema.mjs +11 -11
- package/utilities/sortValueNode.d.ts +9 -0
- package/utilities/sortValueNode.js +47 -0
- package/utilities/sortValueNode.mjs +39 -0
- package/utilities/stripIgnoredCharacters.js +4 -4
- package/utilities/stripIgnoredCharacters.mjs +3 -3
- package/utilities/typeComparators.d.ts +1 -1
- package/utilities/typeComparators.mjs +3 -3
- package/utilities/typeFromAST.d.ts +4 -4
- package/utilities/typeFromAST.mjs +0 -8
- package/utilities/valueFromAST.d.ts +1 -1
- package/utilities/valueFromAST.js +2 -2
- package/utilities/valueFromAST.mjs +3 -3
- package/utilities/valueFromASTUntyped.d.ts +1 -1
- package/utilities/valueFromASTUntyped.mjs +1 -1
- package/validation/ValidationContext.d.ts +10 -10
- package/validation/index.d.ts +0 -29
- package/validation/index.mjs +29 -58
- package/validation/rules/FieldsOnCorrectTypeRule.js +2 -2
- package/validation/rules/FieldsOnCorrectTypeRule.mjs +3 -3
- package/validation/rules/KnownArgumentNamesRule.d.ts +1 -1
- package/validation/rules/KnownDirectivesRule.d.ts +1 -1
- package/validation/rules/KnownDirectivesRule.js +2 -2
- package/validation/rules/KnownDirectivesRule.mjs +1 -1
- package/validation/rules/KnownTypeNamesRule.d.ts +1 -1
- package/validation/rules/KnownTypeNamesRule.js +2 -2
- package/validation/rules/KnownTypeNamesRule.mjs +1 -1
- package/validation/rules/OverlappingFieldsCanBeMergedRule.js +42 -38
- package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +42 -41
- package/validation/rules/PossibleFragmentSpreadsRule.js +2 -2
- package/validation/rules/PossibleFragmentSpreadsRule.mjs +1 -1
- package/validation/rules/PossibleTypeExtensionsRule.js +2 -2
- package/validation/rules/PossibleTypeExtensionsRule.mjs +5 -5
- package/validation/rules/ProvidedRequiredArgumentsRule.d.ts +1 -1
- package/validation/rules/ProvidedRequiredArgumentsRule.js +2 -2
- package/validation/rules/ProvidedRequiredArgumentsRule.mjs +1 -1
- package/validation/rules/UniqueFieldDefinitionNamesRule.mjs +2 -2
- package/validation/rules/ValuesOfCorrectTypeRule.js +2 -2
- package/validation/rules/ValuesOfCorrectTypeRule.mjs +5 -5
- package/validation/rules/VariablesInAllowedPositionRule.js +2 -2
- package/validation/rules/VariablesInAllowedPositionRule.mjs +1 -1
- package/validation/specifiedRules.d.ts +1 -1
- package/validation/specifiedRules.js +47 -47
- package/validation/specifiedRules.mjs +41 -41
- package/version.js +2 -2
- package/version.mjs +2 -2
package/index.d.ts
CHANGED
|
@@ -22,17 +22,15 @@
|
|
|
22
22
|
* import { parse } from 'graphql';
|
|
23
23
|
* import { parse } from 'graphql/language';
|
|
24
24
|
* ```
|
|
25
|
+
*
|
|
26
|
+
* @packageDocumentation
|
|
25
27
|
*/
|
|
26
|
-
/** The GraphQL.js version info. */
|
|
27
28
|
export { version, versionInfo } from './version';
|
|
28
|
-
/** The primary entry point into fulfilling a GraphQL request. */
|
|
29
29
|
export type { GraphQLArgs } from './graphql';
|
|
30
30
|
export { graphql, graphqlSync } from './graphql';
|
|
31
|
-
/** Create and operate on GraphQL type definitions and schema. */
|
|
32
31
|
export {
|
|
33
32
|
resolveObjMapThunk,
|
|
34
33
|
resolveReadonlyArrayThunk,
|
|
35
|
-
/** Definitions */
|
|
36
34
|
GraphQLSchema,
|
|
37
35
|
GraphQLDirective,
|
|
38
36
|
GraphQLScalarType,
|
|
@@ -43,27 +41,21 @@ export {
|
|
|
43
41
|
GraphQLInputObjectType,
|
|
44
42
|
GraphQLList,
|
|
45
43
|
GraphQLNonNull,
|
|
46
|
-
/** Standard GraphQL Scalars */
|
|
47
44
|
specifiedScalarTypes,
|
|
48
45
|
GraphQLInt,
|
|
49
46
|
GraphQLFloat,
|
|
50
47
|
GraphQLString,
|
|
51
48
|
GraphQLBoolean,
|
|
52
49
|
GraphQLID,
|
|
53
|
-
/** Int boundaries constants */
|
|
54
50
|
GRAPHQL_MAX_INT,
|
|
55
51
|
GRAPHQL_MIN_INT,
|
|
56
|
-
/** Built-in Directives defined by the Spec */
|
|
57
52
|
specifiedDirectives,
|
|
58
53
|
GraphQLIncludeDirective,
|
|
59
54
|
GraphQLSkipDirective,
|
|
60
55
|
GraphQLDeprecatedDirective,
|
|
61
56
|
GraphQLSpecifiedByDirective,
|
|
62
|
-
/** "Enum" of Type Kinds */
|
|
63
57
|
TypeKind,
|
|
64
|
-
/** Constant Deprecation Reason */
|
|
65
58
|
DEFAULT_DEPRECATION_REASON,
|
|
66
|
-
/** GraphQL Types for introspection. */
|
|
67
59
|
introspectionTypes,
|
|
68
60
|
__Schema,
|
|
69
61
|
__Directive,
|
|
@@ -73,11 +65,9 @@ export {
|
|
|
73
65
|
__InputValue,
|
|
74
66
|
__EnumValue,
|
|
75
67
|
__TypeKind,
|
|
76
|
-
/** Meta-field definitions. */
|
|
77
68
|
SchemaMetaFieldDef,
|
|
78
69
|
TypeMetaFieldDef,
|
|
79
70
|
TypeNameMetaFieldDef,
|
|
80
|
-
/** Predicates */
|
|
81
71
|
isSchema,
|
|
82
72
|
isDirective,
|
|
83
73
|
isType,
|
|
@@ -102,7 +92,6 @@ export {
|
|
|
102
92
|
isSpecifiedScalarType,
|
|
103
93
|
isIntrospectionType,
|
|
104
94
|
isSpecifiedDirective,
|
|
105
|
-
/** Assertions */
|
|
106
95
|
assertSchema,
|
|
107
96
|
assertDirective,
|
|
108
97
|
assertType,
|
|
@@ -122,13 +111,10 @@ export {
|
|
|
122
111
|
assertWrappingType,
|
|
123
112
|
assertNullableType,
|
|
124
113
|
assertNamedType,
|
|
125
|
-
/** Un-modifiers */
|
|
126
114
|
getNullableType,
|
|
127
115
|
getNamedType,
|
|
128
|
-
/** Validate GraphQL schema. */
|
|
129
116
|
validateSchema,
|
|
130
117
|
assertValidSchema,
|
|
131
|
-
/** Upholds the spec rules about naming. */
|
|
132
118
|
assertName,
|
|
133
119
|
assertEnumValueName,
|
|
134
120
|
} from './type/index';
|
|
@@ -189,27 +175,21 @@ export type {
|
|
|
189
175
|
GraphQLScalarValueParser,
|
|
190
176
|
GraphQLScalarLiteralParser,
|
|
191
177
|
} from './type/index';
|
|
192
|
-
/** Parse and operate on GraphQL language source files. */
|
|
193
178
|
export {
|
|
194
179
|
Token,
|
|
195
180
|
Source,
|
|
196
181
|
Location,
|
|
197
182
|
OperationTypeNode,
|
|
198
183
|
getLocation,
|
|
199
|
-
/** Print source location */
|
|
200
184
|
printLocation,
|
|
201
185
|
printSourceLocation,
|
|
202
|
-
/** Lex */
|
|
203
186
|
Lexer,
|
|
204
187
|
TokenKind,
|
|
205
|
-
/** Parse */
|
|
206
188
|
parse,
|
|
207
189
|
parseValue,
|
|
208
190
|
parseConstValue,
|
|
209
191
|
parseType,
|
|
210
|
-
/** Print */
|
|
211
192
|
print,
|
|
212
|
-
/** Visit */
|
|
213
193
|
visit,
|
|
214
194
|
visitInParallel,
|
|
215
195
|
getVisitFn,
|
|
@@ -217,7 +197,6 @@ export {
|
|
|
217
197
|
BREAK,
|
|
218
198
|
Kind,
|
|
219
199
|
DirectiveLocation,
|
|
220
|
-
/** Predicates */
|
|
221
200
|
isDefinitionNode,
|
|
222
201
|
isExecutableDefinitionNode,
|
|
223
202
|
isSelectionNode,
|
|
@@ -235,14 +214,11 @@ export type {
|
|
|
235
214
|
TokenKindEnum,
|
|
236
215
|
KindEnum,
|
|
237
216
|
DirectiveLocationEnum,
|
|
238
|
-
/** Visitor utilities */
|
|
239
217
|
ASTVisitor,
|
|
240
218
|
ASTVisitFn,
|
|
241
219
|
ASTVisitorKeyMap,
|
|
242
|
-
/** AST nodes */
|
|
243
220
|
ASTNode,
|
|
244
221
|
ASTKindToNode,
|
|
245
|
-
/** Each kind of AST node */
|
|
246
222
|
NameNode,
|
|
247
223
|
DocumentNode,
|
|
248
224
|
DefinitionNode,
|
|
@@ -302,13 +278,13 @@ export type {
|
|
|
302
278
|
EnumTypeExtensionNode,
|
|
303
279
|
InputObjectTypeExtensionNode,
|
|
304
280
|
} from './language/index';
|
|
305
|
-
/** Execute GraphQL queries. */
|
|
306
281
|
export {
|
|
307
282
|
execute,
|
|
308
283
|
executeSync,
|
|
309
284
|
defaultFieldResolver,
|
|
310
285
|
defaultTypeResolver,
|
|
311
286
|
responsePathAsArray,
|
|
287
|
+
getVariableValues,
|
|
312
288
|
getDirectiveValues,
|
|
313
289
|
subscribe,
|
|
314
290
|
createSourceEventStream,
|
|
@@ -319,13 +295,10 @@ export type {
|
|
|
319
295
|
FormattedExecutionResult,
|
|
320
296
|
} from './execution/index';
|
|
321
297
|
export type { SubscriptionArgs } from './subscription/index';
|
|
322
|
-
/** Validate GraphQL documents. */
|
|
323
298
|
export {
|
|
324
299
|
validate,
|
|
325
300
|
ValidationContext,
|
|
326
|
-
/** All validation rules in the GraphQL Specification. */
|
|
327
301
|
specifiedRules,
|
|
328
|
-
/** Individual validation rules. */
|
|
329
302
|
ExecutableDefinitionsRule,
|
|
330
303
|
FieldsOnCorrectTypeRule,
|
|
331
304
|
FragmentsOnCompositeTypesRule,
|
|
@@ -352,7 +325,6 @@ export {
|
|
|
352
325
|
ValuesOfCorrectTypeRule,
|
|
353
326
|
VariablesAreInputTypesRule,
|
|
354
327
|
VariablesInAllowedPositionRule,
|
|
355
|
-
/** SDL-specific validation rules */
|
|
356
328
|
LoneSchemaDefinitionRule,
|
|
357
329
|
UniqueOperationTypesRule,
|
|
358
330
|
UniqueTypeNamesRule,
|
|
@@ -361,12 +333,10 @@ export {
|
|
|
361
333
|
UniqueArgumentDefinitionNamesRule,
|
|
362
334
|
UniqueDirectiveNamesRule,
|
|
363
335
|
PossibleTypeExtensionsRule,
|
|
364
|
-
/** Custom validation rules */
|
|
365
336
|
NoDeprecatedCustomRule,
|
|
366
337
|
NoSchemaIntrospectionCustomRule,
|
|
367
338
|
} from './validation/index';
|
|
368
339
|
export type { ValidationRule } from './validation/index';
|
|
369
|
-
/** Create, format, and print GraphQL errors. */
|
|
370
340
|
export {
|
|
371
341
|
GraphQLError,
|
|
372
342
|
syntaxError,
|
|
@@ -378,63 +348,34 @@ export type {
|
|
|
378
348
|
GraphQLFormattedError,
|
|
379
349
|
GraphQLErrorExtensions,
|
|
380
350
|
} from './error/index';
|
|
381
|
-
/** Utilities for operating on GraphQL type schema and parsed sources. */
|
|
382
351
|
export {
|
|
383
|
-
/**
|
|
384
|
-
* Produce the GraphQL query recommended for a full schema introspection.
|
|
385
|
-
* Accepts optional IntrospectionOptions.
|
|
386
|
-
*/
|
|
387
352
|
getIntrospectionQuery,
|
|
388
|
-
/** Gets the target Operation from a Document. */
|
|
389
353
|
getOperationAST,
|
|
390
|
-
/** Gets the Type for the target Operation AST. */
|
|
391
354
|
getOperationRootType,
|
|
392
|
-
/** Convert a GraphQLSchema to an IntrospectionQuery. */
|
|
393
355
|
introspectionFromSchema,
|
|
394
|
-
/** Build a GraphQLSchema from an introspection result. */
|
|
395
356
|
buildClientSchema,
|
|
396
|
-
/** Build a GraphQLSchema from a parsed GraphQL Schema language AST. */
|
|
397
357
|
buildASTSchema,
|
|
398
|
-
/** Build a GraphQLSchema from a GraphQL schema language document. */
|
|
399
358
|
buildSchema,
|
|
400
|
-
/** Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. */
|
|
401
359
|
extendSchema,
|
|
402
|
-
/** Sort a GraphQLSchema. */
|
|
403
360
|
lexicographicSortSchema,
|
|
404
|
-
/** Print a GraphQLSchema to GraphQL Schema language. */
|
|
405
361
|
printSchema,
|
|
406
|
-
/** Print a GraphQLType to GraphQL Schema language. */
|
|
407
362
|
printType,
|
|
408
|
-
/** Prints the built-in introspection schema in the Schema Language format. */
|
|
409
363
|
printIntrospectionSchema,
|
|
410
|
-
/** Create a GraphQLType from a GraphQL language AST. */
|
|
411
364
|
typeFromAST,
|
|
412
|
-
/** Create a JavaScript value from a GraphQL language AST with a Type. */
|
|
413
365
|
valueFromAST,
|
|
414
|
-
/** Create a JavaScript value from a GraphQL language AST without a Type. */
|
|
415
366
|
valueFromASTUntyped,
|
|
416
|
-
/** Create a GraphQL language AST from a JavaScript value. */
|
|
417
367
|
astFromValue,
|
|
418
|
-
/** A helper to use within recursive-descent visitors which need to be aware of the GraphQL type system. */
|
|
419
368
|
TypeInfo,
|
|
420
369
|
visitWithTypeInfo,
|
|
421
|
-
/** Coerces a JavaScript value to a GraphQL type, or produces errors. */
|
|
422
370
|
coerceInputValue,
|
|
423
|
-
/** Concatenates multiple AST together. */
|
|
424
371
|
concatAST,
|
|
425
|
-
/** Separates an AST into an AST per Operation. */
|
|
426
372
|
separateOperations,
|
|
427
|
-
/** Strips characters that are not significant to the validity or execution of a GraphQL document. */
|
|
428
373
|
stripIgnoredCharacters,
|
|
429
|
-
/** Comparators for types */
|
|
430
374
|
isEqualType,
|
|
431
375
|
isTypeSubTypeOf,
|
|
432
376
|
doTypesOverlap,
|
|
433
|
-
/** Asserts a string is a valid GraphQL name. */
|
|
434
377
|
assertValidName,
|
|
435
|
-
/** Determine if a string is a valid GraphQL name. */
|
|
436
378
|
isValidNameError,
|
|
437
|
-
/** Compares two GraphQLSchemas and detects breaking changes. */
|
|
438
379
|
BreakingChangeType,
|
|
439
380
|
DangerousChangeType,
|
|
440
381
|
findBreakingChanges,
|
package/index.js
CHANGED
|
@@ -789,6 +789,12 @@ Object.defineProperty(exports, 'getOperationRootType', {
|
|
|
789
789
|
return _index6.getOperationRootType;
|
|
790
790
|
},
|
|
791
791
|
});
|
|
792
|
+
Object.defineProperty(exports, 'getVariableValues', {
|
|
793
|
+
enumerable: true,
|
|
794
|
+
get: function () {
|
|
795
|
+
return _index3.getVariableValues;
|
|
796
|
+
},
|
|
797
|
+
});
|
|
792
798
|
Object.defineProperty(exports, 'getVisitFn', {
|
|
793
799
|
enumerable: true,
|
|
794
800
|
get: function () {
|
package/index.mjs
CHANGED
|
@@ -22,19 +22,17 @@
|
|
|
22
22
|
* import { parse } from 'graphql';
|
|
23
23
|
* import { parse } from 'graphql/language';
|
|
24
24
|
* ```
|
|
25
|
+
*
|
|
26
|
+
* @packageDocumentation
|
|
25
27
|
*/
|
|
28
|
+
// The GraphQL.js version info.
|
|
29
|
+
export { version, versionInfo } from './version.mjs'; // The primary entry point into fulfilling a GraphQL request.
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
export { version, versionInfo } from './version.mjs';
|
|
29
|
-
/** The primary entry point into fulfilling a GraphQL request. */
|
|
30
|
-
|
|
31
|
-
export { graphql, graphqlSync } from './graphql.mjs';
|
|
32
|
-
/** Create and operate on GraphQL type definitions and schema. */
|
|
31
|
+
export { graphql, graphqlSync } from './graphql.mjs'; // Create and operate on GraphQL type definitions and schema.
|
|
33
32
|
|
|
34
33
|
export {
|
|
35
34
|
resolveObjMapThunk,
|
|
36
|
-
resolveReadonlyArrayThunk,
|
|
37
|
-
/** Definitions */
|
|
35
|
+
resolveReadonlyArrayThunk, // Definitions
|
|
38
36
|
GraphQLSchema,
|
|
39
37
|
GraphQLDirective,
|
|
40
38
|
GraphQLScalarType,
|
|
@@ -44,28 +42,22 @@ export {
|
|
|
44
42
|
GraphQLEnumType,
|
|
45
43
|
GraphQLInputObjectType,
|
|
46
44
|
GraphQLList,
|
|
47
|
-
GraphQLNonNull,
|
|
48
|
-
/** Standard GraphQL Scalars */
|
|
45
|
+
GraphQLNonNull, // Standard GraphQL Scalars
|
|
49
46
|
specifiedScalarTypes,
|
|
50
47
|
GraphQLInt,
|
|
51
48
|
GraphQLFloat,
|
|
52
49
|
GraphQLString,
|
|
53
50
|
GraphQLBoolean,
|
|
54
|
-
GraphQLID,
|
|
55
|
-
/** Int boundaries constants */
|
|
51
|
+
GraphQLID, // Int boundaries constants
|
|
56
52
|
GRAPHQL_MAX_INT,
|
|
57
|
-
GRAPHQL_MIN_INT,
|
|
58
|
-
/** Built-in Directives defined by the Spec */
|
|
53
|
+
GRAPHQL_MIN_INT, // Built-in Directives defined by the Spec
|
|
59
54
|
specifiedDirectives,
|
|
60
55
|
GraphQLIncludeDirective,
|
|
61
56
|
GraphQLSkipDirective,
|
|
62
57
|
GraphQLDeprecatedDirective,
|
|
63
|
-
GraphQLSpecifiedByDirective,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/** Constant Deprecation Reason */
|
|
67
|
-
DEFAULT_DEPRECATION_REASON,
|
|
68
|
-
/** GraphQL Types for introspection. */
|
|
58
|
+
GraphQLSpecifiedByDirective, // "Enum" of Type Kinds
|
|
59
|
+
TypeKind, // Constant Deprecation Reason
|
|
60
|
+
DEFAULT_DEPRECATION_REASON, // GraphQL Types for introspection.
|
|
69
61
|
introspectionTypes,
|
|
70
62
|
__Schema,
|
|
71
63
|
__Directive,
|
|
@@ -74,12 +66,10 @@ export {
|
|
|
74
66
|
__Field,
|
|
75
67
|
__InputValue,
|
|
76
68
|
__EnumValue,
|
|
77
|
-
__TypeKind,
|
|
78
|
-
/** Meta-field definitions. */
|
|
69
|
+
__TypeKind, // Meta-field definitions.
|
|
79
70
|
SchemaMetaFieldDef,
|
|
80
71
|
TypeMetaFieldDef,
|
|
81
|
-
TypeNameMetaFieldDef,
|
|
82
|
-
/** Predicates */
|
|
72
|
+
TypeNameMetaFieldDef, // Predicates
|
|
83
73
|
isSchema,
|
|
84
74
|
isDirective,
|
|
85
75
|
isType,
|
|
@@ -103,8 +93,7 @@ export {
|
|
|
103
93
|
isRequiredInputField,
|
|
104
94
|
isSpecifiedScalarType,
|
|
105
95
|
isIntrospectionType,
|
|
106
|
-
isSpecifiedDirective,
|
|
107
|
-
/** Assertions */
|
|
96
|
+
isSpecifiedDirective, // Assertions
|
|
108
97
|
assertSchema,
|
|
109
98
|
assertDirective,
|
|
110
99
|
assertType,
|
|
@@ -123,47 +112,37 @@ export {
|
|
|
123
112
|
assertAbstractType,
|
|
124
113
|
assertWrappingType,
|
|
125
114
|
assertNullableType,
|
|
126
|
-
assertNamedType,
|
|
127
|
-
/** Un-modifiers */
|
|
115
|
+
assertNamedType, // Un-modifiers
|
|
128
116
|
getNullableType,
|
|
129
|
-
getNamedType,
|
|
130
|
-
/** Validate GraphQL schema. */
|
|
117
|
+
getNamedType, // Validate GraphQL schema.
|
|
131
118
|
validateSchema,
|
|
132
|
-
assertValidSchema,
|
|
133
|
-
/** Upholds the spec rules about naming. */
|
|
119
|
+
assertValidSchema, // Upholds the spec rules about naming.
|
|
134
120
|
assertName,
|
|
135
121
|
assertEnumValueName,
|
|
136
122
|
} from './type/index.mjs';
|
|
137
|
-
|
|
138
|
-
/** Parse and operate on GraphQL language source files. */
|
|
123
|
+
// Parse and operate on GraphQL language source files.
|
|
139
124
|
export {
|
|
140
125
|
Token,
|
|
141
126
|
Source,
|
|
142
127
|
Location,
|
|
143
128
|
OperationTypeNode,
|
|
144
|
-
getLocation,
|
|
145
|
-
/** Print source location */
|
|
129
|
+
getLocation, // Print source location.
|
|
146
130
|
printLocation,
|
|
147
|
-
printSourceLocation,
|
|
148
|
-
/** Lex */
|
|
131
|
+
printSourceLocation, // Lex
|
|
149
132
|
Lexer,
|
|
150
|
-
TokenKind,
|
|
151
|
-
/** Parse */
|
|
133
|
+
TokenKind, // Parse
|
|
152
134
|
parse,
|
|
153
135
|
parseValue,
|
|
154
136
|
parseConstValue,
|
|
155
|
-
parseType,
|
|
156
|
-
|
|
157
|
-
print,
|
|
158
|
-
/** Visit */
|
|
137
|
+
parseType, // Print
|
|
138
|
+
print, // Visit
|
|
159
139
|
visit,
|
|
160
140
|
visitInParallel,
|
|
161
141
|
getVisitFn,
|
|
162
142
|
getEnterLeaveForKind,
|
|
163
143
|
BREAK,
|
|
164
144
|
Kind,
|
|
165
|
-
DirectiveLocation,
|
|
166
|
-
/** Predicates */
|
|
145
|
+
DirectiveLocation, // Predicates
|
|
167
146
|
isDefinitionNode,
|
|
168
147
|
isExecutableDefinitionNode,
|
|
169
148
|
isSelectionNode,
|
|
@@ -175,26 +154,23 @@ export {
|
|
|
175
154
|
isTypeSystemExtensionNode,
|
|
176
155
|
isTypeExtensionNode,
|
|
177
156
|
} from './language/index.mjs';
|
|
178
|
-
|
|
179
|
-
/** Execute GraphQL queries. */
|
|
157
|
+
// Execute GraphQL queries.
|
|
180
158
|
export {
|
|
181
159
|
execute,
|
|
182
160
|
executeSync,
|
|
183
161
|
defaultFieldResolver,
|
|
184
162
|
defaultTypeResolver,
|
|
185
163
|
responsePathAsArray,
|
|
164
|
+
getVariableValues,
|
|
186
165
|
getDirectiveValues,
|
|
187
166
|
subscribe,
|
|
188
167
|
createSourceEventStream,
|
|
189
168
|
} from './execution/index.mjs';
|
|
190
|
-
|
|
191
|
-
/** Validate GraphQL documents. */
|
|
169
|
+
// Validate GraphQL documents.
|
|
192
170
|
export {
|
|
193
171
|
validate,
|
|
194
|
-
ValidationContext,
|
|
195
|
-
|
|
196
|
-
specifiedRules,
|
|
197
|
-
/** Individual validation rules. */
|
|
172
|
+
ValidationContext, // All validation rules in the GraphQL Specification.
|
|
173
|
+
specifiedRules, // Individual validation rules.
|
|
198
174
|
ExecutableDefinitionsRule,
|
|
199
175
|
FieldsOnCorrectTypeRule,
|
|
200
176
|
FragmentsOnCompositeTypesRule,
|
|
@@ -220,8 +196,7 @@ export {
|
|
|
220
196
|
UniqueVariableNamesRule,
|
|
221
197
|
ValuesOfCorrectTypeRule,
|
|
222
198
|
VariablesAreInputTypesRule,
|
|
223
|
-
VariablesInAllowedPositionRule,
|
|
224
|
-
/** SDL-specific validation rules */
|
|
199
|
+
VariablesInAllowedPositionRule, // SDL-specific validation rules
|
|
225
200
|
LoneSchemaDefinitionRule,
|
|
226
201
|
UniqueOperationTypesRule,
|
|
227
202
|
UniqueTypeNamesRule,
|
|
@@ -229,13 +204,11 @@ export {
|
|
|
229
204
|
UniqueFieldDefinitionNamesRule,
|
|
230
205
|
UniqueArgumentDefinitionNamesRule,
|
|
231
206
|
UniqueDirectiveNamesRule,
|
|
232
|
-
PossibleTypeExtensionsRule,
|
|
233
|
-
/** Custom validation rules */
|
|
207
|
+
PossibleTypeExtensionsRule, // Custom validation rules
|
|
234
208
|
NoDeprecatedCustomRule,
|
|
235
209
|
NoSchemaIntrospectionCustomRule,
|
|
236
210
|
} from './validation/index.mjs';
|
|
237
|
-
|
|
238
|
-
/** Create, format, and print GraphQL errors. */
|
|
211
|
+
// Create, format, and print GraphQL errors.
|
|
239
212
|
export {
|
|
240
213
|
GraphQLError,
|
|
241
214
|
syntaxError,
|
|
@@ -243,64 +216,37 @@ export {
|
|
|
243
216
|
printError,
|
|
244
217
|
formatError,
|
|
245
218
|
} from './error/index.mjs';
|
|
246
|
-
|
|
247
|
-
/** Utilities for operating on GraphQL type schema and parsed sources. */
|
|
219
|
+
// Utilities for operating on GraphQL type schema and parsed sources.
|
|
248
220
|
export {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
extendSchema,
|
|
268
|
-
/** Sort a GraphQLSchema. */
|
|
269
|
-
lexicographicSortSchema,
|
|
270
|
-
/** Print a GraphQLSchema to GraphQL Schema language. */
|
|
271
|
-
printSchema,
|
|
272
|
-
/** Print a GraphQLType to GraphQL Schema language. */
|
|
273
|
-
printType,
|
|
274
|
-
/** Prints the built-in introspection schema in the Schema Language format. */
|
|
275
|
-
printIntrospectionSchema,
|
|
276
|
-
/** Create a GraphQLType from a GraphQL language AST. */
|
|
277
|
-
typeFromAST,
|
|
278
|
-
/** Create a JavaScript value from a GraphQL language AST with a Type. */
|
|
279
|
-
valueFromAST,
|
|
280
|
-
/** Create a JavaScript value from a GraphQL language AST without a Type. */
|
|
281
|
-
valueFromASTUntyped,
|
|
282
|
-
/** Create a GraphQL language AST from a JavaScript value. */
|
|
283
|
-
astFromValue,
|
|
284
|
-
/** A helper to use within recursive-descent visitors which need to be aware of the GraphQL type system. */
|
|
221
|
+
// Produce the GraphQL query recommended for a full schema introspection.
|
|
222
|
+
// Accepts optional IntrospectionOptions.
|
|
223
|
+
getIntrospectionQuery, // Gets the target Operation from a Document.
|
|
224
|
+
getOperationAST, // Gets the Type for the target Operation AST.
|
|
225
|
+
getOperationRootType, // Convert a GraphQLSchema to an IntrospectionQuery.
|
|
226
|
+
introspectionFromSchema, // Build a GraphQLSchema from an introspection result.
|
|
227
|
+
buildClientSchema, // Build a GraphQLSchema from a parsed GraphQL Schema language AST.
|
|
228
|
+
buildASTSchema, // Build a GraphQLSchema from a GraphQL schema language document.
|
|
229
|
+
buildSchema, // Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST.
|
|
230
|
+
extendSchema, // Sort a GraphQLSchema.
|
|
231
|
+
lexicographicSortSchema, // Print a GraphQLSchema to GraphQL Schema language.
|
|
232
|
+
printSchema, // Print a GraphQLType to GraphQL Schema language.
|
|
233
|
+
printType, // Prints the built-in introspection schema in the Schema Language format.
|
|
234
|
+
printIntrospectionSchema, // Create a GraphQLType from a GraphQL language AST.
|
|
235
|
+
typeFromAST, // Create a JavaScript value from a GraphQL language AST with a Type.
|
|
236
|
+
valueFromAST, // Create a JavaScript value from a GraphQL language AST without a Type.
|
|
237
|
+
valueFromASTUntyped, // Create a GraphQL language AST from a JavaScript value.
|
|
238
|
+
astFromValue, // A helper to use within recursive-descent visitors which need to be aware of the GraphQL type system.
|
|
285
239
|
TypeInfo,
|
|
286
|
-
visitWithTypeInfo,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
/** Separates an AST into an AST per Operation. */
|
|
292
|
-
separateOperations,
|
|
293
|
-
/** Strips characters that are not significant to the validity or execution of a GraphQL document. */
|
|
294
|
-
stripIgnoredCharacters,
|
|
295
|
-
/** Comparators for types */
|
|
240
|
+
visitWithTypeInfo, // Coerces a JavaScript value to a GraphQL type, or produces errors.
|
|
241
|
+
coerceInputValue, // Concatenates multiple AST together.
|
|
242
|
+
concatAST, // Separates an AST into an AST per Operation.
|
|
243
|
+
separateOperations, // Strips characters that are not significant to the validity or execution of a GraphQL document.
|
|
244
|
+
stripIgnoredCharacters, // Comparators for types
|
|
296
245
|
isEqualType,
|
|
297
246
|
isTypeSubTypeOf,
|
|
298
|
-
doTypesOverlap,
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
/** Determine if a string is a valid GraphQL name. */
|
|
302
|
-
isValidNameError,
|
|
303
|
-
/** Compares two GraphQLSchemas and detects breaking changes. */
|
|
247
|
+
doTypesOverlap, // Asserts a string is a valid GraphQL name.
|
|
248
|
+
assertValidName, // Determine if a string is a valid GraphQL name.
|
|
249
|
+
isValidNameError, // Compares two GraphQLSchemas and detects breaking changes.
|
|
304
250
|
BreakingChangeType,
|
|
305
251
|
DangerousChangeType,
|
|
306
252
|
findBreakingChanges,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isPromise } from './isPromise.mjs';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Similar to Array.prototype.reduce(), however the reducing callback may return
|
|
4
5
|
* a Promise, in which case reduction will continue after each promise resolves.
|
|
@@ -6,7 +7,6 @@ import { isPromise } from './isPromise.mjs';
|
|
|
6
7
|
* If the callback does not return a Promise, then this function will also not
|
|
7
8
|
* return a Promise.
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
10
|
export function promiseReduce(values, callbackFn, initialValue) {
|
|
11
11
|
let accumulator = initialValue;
|
|
12
12
|
|
package/language/index.d.ts
CHANGED
package/language/lexer.d.ts
CHANGED
package/language/lexer.js
CHANGED
|
@@ -10,12 +10,12 @@ var _syntaxError = require('../error/syntaxError.js');
|
|
|
10
10
|
|
|
11
11
|
var _ast = require('./ast.js');
|
|
12
12
|
|
|
13
|
-
var _tokenKind = require('./tokenKind.js');
|
|
14
|
-
|
|
15
13
|
var _blockString = require('./blockString.js');
|
|
16
14
|
|
|
17
15
|
var _characterClasses = require('./characterClasses.js');
|
|
18
16
|
|
|
17
|
+
var _tokenKind = require('./tokenKind.js');
|
|
18
|
+
|
|
19
19
|
/**
|
|
20
20
|
* Given a Source object, creates a Lexer for that source.
|
|
21
21
|
* A Lexer is a stateful stream generator in that every time
|
package/language/lexer.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { syntaxError } from '../error/syntaxError.mjs';
|
|
2
2
|
import { Token } from './ast.mjs';
|
|
3
|
-
import { TokenKind } from './tokenKind.mjs';
|
|
4
3
|
import { dedentBlockStringLines } from './blockString.mjs';
|
|
5
|
-
import { isDigit,
|
|
4
|
+
import { isDigit, isNameContinue, isNameStart } from './characterClasses.mjs';
|
|
5
|
+
import { TokenKind } from './tokenKind.mjs';
|
|
6
6
|
/**
|
|
7
7
|
* Given a Source object, creates a Lexer for that source.
|
|
8
8
|
* A Lexer is a stateful stream generator in that every time
|