@graphitation/supermassive 2.5.0 → 3.0.0-alpha.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/.eslintcache +1 -1
- package/CHANGELOG.md +18 -2
- package/lib/benchmarks/index.js +2 -2
- package/lib/benchmarks/index.js.map +2 -2
- package/lib/benchmarks/index.mjs +2 -2
- package/lib/benchmarks/index.mjs.map +2 -2
- package/lib/benchmarks/swapi-schema/index.d.ts +4 -2
- package/lib/benchmarks/swapi-schema/index.d.ts.map +1 -1
- package/lib/benchmarks/swapi-schema/index.js +8 -2
- package/lib/benchmarks/swapi-schema/index.js.map +2 -2
- package/lib/benchmarks/swapi-schema/index.mjs +8 -2
- package/lib/benchmarks/swapi-schema/index.mjs.map +2 -2
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.d.ts +7 -0
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.d.ts.map +1 -0
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.js +916 -0
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.js.map +7 -0
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.mjs +903 -0
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.mjs.map +7 -0
- package/lib/benchmarks/swapi-schema/resolvers.d.ts.map +1 -1
- package/lib/benchmarks/swapi-schema/resolvers.js +53 -17
- package/lib/benchmarks/swapi-schema/resolvers.js.map +2 -2
- package/lib/benchmarks/swapi-schema/resolvers.mjs +54 -18
- package/lib/benchmarks/swapi-schema/resolvers.mjs.map +2 -2
- package/lib/collectFields.d.ts +28 -6
- package/lib/collectFields.d.ts.map +1 -1
- package/lib/collectFields.js +155 -28
- package/lib/collectFields.js.map +3 -3
- package/lib/collectFields.mjs +150 -29
- package/lib/collectFields.mjs.map +2 -2
- package/lib/definition.js +1 -1
- package/lib/definition.js.map +2 -2
- package/lib/definition.mjs +1 -1
- package/lib/definition.mjs.map +2 -2
- package/lib/directives.d.ts +2 -73
- package/lib/directives.d.ts.map +1 -1
- package/lib/directives.js +10 -123
- package/lib/directives.js.map +2 -2
- package/lib/directives.mjs +13 -122
- package/lib/directives.mjs.map +2 -2
- package/lib/executeWithoutSchema.d.ts +50 -13
- package/lib/executeWithoutSchema.d.ts.map +1 -1
- package/lib/executeWithoutSchema.js +1038 -184
- package/lib/executeWithoutSchema.js.map +3 -3
- package/lib/executeWithoutSchema.mjs +1049 -186
- package/lib/executeWithoutSchema.mjs.map +3 -3
- package/lib/extractImplicitTypesRuntime.js +2 -2
- package/lib/extractImplicitTypesRuntime.js.map +2 -2
- package/lib/extractImplicitTypesRuntime.mjs +2 -2
- package/lib/extractImplicitTypesRuntime.mjs.map +2 -2
- package/lib/hooks/types.d.ts +1 -1
- package/lib/hooks/types.d.ts.map +1 -1
- package/lib/index.d.ts +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -1
- package/lib/index.js.map +2 -2
- package/lib/index.mjs +4 -1
- package/lib/index.mjs.map +2 -2
- package/lib/jsutils/AccumulatorMap.d.ts +8 -0
- package/lib/jsutils/AccumulatorMap.d.ts.map +1 -0
- package/lib/jsutils/AccumulatorMap.js +36 -0
- package/lib/jsutils/AccumulatorMap.js.map +7 -0
- package/lib/jsutils/AccumulatorMap.mjs +17 -0
- package/lib/jsutils/AccumulatorMap.mjs.map +7 -0
- package/lib/jsutils/Maybe.d.ts +1 -1
- package/lib/jsutils/Maybe.d.ts.map +1 -1
- package/lib/jsutils/ObjMap.d.ts +2 -2
- package/lib/jsutils/ObjMap.d.ts.map +1 -1
- package/lib/jsutils/PromiseOrValue.d.ts +1 -1
- package/lib/jsutils/PromiseOrValue.d.ts.map +1 -1
- package/lib/jsutils/didYouMean.d.ts +1 -2
- package/lib/jsutils/didYouMean.d.ts.map +1 -1
- package/lib/jsutils/didYouMean.js.map +2 -2
- package/lib/jsutils/didYouMean.mjs.map +2 -2
- package/lib/jsutils/instanceOf.js.map +2 -2
- package/lib/jsutils/instanceOf.mjs.map +2 -2
- package/lib/subscribeWithSchema.d.ts +3 -2
- package/lib/subscribeWithSchema.d.ts.map +1 -1
- package/lib/subscribeWithSchema.js.map +2 -2
- package/lib/subscribeWithSchema.mjs.map +2 -2
- package/lib/subscribeWithoutSchema.d.ts +3 -35
- package/lib/subscribeWithoutSchema.d.ts.map +1 -1
- package/lib/subscribeWithoutSchema.js +1 -163
- package/lib/subscribeWithoutSchema.js.map +2 -2
- package/lib/subscribeWithoutSchema.mjs +2 -175
- package/lib/subscribeWithoutSchema.mjs.map +2 -2
- package/lib/supermassive-ast/TypedAST.d.ts +370 -0
- package/lib/supermassive-ast/TypedAST.d.ts.map +1 -0
- package/lib/supermassive-ast/TypedAST.js +29 -0
- package/lib/supermassive-ast/TypedAST.js.map +7 -0
- package/lib/supermassive-ast/TypedAST.mjs +10 -0
- package/lib/supermassive-ast/TypedAST.mjs.map +7 -0
- package/lib/supermassive-ast/addTypesToRequestDocument.d.ts +56 -0
- package/lib/supermassive-ast/addTypesToRequestDocument.d.ts.map +1 -0
- package/lib/supermassive-ast/addTypesToRequestDocument.js +473 -0
- package/lib/supermassive-ast/addTypesToRequestDocument.js.map +7 -0
- package/lib/supermassive-ast/addTypesToRequestDocument.mjs +463 -0
- package/lib/supermassive-ast/addTypesToRequestDocument.mjs.map +7 -0
- package/lib/supermassive-ast/annotateDocumentGraphQLTransform.d.ts +3 -0
- package/lib/supermassive-ast/annotateDocumentGraphQLTransform.d.ts.map +1 -0
- package/lib/supermassive-ast/annotateDocumentGraphQLTransform.js +34 -0
- package/lib/supermassive-ast/annotateDocumentGraphQLTransform.js.map +7 -0
- package/lib/supermassive-ast/annotateDocumentGraphQLTransform.mjs +17 -0
- package/lib/supermassive-ast/annotateDocumentGraphQLTransform.mjs.map +7 -0
- package/lib/supermassive-ast/directives.d.ts +36 -0
- package/lib/supermassive-ast/directives.d.ts.map +1 -0
- package/lib/supermassive-ast/directives.js +165 -0
- package/lib/supermassive-ast/directives.js.map +7 -0
- package/lib/supermassive-ast/directives.mjs +153 -0
- package/lib/supermassive-ast/directives.mjs.map +7 -0
- package/lib/supermassive-ast/index.d.ts +6 -0
- package/lib/supermassive-ast/index.d.ts.map +1 -0
- package/lib/supermassive-ast/index.js +37 -0
- package/lib/supermassive-ast/index.js.map +7 -0
- package/lib/supermassive-ast/index.mjs +27 -0
- package/lib/supermassive-ast/index.mjs.map +7 -0
- package/lib/types.d.ts +80 -24
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js +14 -0
- package/lib/types.js.map +2 -2
- package/lib/types.mjs +11 -0
- package/lib/types.mjs.map +3 -3
- package/lib/utilities/mergeResolvers.d.ts +1 -1
- package/lib/utilities/mergeResolvers.d.ts.map +1 -1
- package/lib/utilities/mergeResolvers.js.map +2 -2
- package/lib/utilities/mergeResolvers.mjs.map +2 -2
- package/lib/utilities/typeNameFromAST.d.ts +1 -1
- package/lib/utilities/typeNameFromAST.d.ts.map +1 -1
- package/lib/utilities/typeNameFromAST.js.map +1 -1
- package/lib/utilities/typeNameFromAST.mjs.map +1 -1
- package/lib/values.d.ts +3 -4
- package/lib/values.d.ts.map +1 -1
- package/lib/values.js +10 -14
- package/lib/values.js.map +2 -2
- package/lib/values.mjs +10 -14
- package/lib/values.mjs.map +2 -2
- package/package.json +4 -9
package/lib/definition.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/definition.ts"],
|
|
4
|
-
"sourcesContent": ["import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from \"graphql\";\n\nimport { Resolver, UnionTypeResolver, InterfaceTypeResolver } from \"./types\";\nimport { toObjMap } from \"./jsutils/toObjMap\";\nimport { keyValMap } from \"./jsutils/keyValMap\";\n\nexport function defineArguments(\n config: GraphQLFieldConfigArgumentMap,\n): ReadonlyArray<GraphQLArgument> {\n return Object.entries(config).map(([argName, argConfig]) => ({\n name: argName,\n description: argConfig.description,\n type: argConfig.type,\n defaultValue: argConfig.defaultValue,\n deprecationReason: argConfig.deprecationReason,\n extensions: argConfig.extensions
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAAyB;AACzB,uBAA0B;AAEnB,SAAS,gBACd,QACgC;AAChC,SAAO,OAAO,QAAQ,MAAM,EAAE,IAAI,CAAC,CAAC,SAAS,SAAS,OAAO;AAAA,IAC3D,MAAM;AAAA,IACN,aAAa,UAAU;AAAA,IACvB,MAAM,UAAU;AAAA,IAChB,cAAc,UAAU;AAAA,IACxB,mBAAmB,UAAU;AAAA,IAC7B,YAAY,UAAU,
|
|
4
|
+
"sourcesContent": ["import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from \"graphql\";\n\nimport { Resolver, UnionTypeResolver, InterfaceTypeResolver } from \"./types\";\nimport { toObjMap } from \"./jsutils/toObjMap\";\nimport { keyValMap } from \"./jsutils/keyValMap\";\n\nexport function defineArguments(\n config: GraphQLFieldConfigArgumentMap,\n): ReadonlyArray<GraphQLArgument> {\n return Object.entries(config).map(([argName, argConfig]) => ({\n name: argName,\n description: argConfig.description,\n type: argConfig.type,\n defaultValue: argConfig.defaultValue,\n deprecationReason: argConfig.deprecationReason,\n extensions: argConfig.extensions ? toObjMap(argConfig.extensions) : {},\n astNode: argConfig.astNode,\n }));\n}\n\nexport function argsToArgsConfig(\n args: ReadonlyArray<GraphQLArgument>,\n): GraphQLFieldConfigArgumentMap {\n return keyValMap(\n args,\n (arg) => arg.name,\n (arg) => ({\n description: arg.description,\n type: arg.type,\n defaultValue: arg.defaultValue,\n deprecationReason: arg.deprecationReason,\n extensions: arg.extensions,\n astNode: arg.astNode,\n }),\n );\n}\n\nexport function isInterfaceResolverType(\n resolver: Resolver<unknown, unknown>,\n): resolver is InterfaceTypeResolver {\n return \"__implementedBy\" in resolver && \"__resolveType\" in resolver;\n}\n\nexport function isUnionResolverType(\n resolver: Resolver<unknown, unknown>,\n): resolver is UnionTypeResolver {\n return \"__types\" in resolver && \"__resolveType\" in resolver;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAAyB;AACzB,uBAA0B;AAEnB,SAAS,gBACd,QACgC;AAChC,SAAO,OAAO,QAAQ,MAAM,EAAE,IAAI,CAAC,CAAC,SAAS,SAAS,OAAO;AAAA,IAC3D,MAAM;AAAA,IACN,aAAa,UAAU;AAAA,IACvB,MAAM,UAAU;AAAA,IAChB,cAAc,UAAU;AAAA,IACxB,mBAAmB,UAAU;AAAA,IAC7B,YAAY,UAAU,iBAAa,0BAAS,UAAU,UAAU,IAAI,CAAC;AAAA,IACrE,SAAS,UAAU;AAAA,EACrB,EAAE;AACJ;AAEO,SAAS,iBACd,MAC+B;AAC/B,aAAO;AAAA,IACL;AAAA,IACA,CAAC,QAAQ,IAAI;AAAA,IACb,CAAC,SAAS;AAAA,MACR,aAAa,IAAI;AAAA,MACjB,MAAM,IAAI;AAAA,MACV,cAAc,IAAI;AAAA,MAClB,mBAAmB,IAAI;AAAA,MACvB,YAAY,IAAI;AAAA,MAChB,SAAS,IAAI;AAAA,IACf;AAAA,EACF;AACF;AAEO,SAAS,wBACd,UACmC;AACnC,SAAO,qBAAqB,YAAY,mBAAmB;AAC7D;AAEO,SAAS,oBACd,UAC+B;AAC/B,SAAO,aAAa,YAAY,mBAAmB;AACrD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/definition.mjs
CHANGED
|
@@ -8,7 +8,7 @@ function defineArguments(config) {
|
|
|
8
8
|
type: argConfig.type,
|
|
9
9
|
defaultValue: argConfig.defaultValue,
|
|
10
10
|
deprecationReason: argConfig.deprecationReason,
|
|
11
|
-
extensions: argConfig.extensions
|
|
11
|
+
extensions: argConfig.extensions ? toObjMap(argConfig.extensions) : {},
|
|
12
12
|
astNode: argConfig.astNode
|
|
13
13
|
}));
|
|
14
14
|
}
|
package/lib/definition.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/definition.ts"],
|
|
4
|
-
"sourcesContent": ["import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from \"graphql\";\n\nimport { Resolver, UnionTypeResolver, InterfaceTypeResolver } from \"./types\";\nimport { toObjMap } from \"./jsutils/toObjMap\";\nimport { keyValMap } from \"./jsutils/keyValMap\";\n\nexport function defineArguments(\n config: GraphQLFieldConfigArgumentMap,\n): ReadonlyArray<GraphQLArgument> {\n return Object.entries(config).map(([argName, argConfig]) => ({\n name: argName,\n description: argConfig.description,\n type: argConfig.type,\n defaultValue: argConfig.defaultValue,\n deprecationReason: argConfig.deprecationReason,\n extensions: argConfig.extensions
|
|
5
|
-
"mappings": ";AAGA,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAEnB,SAAS,gBACd,QACgC;AAChC,SAAO,OAAO,QAAQ,MAAM,EAAE,IAAI,CAAC,CAAC,SAAS,SAAS,OAAO;AAAA,IAC3D,MAAM;AAAA,IACN,aAAa,UAAU;AAAA,IACvB,MAAM,UAAU;AAAA,IAChB,cAAc,UAAU;AAAA,IACxB,mBAAmB,UAAU;AAAA,IAC7B,YAAY,UAAU,
|
|
4
|
+
"sourcesContent": ["import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from \"graphql\";\n\nimport { Resolver, UnionTypeResolver, InterfaceTypeResolver } from \"./types\";\nimport { toObjMap } from \"./jsutils/toObjMap\";\nimport { keyValMap } from \"./jsutils/keyValMap\";\n\nexport function defineArguments(\n config: GraphQLFieldConfigArgumentMap,\n): ReadonlyArray<GraphQLArgument> {\n return Object.entries(config).map(([argName, argConfig]) => ({\n name: argName,\n description: argConfig.description,\n type: argConfig.type,\n defaultValue: argConfig.defaultValue,\n deprecationReason: argConfig.deprecationReason,\n extensions: argConfig.extensions ? toObjMap(argConfig.extensions) : {},\n astNode: argConfig.astNode,\n }));\n}\n\nexport function argsToArgsConfig(\n args: ReadonlyArray<GraphQLArgument>,\n): GraphQLFieldConfigArgumentMap {\n return keyValMap(\n args,\n (arg) => arg.name,\n (arg) => ({\n description: arg.description,\n type: arg.type,\n defaultValue: arg.defaultValue,\n deprecationReason: arg.deprecationReason,\n extensions: arg.extensions,\n astNode: arg.astNode,\n }),\n );\n}\n\nexport function isInterfaceResolverType(\n resolver: Resolver<unknown, unknown>,\n): resolver is InterfaceTypeResolver {\n return \"__implementedBy\" in resolver && \"__resolveType\" in resolver;\n}\n\nexport function isUnionResolverType(\n resolver: Resolver<unknown, unknown>,\n): resolver is UnionTypeResolver {\n return \"__types\" in resolver && \"__resolveType\" in resolver;\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAEnB,SAAS,gBACd,QACgC;AAChC,SAAO,OAAO,QAAQ,MAAM,EAAE,IAAI,CAAC,CAAC,SAAS,SAAS,OAAO;AAAA,IAC3D,MAAM;AAAA,IACN,aAAa,UAAU;AAAA,IACvB,MAAM,UAAU;AAAA,IAChB,cAAc,UAAU;AAAA,IACxB,mBAAmB,UAAU;AAAA,IAC7B,YAAY,UAAU,aAAa,SAAS,UAAU,UAAU,IAAI,CAAC;AAAA,IACrE,SAAS,UAAU;AAAA,EACrB,EAAE;AACJ;AAEO,SAAS,iBACd,MAC+B;AAC/B,SAAO;AAAA,IACL;AAAA,IACA,CAAC,QAAQ,IAAI;AAAA,IACb,CAAC,SAAS;AAAA,MACR,aAAa,IAAI;AAAA,MACjB,MAAM,IAAI;AAAA,MACV,cAAc,IAAI;AAAA,MAClB,mBAAmB,IAAI;AAAA,MACvB,YAAY,IAAI;AAAA,MAChB,SAAS,IAAI;AAAA,IACf;AAAA,EACF;AACF;AAEO,SAAS,wBACd,UACmC;AACnC,SAAO,qBAAqB,YAAY,mBAAmB;AAC7D;AAEO,SAAS,oBACd,UAC+B;AAC/B,SAAO,aAAa,YAAY,mBAAmB;AACrD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/directives.d.ts
CHANGED
|
@@ -1,79 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import type { DirectiveDefinitionNode } from "@graphitation/supermassive-ast";
|
|
1
|
+
import { GraphQLDirective } from "graphql";
|
|
2
|
+
export { specifiedDirectives, isSpecifiedDirective, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective, GraphQLDeferDirective, GraphQLStreamDirective, } from "./supermassive-ast";
|
|
4
3
|
/**
|
|
5
4
|
* Test if the given value is a GraphQL directive.
|
|
6
5
|
*/
|
|
7
6
|
export declare function isDirective(directive: unknown): directive is GraphQLDirective;
|
|
8
7
|
export declare function assertDirective(directive: unknown): GraphQLDirective;
|
|
9
|
-
/**
|
|
10
|
-
* Custom extensions
|
|
11
|
-
*
|
|
12
|
-
* @remarks
|
|
13
|
-
* Use a unique identifier name for your extension, for example the name of
|
|
14
|
-
* your library or project. Do not use a shortened identifier as this increases
|
|
15
|
-
* the risk of conflicts. We recommend you add at most one extension field,
|
|
16
|
-
* an object which can contain all the values you need.
|
|
17
|
-
*/
|
|
18
|
-
export interface GraphQLDirectiveExtensions {
|
|
19
|
-
[attributeName: string]: unknown;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Directives are used by the GraphQL runtime as a way of modifying execution
|
|
23
|
-
* behavior. Type system creators will usually not create these directly.
|
|
24
|
-
*/
|
|
25
|
-
export declare class GraphQLDirective {
|
|
26
|
-
name: string;
|
|
27
|
-
description: Maybe<string>;
|
|
28
|
-
locations: ReadonlyArray<DirectiveLocationEnum>;
|
|
29
|
-
args: ReadonlyArray<GraphQLArgument>;
|
|
30
|
-
isRepeatable: boolean;
|
|
31
|
-
extensions: Maybe<Readonly<GraphQLDirectiveExtensions>>;
|
|
32
|
-
astNode: Maybe<DirectiveDefinitionNode>;
|
|
33
|
-
constructor(config: Readonly<GraphQLDirectiveConfig>);
|
|
34
|
-
toConfig(): GraphQLDirectiveNormalizedConfig;
|
|
35
|
-
toString(): string;
|
|
36
|
-
toJSON(): string;
|
|
37
|
-
get [Symbol.toStringTag](): string;
|
|
38
|
-
}
|
|
39
|
-
export interface GraphQLDirectiveConfig {
|
|
40
|
-
name: string;
|
|
41
|
-
description?: Maybe<string>;
|
|
42
|
-
locations: ReadonlyArray<DirectiveLocationEnum>;
|
|
43
|
-
args?: Maybe<GraphQLFieldConfigArgumentMap>;
|
|
44
|
-
isRepeatable?: Maybe<boolean>;
|
|
45
|
-
extensions?: Maybe<Readonly<GraphQLDirectiveExtensions>>;
|
|
46
|
-
astNode?: Maybe<DirectiveDefinitionNode>;
|
|
47
|
-
}
|
|
48
|
-
interface GraphQLDirectiveNormalizedConfig extends GraphQLDirectiveConfig {
|
|
49
|
-
args: GraphQLFieldConfigArgumentMap;
|
|
50
|
-
isRepeatable: boolean;
|
|
51
|
-
extensions: Maybe<Readonly<GraphQLDirectiveExtensions>>;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Used to conditionally include fields or fragments.
|
|
55
|
-
*/
|
|
56
|
-
export declare const GraphQLIncludeDirective: GraphQLDirective;
|
|
57
|
-
/**
|
|
58
|
-
* Used to conditionally skip (exclude) fields or fragments.
|
|
59
|
-
*/
|
|
60
|
-
export declare const GraphQLSkipDirective: GraphQLDirective;
|
|
61
|
-
/**
|
|
62
|
-
* Constant string used for default reason for a deprecation.
|
|
63
|
-
*/
|
|
64
|
-
export declare const DEFAULT_DEPRECATION_REASON = "No longer supported";
|
|
65
|
-
/**
|
|
66
|
-
* Used to declare element of a GraphQL schema as deprecated.
|
|
67
|
-
*/
|
|
68
|
-
export declare const GraphQLDeprecatedDirective: GraphQLDirective;
|
|
69
|
-
/**
|
|
70
|
-
* Used to provide a URL for specifying the behaviour of custom scalar definitions.
|
|
71
|
-
*/
|
|
72
|
-
export declare const GraphQLSpecifiedByDirective: GraphQLDirective;
|
|
73
|
-
/**
|
|
74
|
-
* The full list of specified directives.
|
|
75
|
-
*/
|
|
76
|
-
export declare const specifiedDirectives: ReadonlyArray<GraphQLDirective>;
|
|
77
|
-
export declare function isSpecifiedDirective(directive: GraphQLDirective): boolean;
|
|
78
|
-
export {};
|
|
79
8
|
//# sourceMappingURL=directives.d.ts.map
|
package/lib/directives.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../src/directives.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../src/directives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAI3C,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,IAAI,gBAAgB,CAE7E;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,GAAG,gBAAgB,CAOpE"}
|
package/lib/directives.js
CHANGED
|
@@ -18,27 +18,24 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var directives_exports = {};
|
|
20
20
|
__export(directives_exports, {
|
|
21
|
-
|
|
22
|
-
GraphQLDeprecatedDirective: () => GraphQLDeprecatedDirective,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
GraphQLDeferDirective: () => import_supermassive_ast.GraphQLDeferDirective,
|
|
22
|
+
GraphQLDeprecatedDirective: () => import_supermassive_ast.GraphQLDeprecatedDirective,
|
|
23
|
+
GraphQLIncludeDirective: () => import_supermassive_ast.GraphQLIncludeDirective,
|
|
24
|
+
GraphQLSkipDirective: () => import_supermassive_ast.GraphQLSkipDirective,
|
|
25
|
+
GraphQLSpecifiedByDirective: () => import_supermassive_ast.GraphQLSpecifiedByDirective,
|
|
26
|
+
GraphQLStreamDirective: () => import_supermassive_ast.GraphQLStreamDirective,
|
|
27
27
|
assertDirective: () => assertDirective,
|
|
28
28
|
isDirective: () => isDirective,
|
|
29
|
-
isSpecifiedDirective: () => isSpecifiedDirective,
|
|
30
|
-
specifiedDirectives: () => specifiedDirectives
|
|
29
|
+
isSpecifiedDirective: () => import_supermassive_ast.isSpecifiedDirective,
|
|
30
|
+
specifiedDirectives: () => import_supermassive_ast.specifiedDirectives
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(directives_exports);
|
|
33
33
|
var import_graphql = require("graphql");
|
|
34
34
|
var import_inspect = require("./jsutils/inspect");
|
|
35
|
-
var import_toObjMap = require("./jsutils/toObjMap");
|
|
36
|
-
var import_devAssert = require("./jsutils/devAssert");
|
|
37
35
|
var import_instanceOf = require("./jsutils/instanceOf");
|
|
38
|
-
var
|
|
39
|
-
var import_definition = require("./definition");
|
|
36
|
+
var import_supermassive_ast = require("./supermassive-ast");
|
|
40
37
|
function isDirective(directive) {
|
|
41
|
-
return (0, import_instanceOf.instanceOf)(directive, GraphQLDirective);
|
|
38
|
+
return (0, import_instanceOf.instanceOf)(directive, import_graphql.GraphQLDirective);
|
|
42
39
|
}
|
|
43
40
|
function assertDirective(directive) {
|
|
44
41
|
if (!isDirective(directive)) {
|
|
@@ -48,113 +45,3 @@ function assertDirective(directive) {
|
|
|
48
45
|
}
|
|
49
46
|
return directive;
|
|
50
47
|
}
|
|
51
|
-
class GraphQLDirective {
|
|
52
|
-
constructor(config) {
|
|
53
|
-
var _a, _b;
|
|
54
|
-
this.name = config.name;
|
|
55
|
-
this.description = config.description;
|
|
56
|
-
this.locations = config.locations;
|
|
57
|
-
this.isRepeatable = (_a = config.isRepeatable) != null ? _a : false;
|
|
58
|
-
this.extensions = config.extensions && (0, import_toObjMap.toObjMap)(config.extensions);
|
|
59
|
-
this.astNode = config.astNode;
|
|
60
|
-
(0, import_devAssert.devAssert)(config.name, "Directive must be named.");
|
|
61
|
-
(0, import_devAssert.devAssert)(
|
|
62
|
-
Array.isArray(config.locations),
|
|
63
|
-
`@${config.name} locations must be an Array.`
|
|
64
|
-
);
|
|
65
|
-
const args = (_b = config.args) != null ? _b : {};
|
|
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
|
-
);
|
|
70
|
-
this.args = (0, import_definition.defineArguments)(args);
|
|
71
|
-
}
|
|
72
|
-
toConfig() {
|
|
73
|
-
return {
|
|
74
|
-
name: this.name,
|
|
75
|
-
description: this.description,
|
|
76
|
-
locations: this.locations,
|
|
77
|
-
args: (0, import_definition.argsToArgsConfig)(this.args),
|
|
78
|
-
isRepeatable: this.isRepeatable,
|
|
79
|
-
extensions: this.extensions,
|
|
80
|
-
astNode: this.astNode
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
toString() {
|
|
84
|
-
return "@" + this.name;
|
|
85
|
-
}
|
|
86
|
-
toJSON() {
|
|
87
|
-
return this.toString();
|
|
88
|
-
}
|
|
89
|
-
get [Symbol.toStringTag]() {
|
|
90
|
-
return "GraphQLDirective";
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
const GraphQLIncludeDirective = new GraphQLDirective({
|
|
94
|
-
name: "include",
|
|
95
|
-
description: "Directs the executor to include this field or fragment only when the `if` argument is true.",
|
|
96
|
-
locations: [
|
|
97
|
-
import_graphql.DirectiveLocation.FIELD,
|
|
98
|
-
import_graphql.DirectiveLocation.FRAGMENT_SPREAD,
|
|
99
|
-
import_graphql.DirectiveLocation.INLINE_FRAGMENT
|
|
100
|
-
],
|
|
101
|
-
args: {
|
|
102
|
-
if: {
|
|
103
|
-
type: new import_graphql.GraphQLNonNull(import_graphql.GraphQLBoolean),
|
|
104
|
-
description: "Included when true."
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
const GraphQLSkipDirective = new GraphQLDirective({
|
|
109
|
-
name: "skip",
|
|
110
|
-
description: "Directs the executor to skip this field or fragment when the `if` argument is true.",
|
|
111
|
-
locations: [
|
|
112
|
-
import_graphql.DirectiveLocation.FIELD,
|
|
113
|
-
import_graphql.DirectiveLocation.FRAGMENT_SPREAD,
|
|
114
|
-
import_graphql.DirectiveLocation.INLINE_FRAGMENT
|
|
115
|
-
],
|
|
116
|
-
args: {
|
|
117
|
-
if: {
|
|
118
|
-
type: new import_graphql.GraphQLNonNull(import_graphql.GraphQLBoolean),
|
|
119
|
-
description: "Skipped when true."
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
const DEFAULT_DEPRECATION_REASON = "No longer supported";
|
|
124
|
-
const GraphQLDeprecatedDirective = new GraphQLDirective({
|
|
125
|
-
name: "deprecated",
|
|
126
|
-
description: "Marks an element of a GraphQL schema as no longer supported.",
|
|
127
|
-
locations: [
|
|
128
|
-
import_graphql.DirectiveLocation.FIELD_DEFINITION,
|
|
129
|
-
import_graphql.DirectiveLocation.ARGUMENT_DEFINITION,
|
|
130
|
-
import_graphql.DirectiveLocation.INPUT_FIELD_DEFINITION,
|
|
131
|
-
import_graphql.DirectiveLocation.ENUM_VALUE
|
|
132
|
-
],
|
|
133
|
-
args: {
|
|
134
|
-
reason: {
|
|
135
|
-
type: import_graphql.GraphQLString,
|
|
136
|
-
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/).",
|
|
137
|
-
defaultValue: DEFAULT_DEPRECATION_REASON
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
const GraphQLSpecifiedByDirective = new GraphQLDirective({
|
|
142
|
-
name: "specifiedBy",
|
|
143
|
-
description: "Exposes a URL that specifies the behaviour of this scalar.",
|
|
144
|
-
locations: [import_graphql.DirectiveLocation.SCALAR],
|
|
145
|
-
args: {
|
|
146
|
-
url: {
|
|
147
|
-
type: new import_graphql.GraphQLNonNull(import_graphql.GraphQLString),
|
|
148
|
-
description: "The URL that specifies the behaviour of this scalar."
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
const specifiedDirectives = Object.freeze([
|
|
153
|
-
GraphQLIncludeDirective,
|
|
154
|
-
GraphQLSkipDirective,
|
|
155
|
-
GraphQLDeprecatedDirective,
|
|
156
|
-
GraphQLSpecifiedByDirective
|
|
157
|
-
]);
|
|
158
|
-
function isSpecifiedDirective(directive) {
|
|
159
|
-
return specifiedDirectives.some(({ name }) => name === directive.name);
|
|
160
|
-
}
|
package/lib/directives.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/directives.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import { GraphQLDirective } from \"graphql\";\nimport { inspect } from \"./jsutils/inspect\";\nimport { instanceOf } from \"./jsutils/instanceOf\";\n\nexport {\n specifiedDirectives,\n isSpecifiedDirective,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLDeprecatedDirective,\n GraphQLSpecifiedByDirective,\n GraphQLDeferDirective,\n GraphQLStreamDirective,\n} from \"./supermassive-ast\";\n\n/**\n * Test if the given value is a GraphQL directive.\n */\nexport function isDirective(directive: unknown): directive is GraphQLDirective {\n return instanceOf(directive, GraphQLDirective);\n}\n\nexport function assertDirective(directive: unknown): GraphQLDirective {\n if (!isDirective(directive)) {\n throw new Error(\n `Expected ${inspect(directive)} to be a GraphQL directive.`,\n );\n }\n return directive;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAiC;AACjC,qBAAwB;AACxB,wBAA2B;AAE3B,8BASO;AAKA,SAAS,YAAY,WAAmD;AAC7E,aAAO,8BAAW,WAAW,+BAAgB;AAC/C;AAEO,SAAS,gBAAgB,WAAsC;AACpE,MAAI,CAAC,YAAY,SAAS,GAAG;AAC3B,UAAM,IAAI;AAAA,MACR,gBAAY,wBAAQ,SAAS;AAAA,IAC/B;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/directives.mjs
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
// src/directives.ts
|
|
2
|
-
import {
|
|
3
|
-
GraphQLString,
|
|
4
|
-
GraphQLBoolean,
|
|
5
|
-
GraphQLNonNull,
|
|
6
|
-
DirectiveLocation
|
|
7
|
-
} from "graphql";
|
|
2
|
+
import { GraphQLDirective } from "graphql";
|
|
8
3
|
import { inspect } from "./jsutils/inspect.mjs";
|
|
9
|
-
import { toObjMap } from "./jsutils/toObjMap.mjs";
|
|
10
|
-
import { devAssert } from "./jsutils/devAssert.mjs";
|
|
11
4
|
import { instanceOf } from "./jsutils/instanceOf.mjs";
|
|
12
|
-
import {
|
|
13
|
-
|
|
5
|
+
import {
|
|
6
|
+
specifiedDirectives,
|
|
7
|
+
isSpecifiedDirective,
|
|
8
|
+
GraphQLIncludeDirective,
|
|
9
|
+
GraphQLSkipDirective,
|
|
10
|
+
GraphQLDeprecatedDirective,
|
|
11
|
+
GraphQLSpecifiedByDirective,
|
|
12
|
+
GraphQLDeferDirective,
|
|
13
|
+
GraphQLStreamDirective
|
|
14
|
+
} from "./supermassive-ast/index.mjs";
|
|
14
15
|
function isDirective(directive) {
|
|
15
16
|
return instanceOf(directive, GraphQLDirective);
|
|
16
17
|
}
|
|
@@ -22,123 +23,13 @@ function assertDirective(directive) {
|
|
|
22
23
|
}
|
|
23
24
|
return directive;
|
|
24
25
|
}
|
|
25
|
-
var GraphQLDirective = class {
|
|
26
|
-
constructor(config) {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
this.name = config.name;
|
|
29
|
-
this.description = config.description;
|
|
30
|
-
this.locations = config.locations;
|
|
31
|
-
this.isRepeatable = (_a = config.isRepeatable) != null ? _a : false;
|
|
32
|
-
this.extensions = config.extensions && toObjMap(config.extensions);
|
|
33
|
-
this.astNode = config.astNode;
|
|
34
|
-
devAssert(config.name, "Directive must be named.");
|
|
35
|
-
devAssert(
|
|
36
|
-
Array.isArray(config.locations),
|
|
37
|
-
`@${config.name} locations must be an Array.`
|
|
38
|
-
);
|
|
39
|
-
const args = (_b = config.args) != null ? _b : {};
|
|
40
|
-
devAssert(
|
|
41
|
-
isObjectLike(args) && !Array.isArray(args),
|
|
42
|
-
`@${config.name} args must be an object with argument names as keys.`
|
|
43
|
-
);
|
|
44
|
-
this.args = defineArguments(args);
|
|
45
|
-
}
|
|
46
|
-
toConfig() {
|
|
47
|
-
return {
|
|
48
|
-
name: this.name,
|
|
49
|
-
description: this.description,
|
|
50
|
-
locations: this.locations,
|
|
51
|
-
args: argsToArgsConfig(this.args),
|
|
52
|
-
isRepeatable: this.isRepeatable,
|
|
53
|
-
extensions: this.extensions,
|
|
54
|
-
astNode: this.astNode
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
toString() {
|
|
58
|
-
return "@" + this.name;
|
|
59
|
-
}
|
|
60
|
-
toJSON() {
|
|
61
|
-
return this.toString();
|
|
62
|
-
}
|
|
63
|
-
get [Symbol.toStringTag]() {
|
|
64
|
-
return "GraphQLDirective";
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
var GraphQLIncludeDirective = new GraphQLDirective({
|
|
68
|
-
name: "include",
|
|
69
|
-
description: "Directs the executor to include this field or fragment only when the `if` argument is true.",
|
|
70
|
-
locations: [
|
|
71
|
-
DirectiveLocation.FIELD,
|
|
72
|
-
DirectiveLocation.FRAGMENT_SPREAD,
|
|
73
|
-
DirectiveLocation.INLINE_FRAGMENT
|
|
74
|
-
],
|
|
75
|
-
args: {
|
|
76
|
-
if: {
|
|
77
|
-
type: new GraphQLNonNull(GraphQLBoolean),
|
|
78
|
-
description: "Included when true."
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
var GraphQLSkipDirective = new GraphQLDirective({
|
|
83
|
-
name: "skip",
|
|
84
|
-
description: "Directs the executor to skip this field or fragment when the `if` argument is true.",
|
|
85
|
-
locations: [
|
|
86
|
-
DirectiveLocation.FIELD,
|
|
87
|
-
DirectiveLocation.FRAGMENT_SPREAD,
|
|
88
|
-
DirectiveLocation.INLINE_FRAGMENT
|
|
89
|
-
],
|
|
90
|
-
args: {
|
|
91
|
-
if: {
|
|
92
|
-
type: new GraphQLNonNull(GraphQLBoolean),
|
|
93
|
-
description: "Skipped when true."
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
var DEFAULT_DEPRECATION_REASON = "No longer supported";
|
|
98
|
-
var GraphQLDeprecatedDirective = new GraphQLDirective({
|
|
99
|
-
name: "deprecated",
|
|
100
|
-
description: "Marks an element of a GraphQL schema as no longer supported.",
|
|
101
|
-
locations: [
|
|
102
|
-
DirectiveLocation.FIELD_DEFINITION,
|
|
103
|
-
DirectiveLocation.ARGUMENT_DEFINITION,
|
|
104
|
-
DirectiveLocation.INPUT_FIELD_DEFINITION,
|
|
105
|
-
DirectiveLocation.ENUM_VALUE
|
|
106
|
-
],
|
|
107
|
-
args: {
|
|
108
|
-
reason: {
|
|
109
|
-
type: GraphQLString,
|
|
110
|
-
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/).",
|
|
111
|
-
defaultValue: DEFAULT_DEPRECATION_REASON
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
var GraphQLSpecifiedByDirective = new GraphQLDirective({
|
|
116
|
-
name: "specifiedBy",
|
|
117
|
-
description: "Exposes a URL that specifies the behaviour of this scalar.",
|
|
118
|
-
locations: [DirectiveLocation.SCALAR],
|
|
119
|
-
args: {
|
|
120
|
-
url: {
|
|
121
|
-
type: new GraphQLNonNull(GraphQLString),
|
|
122
|
-
description: "The URL that specifies the behaviour of this scalar."
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
var specifiedDirectives = Object.freeze([
|
|
127
|
-
GraphQLIncludeDirective,
|
|
128
|
-
GraphQLSkipDirective,
|
|
129
|
-
GraphQLDeprecatedDirective,
|
|
130
|
-
GraphQLSpecifiedByDirective
|
|
131
|
-
]);
|
|
132
|
-
function isSpecifiedDirective(directive) {
|
|
133
|
-
return specifiedDirectives.some(({ name }) => name === directive.name);
|
|
134
|
-
}
|
|
135
26
|
export {
|
|
136
|
-
|
|
27
|
+
GraphQLDeferDirective,
|
|
137
28
|
GraphQLDeprecatedDirective,
|
|
138
|
-
GraphQLDirective,
|
|
139
29
|
GraphQLIncludeDirective,
|
|
140
30
|
GraphQLSkipDirective,
|
|
141
31
|
GraphQLSpecifiedByDirective,
|
|
32
|
+
GraphQLStreamDirective,
|
|
142
33
|
assertDirective,
|
|
143
34
|
isDirective,
|
|
144
35
|
isSpecifiedDirective,
|
package/lib/directives.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/directives.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": ";AAAA;AAAA,EACE;AAAA,EACA;AAAA,
|
|
4
|
+
"sourcesContent": ["import { GraphQLDirective } from \"graphql\";\nimport { inspect } from \"./jsutils/inspect\";\nimport { instanceOf } from \"./jsutils/instanceOf\";\n\nexport {\n specifiedDirectives,\n isSpecifiedDirective,\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLDeprecatedDirective,\n GraphQLSpecifiedByDirective,\n GraphQLDeferDirective,\n GraphQLStreamDirective,\n} from \"./supermassive-ast\";\n\n/**\n * Test if the given value is a GraphQL directive.\n */\nexport function isDirective(directive: unknown): directive is GraphQLDirective {\n return instanceOf(directive, GraphQLDirective);\n}\n\nexport function assertDirective(directive: unknown): GraphQLDirective {\n if (!isDirective(directive)) {\n throw new Error(\n `Expected ${inspect(directive)} to be a GraphQL directive.`,\n );\n }\n return directive;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,wBAAwB;AACjC,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAE3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKA,SAAS,YAAY,WAAmD;AAC7E,SAAO,WAAW,WAAW,gBAAgB;AAC/C;AAEO,SAAS,gBAAgB,WAAsC;AACpE,MAAI,CAAC,YAAY,SAAS,GAAG;AAC3B,UAAM,IAAI;AAAA,MACR,YAAY,QAAQ,SAAS;AAAA,IAC/B;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GraphQLError } from "graphql";
|
|
2
|
-
import { DocumentNode,
|
|
2
|
+
import { DocumentNode, FragmentDefinitionNode, OperationDefinitionNode, OperationTypeDefinitionNode, TypeNode } from "./supermassive-ast";
|
|
3
|
+
import { FieldGroup } from "./collectFields";
|
|
3
4
|
import type { Maybe } from "./jsutils/Maybe";
|
|
4
5
|
import type { ObjMap } from "./jsutils/ObjMap";
|
|
5
6
|
import type { Path } from "./jsutils/Path";
|
|
@@ -36,14 +37,17 @@ export interface ExecutionContext {
|
|
|
36
37
|
fragments: ObjMap<FragmentDefinitionNode>;
|
|
37
38
|
rootValue: unknown;
|
|
38
39
|
contextValue: unknown;
|
|
40
|
+
buildContextValue?: (contextValue?: unknown) => unknown;
|
|
39
41
|
operation: OperationDefinitionNode;
|
|
40
42
|
variableValues: {
|
|
41
43
|
[variable: string]: unknown;
|
|
42
44
|
};
|
|
43
45
|
fieldResolver: FunctionFieldResolver<unknown, unknown>;
|
|
44
46
|
typeResolver: TypeResolver<unknown, unknown>;
|
|
47
|
+
subscribeFieldResolver: FunctionFieldResolver<unknown, unknown>;
|
|
45
48
|
errors: Array<GraphQLError>;
|
|
46
49
|
fieldExecutionHooks?: ExecutionHooks;
|
|
50
|
+
subsequentPayloads: Set<IncrementalDataRecord>;
|
|
47
51
|
}
|
|
48
52
|
/**
|
|
49
53
|
* Implements the "Executing requests" section of the GraphQL specification.
|
|
@@ -65,21 +69,10 @@ export declare function executeWithoutSchema(args: ExecutionWithoutSchemaArgs):
|
|
|
65
69
|
export declare function assertValidExecutionArguments(document: DocumentNode, rawVariableValues: Maybe<{
|
|
66
70
|
[variable: string]: unknown;
|
|
67
71
|
}>): void;
|
|
68
|
-
/**
|
|
69
|
-
* Constructs a ExecutionContext object from the arguments passed to
|
|
70
|
-
* execute, which we will pass throughout the other execution methods.
|
|
71
|
-
*
|
|
72
|
-
* Throws a GraphQLError if a valid execution context cannot be created.
|
|
73
|
-
*
|
|
74
|
-
* @internal
|
|
75
|
-
*/
|
|
76
|
-
export declare function buildExecutionContext(resolvers: Resolvers, document: DocumentNode, rootValue: unknown, contextValue: unknown, rawVariableValues: Maybe<{
|
|
77
|
-
[variable: string]: unknown;
|
|
78
|
-
}>, operationName: Maybe<string>, fieldResolver: Maybe<FunctionFieldResolver<unknown, unknown>>, typeResolver?: Maybe<TypeResolver<unknown, unknown>>, fieldExecutionHooks?: ExecutionHooks): Array<GraphQLError> | ExecutionContext;
|
|
79
72
|
/**
|
|
80
73
|
* @internal
|
|
81
74
|
*/
|
|
82
|
-
export declare function buildResolveInfo(exeContext: ExecutionContext, fieldName: string,
|
|
75
|
+
export declare function buildResolveInfo(exeContext: ExecutionContext, fieldName: string, fieldGroup: FieldGroup, parentTypeName: string, returnTypeName: string, returnTypeNode: TypeNode, path: Path): ResolveInfo;
|
|
83
76
|
/**
|
|
84
77
|
* If a resolveType function is not given, then a default resolve behavior is
|
|
85
78
|
* used which attempts two strategies:
|
|
@@ -99,4 +92,48 @@ export declare const defaultTypeResolver: TypeResolver<unknown, unknown>;
|
|
|
99
92
|
*/
|
|
100
93
|
export declare const defaultFieldResolver: FunctionFieldResolver<unknown, unknown>;
|
|
101
94
|
export declare function getOperationRootTypeName(operation: OperationDefinitionNode | OperationTypeDefinitionNode): string;
|
|
95
|
+
export type IncrementalDataRecord = DeferredFragmentRecord | StreamItemsRecord;
|
|
96
|
+
declare class DeferredFragmentRecord {
|
|
97
|
+
type: "defer";
|
|
98
|
+
errors: Array<GraphQLError>;
|
|
99
|
+
label: string | undefined;
|
|
100
|
+
path: Array<string | number>;
|
|
101
|
+
promise: Promise<void>;
|
|
102
|
+
data: ObjMap<unknown> | null;
|
|
103
|
+
parentContext: IncrementalDataRecord | undefined;
|
|
104
|
+
isCompleted: boolean;
|
|
105
|
+
_exeContext: ExecutionContext;
|
|
106
|
+
_resolve?: (arg: PromiseOrValue<ObjMap<unknown> | null>) => void;
|
|
107
|
+
constructor(opts: {
|
|
108
|
+
label: string | undefined;
|
|
109
|
+
path: Path | undefined;
|
|
110
|
+
parentContext: IncrementalDataRecord | undefined;
|
|
111
|
+
exeContext: ExecutionContext;
|
|
112
|
+
});
|
|
113
|
+
addData(data: PromiseOrValue<ObjMap<unknown> | null>): void;
|
|
114
|
+
}
|
|
115
|
+
declare class StreamItemsRecord {
|
|
116
|
+
type: "stream";
|
|
117
|
+
errors: Array<GraphQLError>;
|
|
118
|
+
label: string | undefined;
|
|
119
|
+
path: Array<string | number>;
|
|
120
|
+
items: Array<unknown> | null;
|
|
121
|
+
promise: Promise<void>;
|
|
122
|
+
parentContext: IncrementalDataRecord | undefined;
|
|
123
|
+
asyncIterator: AsyncIterator<unknown> | undefined;
|
|
124
|
+
isCompletedAsyncIterator?: boolean;
|
|
125
|
+
isCompleted: boolean;
|
|
126
|
+
_exeContext: ExecutionContext;
|
|
127
|
+
_resolve?: (arg: PromiseOrValue<Array<unknown> | null>) => void;
|
|
128
|
+
constructor(opts: {
|
|
129
|
+
label: string | undefined;
|
|
130
|
+
path: Path | undefined;
|
|
131
|
+
asyncIterator?: AsyncIterator<unknown>;
|
|
132
|
+
parentContext: IncrementalDataRecord | undefined;
|
|
133
|
+
exeContext: ExecutionContext;
|
|
134
|
+
});
|
|
135
|
+
addItems(items: PromiseOrValue<Array<unknown> | null>): void;
|
|
136
|
+
setIsCompletedAsyncIterator(): void;
|
|
137
|
+
}
|
|
138
|
+
export {};
|
|
102
139
|
//# sourceMappingURL=executeWithoutSchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeWithoutSchema.d.ts","sourceRoot":"","sources":["../src/executeWithoutSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAOb,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,YAAY,
|
|
1
|
+
{"version":3,"file":"executeWithoutSchema.d.ts","sourceRoot":"","sources":["../src/executeWithoutSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAOb,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,YAAY,EAEZ,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAE3B,QAAQ,EACT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,UAAU,EAEX,MAAM,iBAAiB,CAAC;AAOzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAG3C,OAAO,KAAK,E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