graphql 16.2.0 → 16.3.0
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 +1 -1
- 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/error/GraphQLError.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Maybe } from '../jsutils/Maybe';
|
|
2
2
|
import type { ASTNode } from '../language/ast';
|
|
3
|
-
import type { Source } from '../language/source';
|
|
4
3
|
import type { SourceLocation } from '../language/location';
|
|
4
|
+
import type { Source } from '../language/source';
|
|
5
5
|
/**
|
|
6
6
|
* Custom extensions
|
|
7
7
|
*
|
|
@@ -14,6 +14,18 @@ import type { SourceLocation } from '../language/location';
|
|
|
14
14
|
export interface GraphQLErrorExtensions {
|
|
15
15
|
[attributeName: string]: unknown;
|
|
16
16
|
}
|
|
17
|
+
export interface GraphQLErrorArgs {
|
|
18
|
+
nodes?: ReadonlyArray<ASTNode> | ASTNode | null;
|
|
19
|
+
source?: Maybe<Source>;
|
|
20
|
+
positions?: Maybe<ReadonlyArray<number>>;
|
|
21
|
+
path?: Maybe<ReadonlyArray<string | number>>;
|
|
22
|
+
originalError?: Maybe<
|
|
23
|
+
Error & {
|
|
24
|
+
readonly extensions?: unknown;
|
|
25
|
+
}
|
|
26
|
+
>;
|
|
27
|
+
extensions?: Maybe<GraphQLErrorExtensions>;
|
|
28
|
+
}
|
|
17
29
|
/**
|
|
18
30
|
* A GraphQLError describes an Error found during the parse, validate, or
|
|
19
31
|
* execute phases of performing a GraphQL operation. In addition to a message
|
|
@@ -63,6 +75,9 @@ export declare class GraphQLError extends Error {
|
|
|
63
75
|
* Extension fields to add to the formatted error.
|
|
64
76
|
*/
|
|
65
77
|
readonly extensions: GraphQLErrorExtensions;
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated Please use the `GraphQLErrorArgs` constructor overload instead.
|
|
80
|
+
*/
|
|
66
81
|
constructor(
|
|
67
82
|
message: string,
|
|
68
83
|
nodes?: ReadonlyArray<ASTNode> | ASTNode | null,
|
|
@@ -76,6 +91,7 @@ export declare class GraphQLError extends Error {
|
|
|
76
91
|
>,
|
|
77
92
|
extensions?: Maybe<GraphQLErrorExtensions>,
|
|
78
93
|
);
|
|
94
|
+
constructor(message: string, args?: GraphQLErrorArgs);
|
|
79
95
|
get [Symbol.toStringTag](): string;
|
|
80
96
|
toString(): string;
|
|
81
97
|
toJSON(): GraphQLFormattedError;
|
package/error/GraphQLError.js
CHANGED
|
@@ -13,12 +13,29 @@ var _location = require('../language/location.js');
|
|
|
13
13
|
|
|
14
14
|
var _printLocation = require('../language/printLocation.js');
|
|
15
15
|
|
|
16
|
+
function toNormalizedArgs(args) {
|
|
17
|
+
const firstArg = args[0];
|
|
18
|
+
|
|
19
|
+
if (firstArg == null || 'kind' in firstArg || 'length' in firstArg) {
|
|
20
|
+
return {
|
|
21
|
+
nodes: firstArg,
|
|
22
|
+
source: args[1],
|
|
23
|
+
positions: args[2],
|
|
24
|
+
path: args[3],
|
|
25
|
+
originalError: args[4],
|
|
26
|
+
extensions: args[5],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return firstArg;
|
|
31
|
+
}
|
|
16
32
|
/**
|
|
17
33
|
* A GraphQLError describes an Error found during the parse, validate, or
|
|
18
34
|
* execute phases of performing a GraphQL operation. In addition to a message
|
|
19
35
|
* and stack trace, it also includes information about the locations in a
|
|
20
36
|
* GraphQL document and/or execution result that correspond to the Error.
|
|
21
37
|
*/
|
|
38
|
+
|
|
22
39
|
class GraphQLError extends Error {
|
|
23
40
|
/**
|
|
24
41
|
* An array of `{ line, column }` locations within the source GraphQL document
|
|
@@ -61,17 +78,15 @@ class GraphQLError extends Error {
|
|
|
61
78
|
/**
|
|
62
79
|
* Extension fields to add to the formatted error.
|
|
63
80
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
path,
|
|
70
|
-
originalError,
|
|
71
|
-
extensions,
|
|
72
|
-
) {
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @deprecated Please use the `GraphQLErrorArgs` constructor overload instead.
|
|
84
|
+
*/
|
|
85
|
+
constructor(message, ...rawArgs) {
|
|
73
86
|
var _this$nodes, _nodeLocations$, _ref;
|
|
74
87
|
|
|
88
|
+
const { nodes, source, positions, path, originalError, extensions } =
|
|
89
|
+
toNormalizedArgs(rawArgs);
|
|
75
90
|
super(message);
|
|
76
91
|
this.name = 'GraphQLError';
|
|
77
92
|
this.path = path !== null && path !== void 0 ? path : undefined;
|
package/error/GraphQLError.mjs
CHANGED
|
@@ -4,22 +4,30 @@ import {
|
|
|
4
4
|
printLocation,
|
|
5
5
|
printSourceLocation,
|
|
6
6
|
} from '../language/printLocation.mjs';
|
|
7
|
-
/**
|
|
8
|
-
* Custom extensions
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* Use a unique identifier name for your extension, for example the name of
|
|
12
|
-
* your library or project. Do not use a shortened identifier as this increases
|
|
13
|
-
* the risk of conflicts. We recommend you add at most one extension field,
|
|
14
|
-
* an object which can contain all the values you need.
|
|
15
|
-
*/
|
|
16
7
|
|
|
8
|
+
function toNormalizedArgs(args) {
|
|
9
|
+
const firstArg = args[0];
|
|
10
|
+
|
|
11
|
+
if (firstArg == null || 'kind' in firstArg || 'length' in firstArg) {
|
|
12
|
+
return {
|
|
13
|
+
nodes: firstArg,
|
|
14
|
+
source: args[1],
|
|
15
|
+
positions: args[2],
|
|
16
|
+
path: args[3],
|
|
17
|
+
originalError: args[4],
|
|
18
|
+
extensions: args[5],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return firstArg;
|
|
23
|
+
}
|
|
17
24
|
/**
|
|
18
25
|
* A GraphQLError describes an Error found during the parse, validate, or
|
|
19
26
|
* execute phases of performing a GraphQL operation. In addition to a message
|
|
20
27
|
* and stack trace, it also includes information about the locations in a
|
|
21
28
|
* GraphQL document and/or execution result that correspond to the Error.
|
|
22
29
|
*/
|
|
30
|
+
|
|
23
31
|
export class GraphQLError extends Error {
|
|
24
32
|
/**
|
|
25
33
|
* An array of `{ line, column }` locations within the source GraphQL document
|
|
@@ -62,17 +70,15 @@ export class GraphQLError extends Error {
|
|
|
62
70
|
/**
|
|
63
71
|
* Extension fields to add to the formatted error.
|
|
64
72
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
path,
|
|
71
|
-
originalError,
|
|
72
|
-
extensions,
|
|
73
|
-
) {
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated Please use the `GraphQLErrorArgs` constructor overload instead.
|
|
76
|
+
*/
|
|
77
|
+
constructor(message, ...rawArgs) {
|
|
74
78
|
var _this$nodes, _nodeLocations$, _ref;
|
|
75
79
|
|
|
80
|
+
const { nodes, source, positions, path, originalError, extensions } =
|
|
81
|
+
toNormalizedArgs(rawArgs);
|
|
76
82
|
super(message);
|
|
77
83
|
this.name = 'GraphQLError';
|
|
78
84
|
this.path = path !== null && path !== void 0 ? path : undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ObjMap } from '../jsutils/ObjMap';
|
|
2
2
|
import type {
|
|
3
|
-
SelectionSetNode,
|
|
4
3
|
FieldNode,
|
|
5
4
|
FragmentDefinitionNode,
|
|
5
|
+
SelectionSetNode,
|
|
6
6
|
} from '../language/ast';
|
|
7
|
-
import type { GraphQLSchema } from '../type/schema';
|
|
8
7
|
import type { GraphQLObjectType } from '../type/definition';
|
|
8
|
+
import type { GraphQLSchema } from '../type/schema';
|
|
9
9
|
/**
|
|
10
10
|
* Given a selectionSet, collects all of the fields and returns them.
|
|
11
11
|
*
|
|
@@ -8,10 +8,10 @@ exports.collectSubfields = collectSubfields;
|
|
|
8
8
|
|
|
9
9
|
var _kinds = require('../language/kinds.js');
|
|
10
10
|
|
|
11
|
-
var _directives = require('../type/directives.js');
|
|
12
|
-
|
|
13
11
|
var _definition = require('../type/definition.js');
|
|
14
12
|
|
|
13
|
+
var _directives = require('../type/directives.js');
|
|
14
|
+
|
|
15
15
|
var _typeFromAST = require('../utilities/typeFromAST.js');
|
|
16
16
|
|
|
17
17
|
var _values = require('./values.js');
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Kind } from '../language/kinds.mjs';
|
|
2
|
+
import { isAbstractType } from '../type/definition.mjs';
|
|
2
3
|
import {
|
|
3
4
|
GraphQLIncludeDirective,
|
|
4
5
|
GraphQLSkipDirective,
|
|
5
6
|
} from '../type/directives.mjs';
|
|
6
|
-
import { isAbstractType } from '../type/definition.mjs';
|
|
7
7
|
import { typeFromAST } from '../utilities/typeFromAST.mjs';
|
|
8
8
|
import { getDirectiveValues } from './values.mjs';
|
|
9
9
|
/**
|
package/execution/execute.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Maybe } from '../jsutils/Maybe';
|
|
2
2
|
import type { ObjMap } from '../jsutils/ObjMap';
|
|
3
|
+
import type { Path } from '../jsutils/Path';
|
|
3
4
|
import type { PromiseOrValue } from '../jsutils/PromiseOrValue';
|
|
4
|
-
import type { Maybe } from '../jsutils/Maybe';
|
|
5
5
|
import type { GraphQLFormattedError } from '../error/GraphQLError';
|
|
6
6
|
import { GraphQLError } from '../error/GraphQLError';
|
|
7
7
|
import type {
|
|
8
8
|
DocumentNode,
|
|
9
|
-
OperationDefinitionNode,
|
|
10
9
|
FieldNode,
|
|
11
10
|
FragmentDefinitionNode,
|
|
11
|
+
OperationDefinitionNode,
|
|
12
12
|
} from '../language/ast';
|
|
13
|
-
import type { GraphQLSchema } from '../type/schema';
|
|
14
13
|
import type {
|
|
15
|
-
GraphQLObjectType,
|
|
16
14
|
GraphQLField,
|
|
17
15
|
GraphQLFieldResolver,
|
|
16
|
+
GraphQLObjectType,
|
|
18
17
|
GraphQLResolveInfo,
|
|
19
18
|
GraphQLTypeResolver,
|
|
20
19
|
} from '../type/definition';
|
|
20
|
+
import type { GraphQLSchema } from '../type/schema';
|
|
21
21
|
/**
|
|
22
22
|
* Terminology
|
|
23
23
|
*
|
package/execution/execute.js
CHANGED
|
@@ -11,25 +11,25 @@ exports.execute = execute;
|
|
|
11
11
|
exports.executeSync = executeSync;
|
|
12
12
|
exports.getFieldDef = getFieldDef;
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _devAssert = require('../jsutils/devAssert.js');
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _inspect = require('../jsutils/inspect.js');
|
|
17
17
|
|
|
18
18
|
var _invariant = require('../jsutils/invariant.js');
|
|
19
19
|
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
var _isPromise = require('../jsutils/isPromise.js');
|
|
20
|
+
var _isIterableObject = require('../jsutils/isIterableObject.js');
|
|
23
21
|
|
|
24
22
|
var _isObjectLike = require('../jsutils/isObjectLike.js');
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
var _isPromise = require('../jsutils/isPromise.js');
|
|
27
25
|
|
|
28
|
-
var
|
|
26
|
+
var _memoize = require('../jsutils/memoize3.js');
|
|
29
27
|
|
|
30
28
|
var _Path = require('../jsutils/Path.js');
|
|
31
29
|
|
|
32
|
-
var
|
|
30
|
+
var _promiseForObject = require('../jsutils/promiseForObject.js');
|
|
31
|
+
|
|
32
|
+
var _promiseReduce = require('../jsutils/promiseReduce.js');
|
|
33
33
|
|
|
34
34
|
var _GraphQLError = require('../error/GraphQLError.js');
|
|
35
35
|
|
|
@@ -39,16 +39,16 @@ var _ast = require('../language/ast.js');
|
|
|
39
39
|
|
|
40
40
|
var _kinds = require('../language/kinds.js');
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _definition = require('../type/definition.js');
|
|
43
43
|
|
|
44
44
|
var _introspection = require('../type/introspection.js');
|
|
45
45
|
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
var _values = require('./values.js');
|
|
46
|
+
var _validate = require('../type/validate.js');
|
|
49
47
|
|
|
50
48
|
var _collectFields = require('./collectFields.js');
|
|
51
49
|
|
|
50
|
+
var _values = require('./values.js');
|
|
51
|
+
|
|
52
52
|
/**
|
|
53
53
|
* A memoized collection of relevant subfields with regard to the return
|
|
54
54
|
* type. Memoizing ensures the subfields are not repeatedly calculated, which
|
package/execution/execute.mjs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
+
import { devAssert } from '../jsutils/devAssert.mjs';
|
|
1
2
|
import { inspect } from '../jsutils/inspect.mjs';
|
|
2
|
-
import { memoize3 } from '../jsutils/memoize3.mjs';
|
|
3
3
|
import { invariant } from '../jsutils/invariant.mjs';
|
|
4
|
-
import {
|
|
5
|
-
import { isPromise } from '../jsutils/isPromise.mjs';
|
|
4
|
+
import { isIterableObject } from '../jsutils/isIterableObject.mjs';
|
|
6
5
|
import { isObjectLike } from '../jsutils/isObjectLike.mjs';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { isPromise } from '../jsutils/isPromise.mjs';
|
|
7
|
+
import { memoize3 } from '../jsutils/memoize3.mjs';
|
|
9
8
|
import { addPath, pathToArray } from '../jsutils/Path.mjs';
|
|
10
|
-
import {
|
|
9
|
+
import { promiseForObject } from '../jsutils/promiseForObject.mjs';
|
|
10
|
+
import { promiseReduce } from '../jsutils/promiseReduce.mjs';
|
|
11
11
|
import { GraphQLError } from '../error/GraphQLError.mjs';
|
|
12
12
|
import { locatedError } from '../error/locatedError.mjs';
|
|
13
13
|
import { OperationTypeNode } from '../language/ast.mjs';
|
|
14
14
|
import { Kind } from '../language/kinds.mjs';
|
|
15
|
-
import { assertValidSchema } from '../type/validate.mjs';
|
|
16
15
|
import {
|
|
17
|
-
SchemaMetaFieldDef,
|
|
18
|
-
TypeMetaFieldDef,
|
|
19
|
-
TypeNameMetaFieldDef,
|
|
20
|
-
} from '../type/introspection.mjs';
|
|
21
|
-
import {
|
|
22
|
-
isObjectType,
|
|
23
16
|
isAbstractType,
|
|
24
17
|
isLeafType,
|
|
25
18
|
isListType,
|
|
26
19
|
isNonNullType,
|
|
20
|
+
isObjectType,
|
|
27
21
|
} from '../type/definition.mjs';
|
|
28
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
SchemaMetaFieldDef,
|
|
24
|
+
TypeMetaFieldDef,
|
|
25
|
+
TypeNameMetaFieldDef,
|
|
26
|
+
} from '../type/introspection.mjs';
|
|
27
|
+
import { assertValidSchema } from '../type/validate.mjs';
|
|
29
28
|
import {
|
|
30
29
|
collectFields,
|
|
31
30
|
collectSubfields as _collectSubfields,
|
|
32
31
|
} from './collectFields.mjs';
|
|
32
|
+
import { getArgumentValues, getVariableValues } from './values.mjs';
|
|
33
33
|
/**
|
|
34
34
|
* A memoized collection of relevant subfields with regard to the return
|
|
35
35
|
* type. Memoizing ensures the subfields are not repeatedly calculated, which
|
package/execution/index.d.ts
CHANGED
package/execution/index.js
CHANGED
|
@@ -39,6 +39,12 @@ Object.defineProperty(exports, 'getDirectiveValues', {
|
|
|
39
39
|
return _values.getDirectiveValues;
|
|
40
40
|
},
|
|
41
41
|
});
|
|
42
|
+
Object.defineProperty(exports, 'getVariableValues', {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _values.getVariableValues;
|
|
46
|
+
},
|
|
47
|
+
});
|
|
42
48
|
Object.defineProperty(exports, 'responsePathAsArray', {
|
|
43
49
|
enumerable: true,
|
|
44
50
|
get: function () {
|
package/execution/index.mjs
CHANGED
package/execution/subscribe.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Maybe } from '../jsutils/Maybe';
|
|
2
2
|
import type { DocumentNode } from '../language/ast';
|
|
3
|
-
import type { GraphQLSchema } from '../type/schema';
|
|
4
3
|
import type { GraphQLFieldResolver } from '../type/definition';
|
|
4
|
+
import type { GraphQLSchema } from '../type/schema';
|
|
5
5
|
import type { ExecutionArgs, ExecutionResult } from './execute';
|
|
6
6
|
/**
|
|
7
7
|
* Implements the "Subscribe" algorithm described in the GraphQL specification.
|
package/execution/subscribe.js
CHANGED
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
6
6
|
exports.createSourceEventStream = createSourceEventStream;
|
|
7
7
|
exports.subscribe = subscribe;
|
|
8
8
|
|
|
9
|
-
var _inspect = require('../jsutils/inspect.js');
|
|
10
|
-
|
|
11
9
|
var _devAssert = require('../jsutils/devAssert.js');
|
|
12
10
|
|
|
11
|
+
var _inspect = require('../jsutils/inspect.js');
|
|
12
|
+
|
|
13
13
|
var _isAsyncIterable = require('../jsutils/isAsyncIterable.js');
|
|
14
14
|
|
|
15
15
|
var _Path = require('../jsutils/Path.js');
|
|
@@ -20,12 +20,12 @@ var _locatedError = require('../error/locatedError.js');
|
|
|
20
20
|
|
|
21
21
|
var _collectFields = require('./collectFields.js');
|
|
22
22
|
|
|
23
|
-
var _values = require('./values.js');
|
|
24
|
-
|
|
25
23
|
var _execute = require('./execute.js');
|
|
26
24
|
|
|
27
25
|
var _mapAsyncIterator = require('./mapAsyncIterator.js');
|
|
28
26
|
|
|
27
|
+
var _values = require('./values.js');
|
|
28
|
+
|
|
29
29
|
/**
|
|
30
30
|
* Implements the "Subscribe" algorithm described in the GraphQL specification.
|
|
31
31
|
*
|
package/execution/subscribe.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { inspect } from '../jsutils/inspect.mjs';
|
|
2
1
|
import { devAssert } from '../jsutils/devAssert.mjs';
|
|
2
|
+
import { inspect } from '../jsutils/inspect.mjs';
|
|
3
3
|
import { isAsyncIterable } from '../jsutils/isAsyncIterable.mjs';
|
|
4
4
|
import { addPath, pathToArray } from '../jsutils/Path.mjs';
|
|
5
5
|
import { GraphQLError } from '../error/GraphQLError.mjs';
|
|
6
6
|
import { locatedError } from '../error/locatedError.mjs';
|
|
7
7
|
import { collectFields } from './collectFields.mjs';
|
|
8
|
-
import { getArgumentValues } from './values.mjs';
|
|
9
8
|
import {
|
|
10
9
|
assertValidExecutionArguments,
|
|
11
10
|
buildExecutionContext,
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
getFieldDef,
|
|
15
14
|
} from './execute.mjs';
|
|
16
15
|
import { mapAsyncIterator } from './mapAsyncIterator.mjs';
|
|
16
|
+
import { getArgumentValues } from './values.mjs';
|
|
17
17
|
/**
|
|
18
18
|
* Implements the "Subscribe" algorithm described in the GraphQL specification.
|
|
19
19
|
*
|
package/execution/values.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { ObjMap } from '../jsutils/ObjMap';
|
|
2
1
|
import type { Maybe } from '../jsutils/Maybe';
|
|
2
|
+
import type { ObjMap } from '../jsutils/ObjMap';
|
|
3
3
|
import { GraphQLError } from '../error/GraphQLError';
|
|
4
4
|
import type {
|
|
5
|
-
FieldNode,
|
|
6
5
|
DirectiveNode,
|
|
6
|
+
FieldNode,
|
|
7
7
|
VariableDefinitionNode,
|
|
8
8
|
} from '../language/ast';
|
|
9
|
-
import type { GraphQLSchema } from '../type/schema';
|
|
10
9
|
import type { GraphQLField } from '../type/definition';
|
|
11
10
|
import type { GraphQLDirective } from '../type/directives';
|
|
11
|
+
import type { GraphQLSchema } from '../type/schema';
|
|
12
12
|
declare type CoercedVariableValues =
|
|
13
13
|
| {
|
|
14
14
|
errors: ReadonlyArray<GraphQLError>;
|
|
@@ -28,8 +28,6 @@ declare type CoercedVariableValues =
|
|
|
28
28
|
* Note: The returned value is a plain Object with a prototype, since it is
|
|
29
29
|
* exposed to user code. Care should be taken to not pull values from the
|
|
30
30
|
* Object prototype.
|
|
31
|
-
*
|
|
32
|
-
* @internal
|
|
33
31
|
*/
|
|
34
32
|
export declare function getVariableValues(
|
|
35
33
|
schema: GraphQLSchema,
|
package/execution/values.js
CHANGED
|
@@ -7,10 +7,10 @@ exports.getArgumentValues = getArgumentValues;
|
|
|
7
7
|
exports.getDirectiveValues = getDirectiveValues;
|
|
8
8
|
exports.getVariableValues = getVariableValues;
|
|
9
9
|
|
|
10
|
-
var _keyMap = require('../jsutils/keyMap.js');
|
|
11
|
-
|
|
12
10
|
var _inspect = require('../jsutils/inspect.js');
|
|
13
11
|
|
|
12
|
+
var _keyMap = require('../jsutils/keyMap.js');
|
|
13
|
+
|
|
14
14
|
var _printPathArray = require('../jsutils/printPathArray.js');
|
|
15
15
|
|
|
16
16
|
var _GraphQLError = require('../error/GraphQLError.js');
|
|
@@ -21,12 +21,12 @@ var _printer = require('../language/printer.js');
|
|
|
21
21
|
|
|
22
22
|
var _definition = require('../type/definition.js');
|
|
23
23
|
|
|
24
|
+
var _coerceInputValue = require('../utilities/coerceInputValue.js');
|
|
25
|
+
|
|
24
26
|
var _typeFromAST = require('../utilities/typeFromAST.js');
|
|
25
27
|
|
|
26
28
|
var _valueFromAST = require('../utilities/valueFromAST.js');
|
|
27
29
|
|
|
28
|
-
var _coerceInputValue = require('../utilities/coerceInputValue.js');
|
|
29
|
-
|
|
30
30
|
/**
|
|
31
31
|
* Prepares an object map of variableValues of the correct type based on the
|
|
32
32
|
* provided variable definitions and arbitrary input. If the input cannot be
|
|
@@ -35,8 +35,6 @@ var _coerceInputValue = require('../utilities/coerceInputValue.js');
|
|
|
35
35
|
* Note: The returned value is a plain Object with a prototype, since it is
|
|
36
36
|
* exposed to user code. Care should be taken to not pull values from the
|
|
37
37
|
* Object prototype.
|
|
38
|
-
*
|
|
39
|
-
* @internal
|
|
40
38
|
*/
|
|
41
39
|
function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
42
40
|
const errors = [];
|
package/execution/values.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { keyMap } from '../jsutils/keyMap.mjs';
|
|
2
1
|
import { inspect } from '../jsutils/inspect.mjs';
|
|
2
|
+
import { keyMap } from '../jsutils/keyMap.mjs';
|
|
3
3
|
import { printPathArray } from '../jsutils/printPathArray.mjs';
|
|
4
4
|
import { GraphQLError } from '../error/GraphQLError.mjs';
|
|
5
5
|
import { Kind } from '../language/kinds.mjs';
|
|
6
6
|
import { print } from '../language/printer.mjs';
|
|
7
7
|
import { isInputType, isNonNullType } from '../type/definition.mjs';
|
|
8
|
+
import { coerceInputValue } from '../utilities/coerceInputValue.mjs';
|
|
8
9
|
import { typeFromAST } from '../utilities/typeFromAST.mjs';
|
|
9
10
|
import { valueFromAST } from '../utilities/valueFromAST.mjs';
|
|
10
|
-
import { coerceInputValue } from '../utilities/coerceInputValue.mjs';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Prepares an object map of variableValues of the correct type based on the
|
|
@@ -17,8 +17,6 @@ import { coerceInputValue } from '../utilities/coerceInputValue.mjs';
|
|
|
17
17
|
* Note: The returned value is a plain Object with a prototype, since it is
|
|
18
18
|
* exposed to user code. Care should be taken to not pull values from the
|
|
19
19
|
* Object prototype.
|
|
20
|
-
*
|
|
21
|
-
* @internal
|
|
22
20
|
*/
|
|
23
21
|
export function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
24
22
|
const errors = [];
|
package/graphql.js
CHANGED
|
@@ -12,9 +12,9 @@ var _isPromise = require('./jsutils/isPromise.js');
|
|
|
12
12
|
|
|
13
13
|
var _parser = require('./language/parser.js');
|
|
14
14
|
|
|
15
|
-
var _validate = require('./
|
|
15
|
+
var _validate = require('./type/validate.js');
|
|
16
16
|
|
|
17
|
-
var _validate2 = require('./
|
|
17
|
+
var _validate2 = require('./validation/validate.js');
|
|
18
18
|
|
|
19
19
|
var _execute = require('./execution/execute.js');
|
|
20
20
|
|
|
@@ -57,7 +57,7 @@ function graphqlImpl(args) {
|
|
|
57
57
|
typeResolver,
|
|
58
58
|
} = args; // Validate Schema
|
|
59
59
|
|
|
60
|
-
const schemaValidationErrors = (0,
|
|
60
|
+
const schemaValidationErrors = (0, _validate.validateSchema)(schema);
|
|
61
61
|
|
|
62
62
|
if (schemaValidationErrors.length > 0) {
|
|
63
63
|
return {
|
|
@@ -75,7 +75,7 @@ function graphqlImpl(args) {
|
|
|
75
75
|
};
|
|
76
76
|
} // Validate
|
|
77
77
|
|
|
78
|
-
const validationErrors = (0,
|
|
78
|
+
const validationErrors = (0, _validate2.validate)(schema, document);
|
|
79
79
|
|
|
80
80
|
if (validationErrors.length > 0) {
|
|
81
81
|
return {
|
package/graphql.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { devAssert } from './jsutils/devAssert.mjs';
|
|
2
2
|
import { isPromise } from './jsutils/isPromise.mjs';
|
|
3
3
|
import { parse } from './language/parser.mjs';
|
|
4
|
-
import { validate } from './validation/validate.mjs';
|
|
5
4
|
import { validateSchema } from './type/validate.mjs';
|
|
5
|
+
import { validate } from './validation/validate.mjs';
|
|
6
6
|
import { execute } from './execution/execute.mjs';
|
|
7
7
|
/**
|
|
8
8
|
* This is the primary entry point function for fulfilling GraphQL operations
|