@graphitation/supermassive 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintcache +1 -1
- package/lib/ast/TypedAST.js +1 -0
- package/lib/ast/addTypesToRequestDocument.js +48 -42
- package/lib/ast/addTypesToRequestDocument.mjs +47 -42
- package/lib/benchmarks/index.js +15 -4
- package/lib/benchmarks/index.mjs +6 -3
- package/lib/benchmarks/nice-benchmark.js +1 -0
- package/lib/benchmarks/swapi-schema/index.js +14 -4
- package/lib/benchmarks/swapi-schema/index.mjs +5 -3
- package/lib/benchmarks/swapi-schema/models.js +9 -1
- package/lib/benchmarks/swapi-schema/resolvers.js +22 -7
- package/lib/benchmarks/swapi-schema/resolvers.mjs +21 -7
- package/lib/collectFields.js +41 -11
- package/lib/collectFields.mjs +40 -11
- package/lib/compiledQuery.js +1 -0
- package/lib/definition.js +13 -8
- package/lib/definition.mjs +12 -8
- package/lib/directives.js +48 -33
- package/lib/directives.mjs +47 -33
- package/lib/executeWithSchema.js +1 -0
- package/lib/executeWithoutSchema.js +231 -49
- package/lib/executeWithoutSchema.mjs +224 -46
- package/lib/extractImplicitTypesRuntime.js +4 -1
- package/lib/extractImplicitTypesRuntime.mjs +3 -1
- package/lib/index.js +1 -0
- package/lib/jsutils/Maybe.js +1 -0
- package/lib/jsutils/ObjMap.js +1 -0
- package/lib/jsutils/Path.js +1 -0
- package/lib/jsutils/PromiseOrValue.js +1 -0
- package/lib/jsutils/devAssert.js +1 -0
- package/lib/jsutils/didYouMean.js +1 -0
- package/lib/jsutils/identityFunc.js +1 -0
- package/lib/jsutils/inspect.js +4 -1
- package/lib/jsutils/inspect.mjs +3 -1
- package/lib/jsutils/instanceOf.js +18 -6
- package/lib/jsutils/instanceOf.mjs +17 -6
- package/lib/jsutils/invariant.js +4 -1
- package/lib/jsutils/invariant.mjs +3 -1
- package/lib/jsutils/isAsyncIterable.js +1 -0
- package/lib/jsutils/isIterableObject.js +1 -0
- package/lib/jsutils/isObjectLike.js +1 -0
- package/lib/jsutils/isPromise.js +1 -0
- package/lib/jsutils/keyMap.js +1 -0
- package/lib/jsutils/keyValMap.js +1 -0
- package/lib/jsutils/mapValue.js +1 -0
- package/lib/jsutils/memoize3.js +1 -0
- package/lib/jsutils/naturalCompare.js +1 -0
- package/lib/jsutils/printPathArray.js +4 -1
- package/lib/jsutils/printPathArray.mjs +3 -1
- package/lib/jsutils/promiseForObject.js +1 -0
- package/lib/jsutils/promiseReduce.js +1 -0
- package/lib/jsutils/suggestionList.js +9 -1
- package/lib/jsutils/suggestionList.mjs +8 -1
- package/lib/jsutils/toObjMap.js +1 -0
- package/lib/subscribeWithSchema.js +1 -0
- package/lib/subscribeWithoutSchema.js +45 -6
- package/lib/subscribeWithoutSchema.mjs +44 -6
- package/lib/transforms/annotateDocumentGraphQLTransform.js +1 -0
- package/lib/types.js +1 -0
- package/lib/utilities/blankGraphQLTag.js +1 -0
- package/lib/utilities/mapAsyncIterator.js +1 -0
- package/lib/utilities/mergeResolvers.js +1 -0
- package/lib/utilities/typeNameFromAST.js +1 -0
- package/lib/values.js +82 -21
- package/lib/values.mjs +81 -21
- package/package.json +1 -1
package/lib/collectFields.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -45,7 +46,15 @@ function collectFields(resolvers, fragments, variableValues, runtimeTypeName, se
|
|
|
45
46
|
if (!shouldIncludeNode(resolvers, variableValues, selection) || !doesFragmentConditionMatch(selection, runtimeTypeName, resolvers)) {
|
|
46
47
|
continue;
|
|
47
48
|
}
|
|
48
|
-
collectFields(
|
|
49
|
+
collectFields(
|
|
50
|
+
resolvers,
|
|
51
|
+
fragments,
|
|
52
|
+
variableValues,
|
|
53
|
+
runtimeTypeName,
|
|
54
|
+
selection.selectionSet,
|
|
55
|
+
fields,
|
|
56
|
+
visitedFragmentNames
|
|
57
|
+
);
|
|
49
58
|
break;
|
|
50
59
|
}
|
|
51
60
|
case import_graphql.Kind.FRAGMENT_SPREAD: {
|
|
@@ -58,7 +67,15 @@ function collectFields(resolvers, fragments, variableValues, runtimeTypeName, se
|
|
|
58
67
|
if (!fragment || !doesFragmentConditionMatch(fragment, runtimeTypeName, resolvers)) {
|
|
59
68
|
continue;
|
|
60
69
|
}
|
|
61
|
-
collectFields(
|
|
70
|
+
collectFields(
|
|
71
|
+
resolvers,
|
|
72
|
+
fragments,
|
|
73
|
+
variableValues,
|
|
74
|
+
runtimeTypeName,
|
|
75
|
+
fragment.selectionSet,
|
|
76
|
+
fields,
|
|
77
|
+
visitedFragmentNames
|
|
78
|
+
);
|
|
62
79
|
break;
|
|
63
80
|
}
|
|
64
81
|
}
|
|
@@ -70,11 +87,21 @@ function shouldIncludeNode(resolvers, variableValues, node) {
|
|
|
70
87
|
if (!((_a = node.directives) == null ? void 0 : _a.length)) {
|
|
71
88
|
return true;
|
|
72
89
|
}
|
|
73
|
-
const skip = (0, import_values.getDirectiveValues)(
|
|
90
|
+
const skip = (0, import_values.getDirectiveValues)(
|
|
91
|
+
import_directives.GraphQLSkipDirective,
|
|
92
|
+
node,
|
|
93
|
+
resolvers,
|
|
94
|
+
variableValues
|
|
95
|
+
);
|
|
74
96
|
if ((skip == null ? void 0 : skip.if) === true) {
|
|
75
97
|
return false;
|
|
76
98
|
}
|
|
77
|
-
const include = (0, import_values.getDirectiveValues)(
|
|
99
|
+
const include = (0, import_values.getDirectiveValues)(
|
|
100
|
+
import_directives.GraphQLIncludeDirective,
|
|
101
|
+
node,
|
|
102
|
+
resolvers,
|
|
103
|
+
variableValues
|
|
104
|
+
);
|
|
78
105
|
if ((include == null ? void 0 : include.if) === false) {
|
|
79
106
|
return false;
|
|
80
107
|
}
|
|
@@ -95,13 +122,16 @@ function doesFragmentConditionMatch(fragment, typeName, resolvers) {
|
|
|
95
122
|
function getSubTypes(resolvers, abstractTypes, conditionalType) {
|
|
96
123
|
const resolver = resolvers[conditionalType];
|
|
97
124
|
if ((0, import_definition.isInterfaceResolverType)(resolver)) {
|
|
98
|
-
const result = resolver.__implementedBy.reduce(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
125
|
+
const result = resolver.__implementedBy.reduce(
|
|
126
|
+
(acc, item) => {
|
|
127
|
+
if (!abstractTypes.has(item)) {
|
|
128
|
+
const newTypes = /* @__PURE__ */ new Set([...abstractTypes, item]);
|
|
129
|
+
acc.push(...abstractTypes, ...getSubTypes(resolvers, newTypes, item));
|
|
130
|
+
}
|
|
131
|
+
return acc;
|
|
132
|
+
},
|
|
133
|
+
[]
|
|
134
|
+
);
|
|
105
135
|
return /* @__PURE__ */ new Set([...result]);
|
|
106
136
|
}
|
|
107
137
|
if ((0, import_definition.isUnionResolverType)(resolver)) {
|
package/lib/collectFields.mjs
CHANGED
|
@@ -24,7 +24,15 @@ function collectFields(resolvers, fragments, variableValues, runtimeTypeName, se
|
|
|
24
24
|
if (!shouldIncludeNode(resolvers, variableValues, selection) || !doesFragmentConditionMatch(selection, runtimeTypeName, resolvers)) {
|
|
25
25
|
continue;
|
|
26
26
|
}
|
|
27
|
-
collectFields(
|
|
27
|
+
collectFields(
|
|
28
|
+
resolvers,
|
|
29
|
+
fragments,
|
|
30
|
+
variableValues,
|
|
31
|
+
runtimeTypeName,
|
|
32
|
+
selection.selectionSet,
|
|
33
|
+
fields,
|
|
34
|
+
visitedFragmentNames
|
|
35
|
+
);
|
|
28
36
|
break;
|
|
29
37
|
}
|
|
30
38
|
case Kind.FRAGMENT_SPREAD: {
|
|
@@ -37,7 +45,15 @@ function collectFields(resolvers, fragments, variableValues, runtimeTypeName, se
|
|
|
37
45
|
if (!fragment || !doesFragmentConditionMatch(fragment, runtimeTypeName, resolvers)) {
|
|
38
46
|
continue;
|
|
39
47
|
}
|
|
40
|
-
collectFields(
|
|
48
|
+
collectFields(
|
|
49
|
+
resolvers,
|
|
50
|
+
fragments,
|
|
51
|
+
variableValues,
|
|
52
|
+
runtimeTypeName,
|
|
53
|
+
fragment.selectionSet,
|
|
54
|
+
fields,
|
|
55
|
+
visitedFragmentNames
|
|
56
|
+
);
|
|
41
57
|
break;
|
|
42
58
|
}
|
|
43
59
|
}
|
|
@@ -49,11 +65,21 @@ function shouldIncludeNode(resolvers, variableValues, node) {
|
|
|
49
65
|
if (!((_a = node.directives) == null ? void 0 : _a.length)) {
|
|
50
66
|
return true;
|
|
51
67
|
}
|
|
52
|
-
const skip = getDirectiveValues(
|
|
68
|
+
const skip = getDirectiveValues(
|
|
69
|
+
GraphQLSkipDirective,
|
|
70
|
+
node,
|
|
71
|
+
resolvers,
|
|
72
|
+
variableValues
|
|
73
|
+
);
|
|
53
74
|
if ((skip == null ? void 0 : skip.if) === true) {
|
|
54
75
|
return false;
|
|
55
76
|
}
|
|
56
|
-
const include = getDirectiveValues(
|
|
77
|
+
const include = getDirectiveValues(
|
|
78
|
+
GraphQLIncludeDirective,
|
|
79
|
+
node,
|
|
80
|
+
resolvers,
|
|
81
|
+
variableValues
|
|
82
|
+
);
|
|
57
83
|
if ((include == null ? void 0 : include.if) === false) {
|
|
58
84
|
return false;
|
|
59
85
|
}
|
|
@@ -74,13 +100,16 @@ function doesFragmentConditionMatch(fragment, typeName, resolvers) {
|
|
|
74
100
|
function getSubTypes(resolvers, abstractTypes, conditionalType) {
|
|
75
101
|
const resolver = resolvers[conditionalType];
|
|
76
102
|
if (isInterfaceResolverType(resolver)) {
|
|
77
|
-
const result = resolver.__implementedBy.reduce(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
103
|
+
const result = resolver.__implementedBy.reduce(
|
|
104
|
+
(acc, item) => {
|
|
105
|
+
if (!abstractTypes.has(item)) {
|
|
106
|
+
const newTypes = /* @__PURE__ */ new Set([...abstractTypes, item]);
|
|
107
|
+
acc.push(...abstractTypes, ...getSubTypes(resolvers, newTypes, item));
|
|
108
|
+
}
|
|
109
|
+
return acc;
|
|
110
|
+
},
|
|
111
|
+
[]
|
|
112
|
+
);
|
|
84
113
|
return /* @__PURE__ */ new Set([...result]);
|
|
85
114
|
}
|
|
86
115
|
if (isUnionResolverType(resolver)) {
|
package/lib/compiledQuery.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/lib/definition.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -37,14 +38,18 @@ function defineArguments(config) {
|
|
|
37
38
|
}));
|
|
38
39
|
}
|
|
39
40
|
function argsToArgsConfig(args) {
|
|
40
|
-
return (0, import_keyValMap.keyValMap)(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
return (0, import_keyValMap.keyValMap)(
|
|
42
|
+
args,
|
|
43
|
+
(arg) => arg.name,
|
|
44
|
+
(arg) => ({
|
|
45
|
+
description: arg.description,
|
|
46
|
+
type: arg.type,
|
|
47
|
+
defaultValue: arg.defaultValue,
|
|
48
|
+
deprecationReason: arg.deprecationReason,
|
|
49
|
+
extensions: arg.extensions,
|
|
50
|
+
astNode: arg.astNode
|
|
51
|
+
})
|
|
52
|
+
);
|
|
48
53
|
}
|
|
49
54
|
function isInterfaceResolverType(resolver) {
|
|
50
55
|
return "__implementedBy" in resolver && "__resolveType" in resolver;
|
package/lib/definition.mjs
CHANGED
|
@@ -13,14 +13,18 @@ function defineArguments(config) {
|
|
|
13
13
|
}));
|
|
14
14
|
}
|
|
15
15
|
function argsToArgsConfig(args) {
|
|
16
|
-
return keyValMap(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
return keyValMap(
|
|
17
|
+
args,
|
|
18
|
+
(arg) => arg.name,
|
|
19
|
+
(arg) => ({
|
|
20
|
+
description: arg.description,
|
|
21
|
+
type: arg.type,
|
|
22
|
+
defaultValue: arg.defaultValue,
|
|
23
|
+
deprecationReason: arg.deprecationReason,
|
|
24
|
+
extensions: arg.extensions,
|
|
25
|
+
astNode: arg.astNode
|
|
26
|
+
})
|
|
27
|
+
);
|
|
24
28
|
}
|
|
25
29
|
function isInterfaceResolverType(resolver) {
|
|
26
30
|
return "__implementedBy" in resolver && "__resolveType" in resolver;
|
package/lib/directives.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -41,7 +42,9 @@ function isDirective(directive) {
|
|
|
41
42
|
}
|
|
42
43
|
function assertDirective(directive) {
|
|
43
44
|
if (!isDirective(directive)) {
|
|
44
|
-
throw new Error(
|
|
45
|
+
throw new Error(
|
|
46
|
+
`Expected ${(0, import_inspect.inspect)(directive)} to be a GraphQL directive.`
|
|
47
|
+
);
|
|
45
48
|
}
|
|
46
49
|
return directive;
|
|
47
50
|
}
|
|
@@ -55,9 +58,15 @@ class GraphQLDirective {
|
|
|
55
58
|
this.extensions = config.extensions && (0, import_toObjMap.toObjMap)(config.extensions);
|
|
56
59
|
this.astNode = config.astNode;
|
|
57
60
|
(0, import_devAssert.devAssert)(config.name, "Directive must be named.");
|
|
58
|
-
(0, import_devAssert.devAssert)(
|
|
61
|
+
(0, import_devAssert.devAssert)(
|
|
62
|
+
Array.isArray(config.locations),
|
|
63
|
+
`@${config.name} locations must be an Array.`
|
|
64
|
+
);
|
|
59
65
|
const args = (_b = config.args) != null ? _b : {};
|
|
60
|
-
(0, import_devAssert.devAssert)(
|
|
66
|
+
(0, import_devAssert.devAssert)(
|
|
67
|
+
(0, import_isObjectLike.isObjectLike)(args) && !Array.isArray(args),
|
|
68
|
+
`@${config.name} args must be an object with argument names as keys.`
|
|
69
|
+
);
|
|
61
70
|
this.args = (0, import_definition.defineArguments)(args);
|
|
62
71
|
}
|
|
63
72
|
toConfig() {
|
|
@@ -112,40 +121,46 @@ const GraphQLSkipDirective = new GraphQLDirective({
|
|
|
112
121
|
}
|
|
113
122
|
});
|
|
114
123
|
const DEFAULT_DEPRECATION_REASON = "No longer supported";
|
|
115
|
-
const GraphQLDeprecatedDirective = new GraphQLDirective(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
const GraphQLDeprecatedDirective = new GraphQLDirective(
|
|
125
|
+
{
|
|
126
|
+
name: "deprecated",
|
|
127
|
+
description: "Marks an element of a GraphQL schema as no longer supported.",
|
|
128
|
+
locations: [
|
|
129
|
+
import_graphql.DirectiveLocation.FIELD_DEFINITION,
|
|
130
|
+
import_graphql.DirectiveLocation.ARGUMENT_DEFINITION,
|
|
131
|
+
import_graphql.DirectiveLocation.INPUT_FIELD_DEFINITION,
|
|
132
|
+
import_graphql.DirectiveLocation.ENUM_VALUE
|
|
133
|
+
],
|
|
134
|
+
args: {
|
|
135
|
+
reason: {
|
|
136
|
+
type: import_graphql.GraphQLString,
|
|
137
|
+
description: "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",
|
|
138
|
+
defaultValue: DEFAULT_DEPRECATION_REASON
|
|
139
|
+
}
|
|
129
140
|
}
|
|
130
141
|
}
|
|
131
|
-
|
|
132
|
-
const GraphQLSpecifiedByDirective = new GraphQLDirective(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
);
|
|
143
|
+
const GraphQLSpecifiedByDirective = new GraphQLDirective(
|
|
144
|
+
{
|
|
145
|
+
name: "specifiedBy",
|
|
146
|
+
description: "Exposes a URL that specifies the behaviour of this scalar.",
|
|
147
|
+
locations: [import_graphql.DirectiveLocation.SCALAR],
|
|
148
|
+
args: {
|
|
149
|
+
url: {
|
|
150
|
+
type: new import_graphql.GraphQLNonNull(import_graphql.GraphQLString),
|
|
151
|
+
description: "The URL that specifies the behaviour of this scalar."
|
|
152
|
+
}
|
|
140
153
|
}
|
|
141
154
|
}
|
|
142
|
-
|
|
143
|
-
const specifiedDirectives = Object.freeze(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
155
|
+
);
|
|
156
|
+
const specifiedDirectives = Object.freeze(
|
|
157
|
+
[
|
|
158
|
+
GraphQLIncludeDirective,
|
|
159
|
+
GraphQLSkipDirective,
|
|
160
|
+
GraphQLDeprecatedDirective,
|
|
161
|
+
GraphQLSpecifiedByDirective
|
|
162
|
+
]
|
|
163
|
+
);
|
|
149
164
|
function isSpecifiedDirective(directive) {
|
|
150
165
|
return specifiedDirectives.some(({ name }) => name === directive.name);
|
|
151
166
|
}
|
package/lib/directives.mjs
CHANGED
|
@@ -16,7 +16,9 @@ function isDirective(directive) {
|
|
|
16
16
|
}
|
|
17
17
|
function assertDirective(directive) {
|
|
18
18
|
if (!isDirective(directive)) {
|
|
19
|
-
throw new Error(
|
|
19
|
+
throw new Error(
|
|
20
|
+
`Expected ${inspect(directive)} to be a GraphQL directive.`
|
|
21
|
+
);
|
|
20
22
|
}
|
|
21
23
|
return directive;
|
|
22
24
|
}
|
|
@@ -30,9 +32,15 @@ var GraphQLDirective = class {
|
|
|
30
32
|
this.extensions = config.extensions && toObjMap(config.extensions);
|
|
31
33
|
this.astNode = config.astNode;
|
|
32
34
|
devAssert(config.name, "Directive must be named.");
|
|
33
|
-
devAssert(
|
|
35
|
+
devAssert(
|
|
36
|
+
Array.isArray(config.locations),
|
|
37
|
+
`@${config.name} locations must be an Array.`
|
|
38
|
+
);
|
|
34
39
|
const args = (_b = config.args) != null ? _b : {};
|
|
35
|
-
devAssert(
|
|
40
|
+
devAssert(
|
|
41
|
+
isObjectLike(args) && !Array.isArray(args),
|
|
42
|
+
`@${config.name} args must be an object with argument names as keys.`
|
|
43
|
+
);
|
|
36
44
|
this.args = defineArguments(args);
|
|
37
45
|
}
|
|
38
46
|
toConfig() {
|
|
@@ -87,40 +95,46 @@ var GraphQLSkipDirective = new GraphQLDirective({
|
|
|
87
95
|
}
|
|
88
96
|
});
|
|
89
97
|
var DEFAULT_DEPRECATION_REASON = "No longer supported";
|
|
90
|
-
var GraphQLDeprecatedDirective = new GraphQLDirective(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
98
|
+
var GraphQLDeprecatedDirective = new GraphQLDirective(
|
|
99
|
+
{
|
|
100
|
+
name: "deprecated",
|
|
101
|
+
description: "Marks an element of a GraphQL schema as no longer supported.",
|
|
102
|
+
locations: [
|
|
103
|
+
DirectiveLocation.FIELD_DEFINITION,
|
|
104
|
+
DirectiveLocation.ARGUMENT_DEFINITION,
|
|
105
|
+
DirectiveLocation.INPUT_FIELD_DEFINITION,
|
|
106
|
+
DirectiveLocation.ENUM_VALUE
|
|
107
|
+
],
|
|
108
|
+
args: {
|
|
109
|
+
reason: {
|
|
110
|
+
type: GraphQLString,
|
|
111
|
+
description: "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",
|
|
112
|
+
defaultValue: DEFAULT_DEPRECATION_REASON
|
|
113
|
+
}
|
|
104
114
|
}
|
|
105
115
|
}
|
|
106
|
-
|
|
107
|
-
var GraphQLSpecifiedByDirective = new GraphQLDirective(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
);
|
|
117
|
+
var GraphQLSpecifiedByDirective = new GraphQLDirective(
|
|
118
|
+
{
|
|
119
|
+
name: "specifiedBy",
|
|
120
|
+
description: "Exposes a URL that specifies the behaviour of this scalar.",
|
|
121
|
+
locations: [DirectiveLocation.SCALAR],
|
|
122
|
+
args: {
|
|
123
|
+
url: {
|
|
124
|
+
type: new GraphQLNonNull(GraphQLString),
|
|
125
|
+
description: "The URL that specifies the behaviour of this scalar."
|
|
126
|
+
}
|
|
115
127
|
}
|
|
116
128
|
}
|
|
117
|
-
|
|
118
|
-
var specifiedDirectives = Object.freeze(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
129
|
+
);
|
|
130
|
+
var specifiedDirectives = Object.freeze(
|
|
131
|
+
[
|
|
132
|
+
GraphQLIncludeDirective,
|
|
133
|
+
GraphQLSkipDirective,
|
|
134
|
+
GraphQLDeprecatedDirective,
|
|
135
|
+
GraphQLSpecifiedByDirective
|
|
136
|
+
]
|
|
137
|
+
);
|
|
124
138
|
function isSpecifiedDirective(directive) {
|
|
125
139
|
return specifiedDirectives.some(({ name }) => name === directive.name);
|
|
126
140
|
}
|
package/lib/executeWithSchema.js
CHANGED