grafast 0.1.1-beta.21 → 0.1.1-beta.22
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/README.md +0 -4
- package/dist/args.js +3 -3
- package/dist/constants.d.ts +79 -0
- package/dist/constants.js +79 -0
- package/dist/engine/LayerPlan.d.ts +71 -8
- package/dist/engine/LayerPlan.js +375 -265
- package/dist/engine/OperationPlan.d.ts +77 -14
- package/dist/engine/OperationPlan.js +1508 -382
- package/dist/engine/OperationPlanTypes.d.ts +66 -0
- package/dist/engine/OperationPlanTypes.js +3 -0
- package/dist/engine/OutputPlan.d.ts +6 -0
- package/dist/engine/OutputPlan.js +138 -82
- package/dist/engine/StepTracker.js +76 -17
- package/dist/engine/executeBucket.js +327 -166
- package/dist/engine/lib/defaultPlanResolver.d.ts +1 -4
- package/dist/engine/lib/defaultPlanResolver.js +1 -5
- package/dist/engine/lib/withGlobalLayerPlan.d.ts +3 -1
- package/dist/engine/lib/withGlobalLayerPlan.js +19 -1
- package/dist/envelop.js +14 -3
- package/dist/error.d.ts +1 -1
- package/dist/error.js +9 -9
- package/dist/establishOperationPlan.d.ts +2 -1
- package/dist/establishOperationPlan.js +10 -10
- package/dist/execute.js +7 -5
- package/dist/global.d.ts +10 -0
- package/dist/global.js +25 -0
- package/dist/grafastGraphql.js +4 -3
- package/dist/grafastPrint.js +36 -4
- package/dist/index.d.ts +76 -8
- package/dist/index.js +37 -33
- package/dist/input.js +20 -1
- package/dist/inspect.js +1 -0
- package/dist/interfaces.d.ts +80 -122
- package/dist/interfaces.js +0 -77
- package/dist/makeGrafastSchema.d.ts +118 -35
- package/dist/makeGrafastSchema.js +197 -29
- package/dist/mermaid.js +198 -97
- package/dist/operationPlan-input.d.ts +1 -1
- package/dist/operationPlan-input.js +15 -5
- package/dist/planJSONInterfaces.d.ts +24 -5
- package/dist/prepare.d.ts +16 -9
- package/dist/prepare.js +54 -51
- package/dist/step.d.ts +45 -9
- package/dist/step.js +139 -22
- package/dist/steps/__flag.d.ts +3 -2
- package/dist/steps/__flag.js +31 -29
- package/dist/steps/__inputObject.d.ts +1 -1
- package/dist/steps/__inputStaticLeaf.d.ts +3 -2
- package/dist/steps/__inputStaticLeaf.js +13 -7
- package/dist/steps/__item.d.ts +1 -1
- package/dist/steps/__item.js +3 -3
- package/dist/steps/__trackedValue.d.ts +6 -3
- package/dist/steps/__trackedValue.js +25 -9
- package/dist/steps/__value.d.ts +2 -1
- package/dist/steps/__value.js +5 -0
- package/dist/steps/access.d.ts +17 -1
- package/dist/steps/access.js +14 -1
- package/dist/steps/applyInput.d.ts +1 -1
- package/dist/steps/applyInput.js +7 -6
- package/dist/steps/applyTransforms.js +9 -7
- package/dist/steps/bakedInput.js +2 -2
- package/dist/steps/coalesce.d.ts +15 -0
- package/dist/steps/coalesce.js +36 -0
- package/dist/steps/constant.js +16 -14
- package/dist/steps/each.d.ts +2 -2
- package/dist/steps/first.d.ts +2 -0
- package/dist/steps/first.js +5 -1
- package/dist/steps/graphqlResolver.d.ts +2 -2
- package/dist/steps/graphqlResolver.js +63 -161
- package/dist/steps/index.d.ts +3 -15
- package/dist/steps/index.js +6 -41
- package/dist/steps/lambda.js +1 -1
- package/dist/steps/last.d.ts +2 -0
- package/dist/steps/last.js +4 -0
- package/dist/steps/listTransform.d.ts +2 -2
- package/dist/steps/listTransform.js +11 -13
- package/dist/steps/load.d.ts +28 -22
- package/dist/steps/load.js +47 -1
- package/dist/steps/node.d.ts +10 -7
- package/dist/steps/node.js +5 -19
- package/dist/steps/object.js +6 -1
- package/dist/steps/proxy.d.ts +0 -6
- package/dist/steps/proxy.js +3 -3
- package/dist/steps/remapKeys.d.ts +1 -1
- package/dist/steps/remapKeys.js +0 -1
- package/dist/utils.d.ts +27 -5
- package/dist/utils.js +235 -15
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -6
- package/dist/polymorphic.d.ts +0 -14
- package/dist/polymorphic.js +0 -72
- package/dist/steps/polymorphicBranch.d.ts +0 -27
- package/dist/steps/polymorphicBranch.js +0 -62
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.DeepEvalStep = exports.deepEval = void 0;
|
|
3
|
+
exports.error = exports.EdgeStep = exports.each = exports.defer = exports.defaultPlanResolver = exports.DEFAULT_ACCEPT_FLAGS = exports.debugPlans = exports.createObjectAndApplyChildren = exports.context = exports.ConstantStep = exports.constant = exports.ConnectionStep = exports.connection = exports.ConditionStep = exports.condition = exports.CoalesceStep = exports.coalesce = exports.BakedInputStep = exports.bakedInputRuntime = exports.bakedInput = exports.assertStep = exports.assertPageInfoCapableStep = exports.assertNotNull = exports.assertModifier = exports.assertListCapableStep = exports.assertExecutableStep = exports.assertEdgeCapableStep = exports.arraysMatch = exports.arrayOfLength = exports.ApplyTransformsStep = exports.applyTransforms = exports.ApplyInputStep = exports.applyInput = exports.AccessStep = exports.access = exports.$$verbatim = exports.$$inhibit = exports.$$idempotent = exports.$$extensions = exports.$$eventEmitter = exports.$$bypassGraphQL = exports.__ValueStep = exports.__TrackedValueStep = exports.__ListTransformStep = exports.__ItemStep = exports.__InputStaticLeafStep = exports.__InputObjectStep = exports.__InputListStep = exports.__FlagStep = exports.isAsyncIterable = void 0;
|
|
4
|
+
exports.LoadStep = exports.loadOneCallback = exports.loadOne = exports.loadManyCallback = exports.loadMany = exports.LoadedRecordStep = exports.listTransform = exports.ListStep = exports.ListenStep = exports.listen = exports.list = exports.LastStep = exports.last = exports.LambdaStep = exports.lambda = exports.isUnaryStep = exports.isStep = exports.isSafeError = exports.isPromiseLike = exports.isObjectLikeStep = exports.isModifier = exports.isListLikeStep = exports.isListCapableStep = exports.isExecutableStep = exports.isDev = exports.inspect = exports.inputObjectFieldSpec = exports.inhibitOnNull = exports.groupBy = exports.GraphQLResolverStep = exports.graphqlResolver = exports.grafastSync = exports.grafastPrint = exports.grafastGraphqlSync = exports.grafastGraphql = exports.grafast = exports.getNullableInputTypeAtPath = exports.getGrafastMiddleware = exports.getEnumValueConfigs = exports.getEnumValueConfig = exports.get = exports.flagError = exports.FirstStep = exports.first = exports.filter = exports.exportAsMany = exports.exportAs = exports.execute = exports.ExecutableStep = exports.ErrorStep = void 0;
|
|
5
|
+
exports.UnbatchedStep = exports.UnbatchedExecutableStep = exports.TRAP_INHIBITED = exports.TRAP_ERROR_OR_INHIBITED = exports.TRAP_ERROR = exports.trap = exports.subscribe = exports.stripAnsi = exports.stringifyPayload = exports.stepsAreInSamePhase = exports.stepAShouldTryAndInlineIntoStepB = exports.stepAMayDependOnStepB = exports.stepADependsOnStepB = exports.Step = exports.specFromNodeId = exports.SideEffectStep = exports.sideEffect = exports.setter = exports.Setter = exports.setsMatch = exports.SafeError = exports.rootValue = exports.ReverseStep = exports.reverseArray = exports.reverse = exports.RemapKeysStep = exports.remapKeys = exports.recordsMatch = exports.ProxyStep = exports.proxy = exports.partitionByIndex = exports.operationPlan = exports.OperationPlan = exports.ObjectStep = exports.objectSpec = exports.objectFieldSpec = exports.object = exports.noop = exports.NodeStep = exports.nodeIdFromNode = exports.node = exports.newObjectTypeBuilder = exports.newInputObjectTypeBuilder = exports.newGrafastFieldConfigBuilder = exports.multistep = exports.Modifier = exports.mapsMatch = exports.makeGrafastSchema = exports.makeDecodeNodeIdRuntime = exports.makeDecodeNodeId = void 0;
|
|
6
|
+
exports.DeepEvalStep = exports.deepEval = exports.version = exports.hookArgs = void 0;
|
|
7
7
|
const tslib_1 = require("tslib");
|
|
8
8
|
require("./thereCanBeOnlyOne.js");
|
|
9
9
|
const debug_1 = tslib_1.__importDefault(require("debug"));
|
|
@@ -16,6 +16,13 @@ const makeGrafastSchema_js_1 = require("./makeGrafastSchema.js");
|
|
|
16
16
|
Object.defineProperty(exports, "makeGrafastSchema", { enumerable: true, get: function () { return makeGrafastSchema_js_1.makeGrafastSchema; } });
|
|
17
17
|
// HACK: doing this here feels "naughty".
|
|
18
18
|
debug_1.default.formatters.c = grafastPrint_js_1.grafastPrint;
|
|
19
|
+
const constants_js_1 = require("./constants.js");
|
|
20
|
+
Object.defineProperty(exports, "$$bypassGraphQL", { enumerable: true, get: function () { return constants_js_1.$$bypassGraphQL; } });
|
|
21
|
+
Object.defineProperty(exports, "$$eventEmitter", { enumerable: true, get: function () { return constants_js_1.$$eventEmitter; } });
|
|
22
|
+
Object.defineProperty(exports, "$$extensions", { enumerable: true, get: function () { return constants_js_1.$$extensions; } });
|
|
23
|
+
Object.defineProperty(exports, "$$idempotent", { enumerable: true, get: function () { return constants_js_1.$$idempotent; } });
|
|
24
|
+
Object.defineProperty(exports, "$$verbatim", { enumerable: true, get: function () { return constants_js_1.$$verbatim; } });
|
|
25
|
+
Object.defineProperty(exports, "DEFAULT_ACCEPT_FLAGS", { enumerable: true, get: function () { return constants_js_1.DEFAULT_ACCEPT_FLAGS; } });
|
|
19
26
|
const deferred_js_1 = require("./deferred.js");
|
|
20
27
|
Object.defineProperty(exports, "defer", { enumerable: true, get: function () { return deferred_js_1.defer; } });
|
|
21
28
|
// Handy for debugging
|
|
@@ -35,25 +42,24 @@ Object.defineProperty(exports, "isSafeError", { enumerable: true, get: function
|
|
|
35
42
|
Object.defineProperty(exports, "SafeError", { enumerable: true, get: function () { return error_js_1.SafeError; } });
|
|
36
43
|
const execute_js_1 = require("./execute.js");
|
|
37
44
|
Object.defineProperty(exports, "execute", { enumerable: true, get: function () { return execute_js_1.execute; } });
|
|
45
|
+
const global_js_1 = require("./global.js");
|
|
46
|
+
Object.defineProperty(exports, "context", { enumerable: true, get: function () { return global_js_1.context; } });
|
|
47
|
+
Object.defineProperty(exports, "debugPlans", { enumerable: true, get: function () { return global_js_1.debugPlans; } });
|
|
48
|
+
Object.defineProperty(exports, "operationPlan", { enumerable: true, get: function () { return global_js_1.operationPlan; } });
|
|
49
|
+
Object.defineProperty(exports, "rootValue", { enumerable: true, get: function () { return global_js_1.rootValue; } });
|
|
38
50
|
const grafastGraphql_js_1 = require("./grafastGraphql.js");
|
|
39
51
|
Object.defineProperty(exports, "grafast", { enumerable: true, get: function () { return grafastGraphql_js_1.grafast; } });
|
|
40
52
|
Object.defineProperty(exports, "grafastGraphql", { enumerable: true, get: function () { return grafastGraphql_js_1.grafast; } });
|
|
41
53
|
Object.defineProperty(exports, "grafastGraphqlSync", { enumerable: true, get: function () { return grafastGraphql_js_1.grafastSync; } });
|
|
42
54
|
Object.defineProperty(exports, "grafastSync", { enumerable: true, get: function () { return grafastGraphql_js_1.grafastSync; } });
|
|
43
|
-
const
|
|
44
|
-
Object.defineProperty(exports, "
|
|
45
|
-
Object.defineProperty(exports, "$$eventEmitter", { enumerable: true, get: function () { return interfaces_js_1.$$eventEmitter; } });
|
|
46
|
-
Object.defineProperty(exports, "$$extensions", { enumerable: true, get: function () { return interfaces_js_1.$$extensions; } });
|
|
47
|
-
Object.defineProperty(exports, "$$idempotent", { enumerable: true, get: function () { return interfaces_js_1.$$idempotent; } });
|
|
48
|
-
Object.defineProperty(exports, "$$verbatim", { enumerable: true, get: function () { return interfaces_js_1.$$verbatim; } });
|
|
55
|
+
const inspect_js_1 = require("./inspect.js");
|
|
56
|
+
Object.defineProperty(exports, "inspect", { enumerable: true, get: function () { return inspect_js_1.inspect; } });
|
|
49
57
|
const middleware_js_1 = require("./middleware.js");
|
|
50
58
|
Object.defineProperty(exports, "getGrafastMiddleware", { enumerable: true, get: function () { return middleware_js_1.getGrafastMiddleware; } });
|
|
51
59
|
const multistep_js_1 = require("./multistep.js");
|
|
52
60
|
Object.defineProperty(exports, "multistep", { enumerable: true, get: function () { return multistep_js_1.multistep; } });
|
|
53
61
|
const operationPlan_input_js_1 = require("./operationPlan-input.js");
|
|
54
62
|
Object.defineProperty(exports, "getNullableInputTypeAtPath", { enumerable: true, get: function () { return operationPlan_input_js_1.getNullableInputTypeAtPath; } });
|
|
55
|
-
const polymorphic_js_1 = require("./polymorphic.js");
|
|
56
|
-
Object.defineProperty(exports, "polymorphicWrap", { enumerable: true, get: function () { return polymorphic_js_1.polymorphicWrap; } });
|
|
57
63
|
const step_js_1 = require("./step.js");
|
|
58
64
|
Object.defineProperty(exports, "assertExecutableStep", { enumerable: true, get: function () { return step_js_1.assertExecutableStep; } });
|
|
59
65
|
Object.defineProperty(exports, "assertListCapableStep", { enumerable: true, get: function () { return step_js_1.assertListCapableStep; } });
|
|
@@ -89,15 +95,15 @@ Object.defineProperty(exports, "assertPageInfoCapableStep", { enumerable: true,
|
|
|
89
95
|
Object.defineProperty(exports, "bakedInput", { enumerable: true, get: function () { return index_js_1.bakedInput; } });
|
|
90
96
|
Object.defineProperty(exports, "bakedInputRuntime", { enumerable: true, get: function () { return index_js_1.bakedInputRuntime; } });
|
|
91
97
|
Object.defineProperty(exports, "BakedInputStep", { enumerable: true, get: function () { return index_js_1.BakedInputStep; } });
|
|
98
|
+
Object.defineProperty(exports, "coalesce", { enumerable: true, get: function () { return index_js_1.coalesce; } });
|
|
99
|
+
Object.defineProperty(exports, "CoalesceStep", { enumerable: true, get: function () { return index_js_1.CoalesceStep; } });
|
|
92
100
|
Object.defineProperty(exports, "condition", { enumerable: true, get: function () { return index_js_1.condition; } });
|
|
93
101
|
Object.defineProperty(exports, "ConditionStep", { enumerable: true, get: function () { return index_js_1.ConditionStep; } });
|
|
94
102
|
Object.defineProperty(exports, "connection", { enumerable: true, get: function () { return index_js_1.connection; } });
|
|
95
103
|
Object.defineProperty(exports, "ConnectionStep", { enumerable: true, get: function () { return index_js_1.ConnectionStep; } });
|
|
96
104
|
Object.defineProperty(exports, "constant", { enumerable: true, get: function () { return index_js_1.constant; } });
|
|
97
105
|
Object.defineProperty(exports, "ConstantStep", { enumerable: true, get: function () { return index_js_1.ConstantStep; } });
|
|
98
|
-
Object.defineProperty(exports, "context", { enumerable: true, get: function () { return index_js_1.context; } });
|
|
99
106
|
Object.defineProperty(exports, "createObjectAndApplyChildren", { enumerable: true, get: function () { return index_js_1.createObjectAndApplyChildren; } });
|
|
100
|
-
Object.defineProperty(exports, "debugPlans", { enumerable: true, get: function () { return index_js_1.debugPlans; } });
|
|
101
107
|
Object.defineProperty(exports, "each", { enumerable: true, get: function () { return index_js_1.each; } });
|
|
102
108
|
Object.defineProperty(exports, "EdgeStep", { enumerable: true, get: function () { return index_js_1.EdgeStep; } });
|
|
103
109
|
Object.defineProperty(exports, "error", { enumerable: true, get: function () { return index_js_1.error; } });
|
|
@@ -105,8 +111,7 @@ Object.defineProperty(exports, "ErrorStep", { enumerable: true, get: function ()
|
|
|
105
111
|
Object.defineProperty(exports, "filter", { enumerable: true, get: function () { return index_js_1.filter; } });
|
|
106
112
|
Object.defineProperty(exports, "first", { enumerable: true, get: function () { return index_js_1.first; } });
|
|
107
113
|
Object.defineProperty(exports, "FirstStep", { enumerable: true, get: function () { return index_js_1.FirstStep; } });
|
|
108
|
-
Object.defineProperty(exports, "
|
|
109
|
-
Object.defineProperty(exports, "graphqlItemHandler", { enumerable: true, get: function () { return index_js_1.graphqlItemHandler; } });
|
|
114
|
+
Object.defineProperty(exports, "get", { enumerable: true, get: function () { return index_js_1.get; } });
|
|
110
115
|
Object.defineProperty(exports, "graphqlResolver", { enumerable: true, get: function () { return index_js_1.graphqlResolver; } });
|
|
111
116
|
Object.defineProperty(exports, "GraphQLResolverStep", { enumerable: true, get: function () { return index_js_1.GraphQLResolverStep; } });
|
|
112
117
|
Object.defineProperty(exports, "groupBy", { enumerable: true, get: function () { return index_js_1.groupBy; } });
|
|
@@ -135,10 +140,7 @@ Object.defineProperty(exports, "nodeIdFromNode", { enumerable: true, get: functi
|
|
|
135
140
|
Object.defineProperty(exports, "NodeStep", { enumerable: true, get: function () { return index_js_1.NodeStep; } });
|
|
136
141
|
Object.defineProperty(exports, "object", { enumerable: true, get: function () { return index_js_1.object; } });
|
|
137
142
|
Object.defineProperty(exports, "ObjectStep", { enumerable: true, get: function () { return index_js_1.ObjectStep; } });
|
|
138
|
-
Object.defineProperty(exports, "operationPlan", { enumerable: true, get: function () { return index_js_1.operationPlan; } });
|
|
139
143
|
Object.defineProperty(exports, "partitionByIndex", { enumerable: true, get: function () { return index_js_1.partitionByIndex; } });
|
|
140
|
-
Object.defineProperty(exports, "polymorphicBranch", { enumerable: true, get: function () { return index_js_1.polymorphicBranch; } });
|
|
141
|
-
Object.defineProperty(exports, "PolymorphicBranchStep", { enumerable: true, get: function () { return index_js_1.PolymorphicBranchStep; } });
|
|
142
144
|
Object.defineProperty(exports, "proxy", { enumerable: true, get: function () { return index_js_1.proxy; } });
|
|
143
145
|
Object.defineProperty(exports, "ProxyStep", { enumerable: true, get: function () { return index_js_1.ProxyStep; } });
|
|
144
146
|
Object.defineProperty(exports, "remapKeys", { enumerable: true, get: function () { return index_js_1.remapKeys; } });
|
|
@@ -146,14 +148,11 @@ Object.defineProperty(exports, "RemapKeysStep", { enumerable: true, get: functio
|
|
|
146
148
|
Object.defineProperty(exports, "reverse", { enumerable: true, get: function () { return index_js_1.reverse; } });
|
|
147
149
|
Object.defineProperty(exports, "reverseArray", { enumerable: true, get: function () { return index_js_1.reverseArray; } });
|
|
148
150
|
Object.defineProperty(exports, "ReverseStep", { enumerable: true, get: function () { return index_js_1.ReverseStep; } });
|
|
149
|
-
Object.defineProperty(exports, "rootValue", { enumerable: true, get: function () { return index_js_1.rootValue; } });
|
|
150
151
|
Object.defineProperty(exports, "Setter", { enumerable: true, get: function () { return index_js_1.Setter; } });
|
|
151
152
|
Object.defineProperty(exports, "setter", { enumerable: true, get: function () { return index_js_1.setter; } });
|
|
152
153
|
Object.defineProperty(exports, "sideEffect", { enumerable: true, get: function () { return index_js_1.sideEffect; } });
|
|
153
154
|
Object.defineProperty(exports, "SideEffectStep", { enumerable: true, get: function () { return index_js_1.SideEffectStep; } });
|
|
154
155
|
Object.defineProperty(exports, "specFromNodeId", { enumerable: true, get: function () { return index_js_1.specFromNodeId; } });
|
|
155
|
-
Object.defineProperty(exports, "trackedContext", { enumerable: true, get: function () { return index_js_1.trackedContext; } });
|
|
156
|
-
Object.defineProperty(exports, "trackedRootValue", { enumerable: true, get: function () { return index_js_1.trackedRootValue; } });
|
|
157
156
|
Object.defineProperty(exports, "trap", { enumerable: true, get: function () { return index_js_1.trap; } });
|
|
158
157
|
Object.defineProperty(exports, "TRAP_ERROR", { enumerable: true, get: function () { return index_js_1.TRAP_ERROR; } });
|
|
159
158
|
Object.defineProperty(exports, "TRAP_ERROR_OR_INHIBITED", { enumerable: true, get: function () { return index_js_1.TRAP_ERROR_OR_INHIBITED; } });
|
|
@@ -171,13 +170,17 @@ Object.defineProperty(exports, "getEnumValueConfig", { enumerable: true, get: fu
|
|
|
171
170
|
Object.defineProperty(exports, "getEnumValueConfigs", { enumerable: true, get: function () { return utils_js_1.getEnumValueConfigs; } });
|
|
172
171
|
Object.defineProperty(exports, "inputObjectFieldSpec", { enumerable: true, get: function () { return utils_js_1.inputObjectFieldSpec; } });
|
|
173
172
|
Object.defineProperty(exports, "isPromiseLike", { enumerable: true, get: function () { return utils_js_1.isPromiseLike; } });
|
|
173
|
+
Object.defineProperty(exports, "mapsMatch", { enumerable: true, get: function () { return utils_js_1.mapsMatch; } });
|
|
174
174
|
Object.defineProperty(exports, "newGrafastFieldConfigBuilder", { enumerable: true, get: function () { return utils_js_1.newGrafastFieldConfigBuilder; } });
|
|
175
175
|
Object.defineProperty(exports, "newInputObjectTypeBuilder", { enumerable: true, get: function () { return utils_js_1.newInputObjectTypeBuilder; } });
|
|
176
176
|
Object.defineProperty(exports, "newObjectTypeBuilder", { enumerable: true, get: function () { return utils_js_1.newObjectTypeBuilder; } });
|
|
177
177
|
Object.defineProperty(exports, "objectFieldSpec", { enumerable: true, get: function () { return utils_js_1.objectFieldSpec; } });
|
|
178
178
|
Object.defineProperty(exports, "objectSpec", { enumerable: true, get: function () { return utils_js_1.objectSpec; } });
|
|
179
|
+
Object.defineProperty(exports, "recordsMatch", { enumerable: true, get: function () { return utils_js_1.recordsMatch; } });
|
|
180
|
+
Object.defineProperty(exports, "setsMatch", { enumerable: true, get: function () { return utils_js_1.setsMatch; } });
|
|
179
181
|
Object.defineProperty(exports, "stepADependsOnStepB", { enumerable: true, get: function () { return utils_js_1.stepADependsOnStepB; } });
|
|
180
182
|
Object.defineProperty(exports, "stepAMayDependOnStepB", { enumerable: true, get: function () { return utils_js_1.stepAMayDependOnStepB; } });
|
|
183
|
+
Object.defineProperty(exports, "stepAShouldTryAndInlineIntoStepB", { enumerable: true, get: function () { return utils_js_1.stepAShouldTryAndInlineIntoStepB; } });
|
|
181
184
|
Object.defineProperty(exports, "stepsAreInSamePhase", { enumerable: true, get: function () { return utils_js_1.stepsAreInSamePhase; } });
|
|
182
185
|
var iterall_1 = require("iterall");
|
|
183
186
|
Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: function () { return iterall_1.isAsyncIterable; } });
|
|
@@ -211,14 +214,16 @@ Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: funct
|
|
|
211
214
|
__ListTransformStep: index_js_1.__ListTransformStep,
|
|
212
215
|
__TrackedValueStep: index_js_1.__TrackedValueStep,
|
|
213
216
|
__ValueStep: index_js_1.__ValueStep,
|
|
217
|
+
inspect: inspect_js_1.inspect,
|
|
214
218
|
access: index_js_1.access,
|
|
219
|
+
get: index_js_1.get,
|
|
215
220
|
AccessStep: index_js_1.AccessStep,
|
|
216
221
|
applyInput: index_js_1.applyInput,
|
|
217
222
|
ApplyInputStep: index_js_1.ApplyInputStep,
|
|
218
223
|
bakedInput: index_js_1.bakedInput,
|
|
219
224
|
bakedInputRuntime: index_js_1.bakedInputRuntime,
|
|
220
225
|
BakedInputStep: index_js_1.BakedInputStep,
|
|
221
|
-
operationPlan:
|
|
226
|
+
operationPlan: global_js_1.operationPlan,
|
|
222
227
|
connection: index_js_1.connection,
|
|
223
228
|
assertEdgeCapableStep: index_js_1.assertEdgeCapableStep,
|
|
224
229
|
assertPageInfoCapableStep: index_js_1.assertPageInfoCapableStep,
|
|
@@ -228,10 +233,8 @@ Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: funct
|
|
|
228
233
|
ConditionStep: index_js_1.ConditionStep,
|
|
229
234
|
constant: index_js_1.constant,
|
|
230
235
|
ConstantStep: index_js_1.ConstantStep,
|
|
231
|
-
context:
|
|
232
|
-
rootValue:
|
|
233
|
-
trackedContext: index_js_1.trackedContext,
|
|
234
|
-
trackedRootValue: index_js_1.trackedRootValue,
|
|
236
|
+
context: global_js_1.context,
|
|
237
|
+
rootValue: global_js_1.rootValue,
|
|
235
238
|
inhibitOnNull: index_js_1.inhibitOnNull,
|
|
236
239
|
assertNotNull: index_js_1.assertNotNull,
|
|
237
240
|
trap: index_js_1.trap,
|
|
@@ -239,7 +242,7 @@ Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: funct
|
|
|
239
242
|
TRAP_ERROR: index_js_1.TRAP_ERROR,
|
|
240
243
|
TRAP_ERROR_OR_INHIBITED: index_js_1.TRAP_ERROR_OR_INHIBITED,
|
|
241
244
|
TRAP_INHIBITED: index_js_1.TRAP_INHIBITED,
|
|
242
|
-
debugPlans:
|
|
245
|
+
debugPlans: global_js_1.debugPlans,
|
|
243
246
|
each: index_js_1.each,
|
|
244
247
|
error: index_js_1.error,
|
|
245
248
|
ErrorStep: index_js_1.ErrorStep,
|
|
@@ -247,12 +250,12 @@ Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: funct
|
|
|
247
250
|
filter: index_js_1.filter,
|
|
248
251
|
partitionByIndex: index_js_1.partitionByIndex,
|
|
249
252
|
listTransform: index_js_1.listTransform,
|
|
253
|
+
coalesce: index_js_1.coalesce,
|
|
254
|
+
CoalesceStep: index_js_1.CoalesceStep,
|
|
250
255
|
first: index_js_1.first,
|
|
251
256
|
node: index_js_1.node,
|
|
252
257
|
specFromNodeId: index_js_1.specFromNodeId,
|
|
253
258
|
nodeIdFromNode: index_js_1.nodeIdFromNode,
|
|
254
|
-
polymorphicBranch: index_js_1.polymorphicBranch,
|
|
255
|
-
PolymorphicBranchStep: index_js_1.PolymorphicBranchStep,
|
|
256
259
|
makeDecodeNodeId: index_js_1.makeDecodeNodeId,
|
|
257
260
|
makeDecodeNodeIdRuntime: index_js_1.makeDecodeNodeIdRuntime,
|
|
258
261
|
proxy: index_js_1.proxy,
|
|
@@ -261,8 +264,6 @@ Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: funct
|
|
|
261
264
|
ProxyStep: index_js_1.ProxyStep,
|
|
262
265
|
graphqlResolver: index_js_1.graphqlResolver,
|
|
263
266
|
GraphQLResolverStep: index_js_1.GraphQLResolverStep,
|
|
264
|
-
GraphQLItemHandler: index_js_1.GraphQLItemHandler,
|
|
265
|
-
graphqlItemHandler: index_js_1.graphqlItemHandler,
|
|
266
267
|
NodeStep: index_js_1.NodeStep,
|
|
267
268
|
FirstStep: index_js_1.FirstStep,
|
|
268
269
|
last: index_js_1.last,
|
|
@@ -285,9 +286,11 @@ Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: funct
|
|
|
285
286
|
Setter: index_js_1.Setter,
|
|
286
287
|
listen: index_js_1.listen,
|
|
287
288
|
ListenStep: index_js_1.ListenStep,
|
|
288
|
-
polymorphicWrap: polymorphic_js_1.polymorphicWrap,
|
|
289
289
|
stripAnsi: stripAnsi_js_1.stripAnsi,
|
|
290
290
|
arraysMatch: utils_js_1.arraysMatch,
|
|
291
|
+
mapsMatch: utils_js_1.mapsMatch,
|
|
292
|
+
recordsMatch: utils_js_1.recordsMatch,
|
|
293
|
+
setsMatch: utils_js_1.setsMatch,
|
|
291
294
|
inputObjectFieldSpec: utils_js_1.inputObjectFieldSpec,
|
|
292
295
|
newGrafastFieldConfigBuilder: utils_js_1.newGrafastFieldConfigBuilder,
|
|
293
296
|
newInputObjectTypeBuilder: utils_js_1.newInputObjectTypeBuilder,
|
|
@@ -298,6 +301,7 @@ Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: funct
|
|
|
298
301
|
stepADependsOnStepB: utils_js_1.stepADependsOnStepB,
|
|
299
302
|
stepAMayDependOnStepB: utils_js_1.stepAMayDependOnStepB,
|
|
300
303
|
stepsAreInSamePhase: utils_js_1.stepsAreInSamePhase,
|
|
304
|
+
stepAShouldTryAndInlineIntoStepB: utils_js_1.stepAShouldTryAndInlineIntoStepB,
|
|
301
305
|
isPromiseLike: utils_js_1.isPromiseLike,
|
|
302
306
|
isDev: dev_js_1.isDev,
|
|
303
307
|
noop: dev_js_1.noop,
|
package/dist/input.js
CHANGED
|
@@ -9,6 +9,7 @@ const inspect_js_1 = require("./inspect.js");
|
|
|
9
9
|
const __inputDefault_js_1 = require("./steps/__inputDefault.js");
|
|
10
10
|
const __inputDynamicScalar_js_1 = require("./steps/__inputDynamicScalar.js");
|
|
11
11
|
const __inputObject_js_1 = require("./steps/__inputObject.js");
|
|
12
|
+
const __inputStaticLeaf_js_1 = require("./steps/__inputStaticLeaf.js");
|
|
12
13
|
const index_js_1 = require("./steps/index.js");
|
|
13
14
|
const utils_js_1 = require("./utils.js");
|
|
14
15
|
const { assertScalarType, GraphQLError, GraphQLList, GraphQLNonNull, isInputType, isLeafType, isInputObjectType, Kind, } = graphql;
|
|
@@ -52,6 +53,24 @@ function graphqlGetTypeForNode(operationPlan, node) {
|
|
|
52
53
|
* @internal
|
|
53
54
|
*/
|
|
54
55
|
function inputStep(operationPlan, inputType, inputValue, defaultValue = undefined) {
|
|
56
|
+
let c1 = operationPlan._inputStepCache.get(inputType);
|
|
57
|
+
if (!c1) {
|
|
58
|
+
c1 = new Map();
|
|
59
|
+
operationPlan._inputStepCache.set(inputType, c1);
|
|
60
|
+
}
|
|
61
|
+
let c2 = c1.get(inputValue);
|
|
62
|
+
if (!c2) {
|
|
63
|
+
c2 = new Map();
|
|
64
|
+
c1.set(inputValue, c2);
|
|
65
|
+
}
|
|
66
|
+
let c3 = c2.get(defaultValue);
|
|
67
|
+
if (c3)
|
|
68
|
+
return c3;
|
|
69
|
+
c3 = _inputStep(operationPlan, inputType, inputValue, defaultValue);
|
|
70
|
+
c2.set(defaultValue, c3);
|
|
71
|
+
return c3;
|
|
72
|
+
}
|
|
73
|
+
function _inputStep(operationPlan, inputType, inputValue, defaultValue) {
|
|
55
74
|
const { valueNodeToStaticValueCache } = operationPlan;
|
|
56
75
|
if (inputValue === undefined) {
|
|
57
76
|
// Definitely can't be or contain a variable!
|
|
@@ -108,7 +127,7 @@ function inputStep(operationPlan, inputType, inputValue, defaultValue = undefine
|
|
|
108
127
|
else {
|
|
109
128
|
// Variable is already ruled out, so it must be one of: Kind.INT | Kind.FLOAT | Kind.STRING | Kind.BOOLEAN | Kind.NULL | Kind.ENUM
|
|
110
129
|
// none of which can contain a variable:
|
|
111
|
-
return
|
|
130
|
+
return (0, __inputStaticLeaf_js_1.__inputStaticLeaf)(inputType, inputValue);
|
|
112
131
|
}
|
|
113
132
|
}
|
|
114
133
|
else if (isObj) {
|
package/dist/inspect.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.inspect = void 0;
|
|
4
4
|
try {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
5
6
|
exports.inspect = require("util").inspect;
|
|
6
7
|
if (typeof exports.inspect !== "function") {
|
|
7
8
|
throw new Error("Failed to load inspect");
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import type EventEmitter from "eventemitter3";
|
|
2
2
|
import type { Middleware } from "graphile-config";
|
|
3
|
-
import type { ASTNode, ExecutionArgs, FragmentDefinitionNode, GraphQLArgs, GraphQLArgument, GraphQLArgumentConfig, GraphQLField, GraphQLFieldConfig, GraphQLInputField, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLInputType,
|
|
3
|
+
import type { ASTNode, ExecutionArgs, FragmentDefinitionNode, GraphQLArgs, GraphQLArgument, GraphQLArgumentConfig, GraphQLField, GraphQLFieldConfig, GraphQLInputField, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLObjectType, GraphQLOutputType, GraphQLScalarType, GraphQLSchema, GraphQLUnionType, OperationDefinitionNode, Source, ValueNode, VariableNode } from "graphql";
|
|
4
4
|
import type { ObjMap } from "graphql/jsutils/ObjMap.js";
|
|
5
|
+
import type { $$streamMore, $$timeout, $$ts, ExecutionEntryFlags } from "./constants.js";
|
|
5
6
|
import type { Constraint } from "./constraints.js";
|
|
6
7
|
import type { LayerPlanReasonListItemStream } from "./engine/LayerPlan.js";
|
|
7
8
|
import type { OperationPlan } from "./engine/OperationPlan.js";
|
|
8
9
|
import type { FlaggedValue, SafeError } from "./error.js";
|
|
9
|
-
import type {
|
|
10
|
+
import type { GrafastOperationOptions } from "./prepare.js";
|
|
11
|
+
import type { Step } from "./step.js";
|
|
10
12
|
import type { __InputDefaultStep } from "./steps/__inputDefault.js";
|
|
11
13
|
import type { __InputDynamicScalarStep } from "./steps/__inputDynamicScalar.js";
|
|
12
14
|
import type { ApplyableExecutableStep } from "./steps/applyInput.js";
|
|
13
15
|
import type { __InputListStep, __InputObjectStepWithDollars, __InputStaticLeafStep, __TrackedValueStepWithDollars, ConstantStep, ObjectStep } from "./steps/index.js";
|
|
14
|
-
|
|
16
|
+
export type { ExecutionEntryFlags };
|
|
15
17
|
export interface GrafastTimeouts {
|
|
16
18
|
/**
|
|
17
19
|
* How many milliseconds should we allow for planning. Remember: planning is
|
|
@@ -32,13 +34,6 @@ export interface GrafastTimeouts {
|
|
|
32
34
|
*/
|
|
33
35
|
execution?: number;
|
|
34
36
|
}
|
|
35
|
-
export declare const $$queryCache: unique symbol;
|
|
36
|
-
/**
|
|
37
|
-
* We store the cache directly onto the GraphQLSchema so that it gets garbage
|
|
38
|
-
* collected along with the schema when it's not needed any more. To do so, we
|
|
39
|
-
* attach it using this symbol.
|
|
40
|
-
*/
|
|
41
|
-
export declare const $$cacheByOperation: unique symbol;
|
|
42
37
|
export type Fragments = {
|
|
43
38
|
[key: string]: FragmentDefinitionNode;
|
|
44
39
|
};
|
|
@@ -83,62 +78,6 @@ export interface LinkedList<T> {
|
|
|
83
78
|
value: T;
|
|
84
79
|
next: LinkedList<T> | null;
|
|
85
80
|
}
|
|
86
|
-
export declare const $$hooked: unique symbol;
|
|
87
|
-
export declare const $$grafastContext: unique symbol;
|
|
88
|
-
export declare const $$planResults: unique symbol;
|
|
89
|
-
export declare const $$id: unique symbol;
|
|
90
|
-
/** Return the value verbatim, don't execute */
|
|
91
|
-
export declare const $$verbatim: unique symbol;
|
|
92
|
-
/**
|
|
93
|
-
* If we're sure the data is the right shape and valid, we can set this key and
|
|
94
|
-
* it can be returned directly
|
|
95
|
-
*/
|
|
96
|
-
export declare const $$bypassGraphQL: unique symbol;
|
|
97
|
-
export declare const $$data: unique symbol;
|
|
98
|
-
/**
|
|
99
|
-
* For attaching additional metadata to the GraphQL execution result, for
|
|
100
|
-
* example details of the plan or SQL queries or similar that were executed.
|
|
101
|
-
*/
|
|
102
|
-
export declare const $$extensions: unique symbol;
|
|
103
|
-
/**
|
|
104
|
-
* The "GraphQLObjectType" type name, useful when dealing with polymorphism.
|
|
105
|
-
*/
|
|
106
|
-
export declare const $$concreteType: unique symbol;
|
|
107
|
-
/**
|
|
108
|
-
* Set this key on a type if that type's serialization is idempotent (that is
|
|
109
|
-
* to say `serialize(serialize(thing)) === serialize(thing)`). This means we
|
|
110
|
-
* don't have to "roll-back" serialization if we need to fallback to graphql-js
|
|
111
|
-
* execution.
|
|
112
|
-
*/
|
|
113
|
-
export declare const $$idempotent: unique symbol;
|
|
114
|
-
/**
|
|
115
|
-
* The event emitter used for outputting execution events.
|
|
116
|
-
*/
|
|
117
|
-
export declare const $$eventEmitter: unique symbol;
|
|
118
|
-
/**
|
|
119
|
-
* Used to indicate that an array has more results available via a stream.
|
|
120
|
-
*/
|
|
121
|
-
export declare const $$streamMore: unique symbol;
|
|
122
|
-
export declare const $$proxy: unique symbol;
|
|
123
|
-
/**
|
|
124
|
-
* If an error has this property set then it's safe to send through to the user
|
|
125
|
-
* without being masked.
|
|
126
|
-
*/
|
|
127
|
-
export declare const $$safeError: unique symbol;
|
|
128
|
-
/** The layerPlan used as a subroutine for this step */
|
|
129
|
-
export declare const $$subroutine: unique symbol;
|
|
130
|
-
/** For tracking the timeout a TimeoutError happened from */
|
|
131
|
-
export declare const $$timeout: unique symbol;
|
|
132
|
-
/** For tracking _when_ the timeout happened (because once the JIT has warmed it might not need so long) */
|
|
133
|
-
export declare const $$ts: unique symbol;
|
|
134
|
-
/**
|
|
135
|
-
* When dealing with a polymorphic thing we need to be able to determine what
|
|
136
|
-
* the concrete type of it is, we use the $$concreteType property for that.
|
|
137
|
-
*/
|
|
138
|
-
export interface PolymorphicData<TType extends string = string, TData = any> {
|
|
139
|
-
[$$concreteType]: TType;
|
|
140
|
-
[$$data]?: TData;
|
|
141
|
-
}
|
|
142
81
|
export interface IndexByListItemStepId {
|
|
143
82
|
[listItemStepId: number]: number;
|
|
144
83
|
}
|
|
@@ -154,27 +93,36 @@ export interface BaseGraphQLVariables {
|
|
|
154
93
|
[key: string]: unknown;
|
|
155
94
|
}
|
|
156
95
|
export interface BaseGraphQLArguments {
|
|
157
|
-
[key: string]:
|
|
96
|
+
[key: string]: unknown;
|
|
158
97
|
}
|
|
159
|
-
export type
|
|
160
|
-
export type FieldArgs = {
|
|
98
|
+
export type FieldArgs<TObj extends BaseGraphQLArguments = any> = {
|
|
161
99
|
/** @deprecated Use bakedInput() step instead. */
|
|
162
100
|
get?: never;
|
|
163
|
-
getRaw
|
|
101
|
+
getRaw<TKey extends keyof TObj & string>(path: TKey): Step<TObj[TKey]>;
|
|
102
|
+
getRaw(path?: ReadonlyArray<string | number>): AnyInputStep | ObjectStep<{
|
|
164
103
|
[argName: string]: AnyInputStep;
|
|
165
104
|
}>;
|
|
166
|
-
typeAt(path:
|
|
105
|
+
typeAt(path: keyof TObj & string): GraphQLInputType;
|
|
106
|
+
typeAt(path: ReadonlyArray<string | number>): GraphQLInputType;
|
|
167
107
|
/** This also works (without path) to apply each list entry against $target */
|
|
168
|
-
apply<TArg extends object>($target: ApplyableExecutableStep<TArg>, path
|
|
108
|
+
apply<TArg extends object>($target: ApplyableExecutableStep<TArg>, path: keyof TObj & string, getTargetFromParent?: (parent: TArg, inputValue: any) => object | undefined): void;
|
|
109
|
+
apply<TArg extends object>($target: ApplyableExecutableStep<TArg>, path?: ReadonlyArray<string | number>, getTargetFromParent?: (parent: TArg, inputValue: any) => object | undefined): void;
|
|
169
110
|
apply<TArg extends object>($target: ApplyableExecutableStep<TArg>, getTargetFromParent: (parent: TArg, inputValue: any) => object | undefined, justTargetFromParent?: never): void;
|
|
170
|
-
} &
|
|
171
|
-
|
|
111
|
+
} & {
|
|
112
|
+
[key in keyof TObj & string as `$${key}`]: Step<TObj[key]> & ([unknown] extends [TObj[key]] ? {
|
|
113
|
+
[subkey in string as `$${subkey}`]: Step<any>;
|
|
114
|
+
} : TObj[key] extends Record<string, any> ? {
|
|
115
|
+
[subkey in keyof TObj[key] & string as `$${subkey}`]: Step<TObj[key][subkey]>;
|
|
116
|
+
} : unknown);
|
|
117
|
+
};
|
|
118
|
+
export type FieldArg<TData = any> = {
|
|
172
119
|
/** @deprecated Use bakedInput() step instead. */
|
|
173
120
|
get?: never;
|
|
121
|
+
getRaw<TKey extends keyof TData & string>(path: TKey): Step<TData[TKey]>;
|
|
174
122
|
getRaw(path?: string | ReadonlyArray<string | number>): AnyInputStep;
|
|
175
123
|
typeAt(path: string | ReadonlyArray<string | number>): GraphQLInputType;
|
|
176
124
|
/** This also works (without path) to apply each list entry against $target */
|
|
177
|
-
apply<TArg extends object>($target: ApplyableExecutableStep<TArg>, path?:
|
|
125
|
+
apply<TArg extends object>($target: ApplyableExecutableStep<TArg>, path?: ReadonlyArray<string | number>, getTargetFromParent?: (parent: TArg, inputValue: any) => object | undefined): void;
|
|
178
126
|
apply<TArg extends object>($target: ApplyableExecutableStep<TArg>, getTargetFromParent: (parent: TArg, inputValue: any) => object | undefined, justTargetFromParent?: never): void;
|
|
179
127
|
};
|
|
180
128
|
export type AnyInputStep = __TrackedValueStepWithDollars<any, GraphQLInputType> | __InputListStep | __InputStaticLeafStep | __InputDynamicScalarStep | __InputObjectStepWithDollars<GraphQLInputObjectType> | __InputDefaultStep | ConstantStep<any>;
|
|
@@ -209,8 +157,8 @@ export interface FieldInfo {
|
|
|
209
157
|
* We're using `TrackedObject<...>` so we can later consider caching these
|
|
210
158
|
* executions.
|
|
211
159
|
*/
|
|
212
|
-
export type FieldPlanResolver<
|
|
213
|
-
export type InputObjectFieldApplyResolver<TParent> = (target: TParent, input:
|
|
160
|
+
export type FieldPlanResolver<TParentStep extends Step = Step, TArgs extends BaseGraphQLArguments = any, TResultStep extends Step = Step> = ($parentPlan: TParentStep, args: FieldArgs<TArgs>, info: FieldInfo) => TResultStep | null;
|
|
161
|
+
export type InputObjectFieldApplyResolver<TParent = any, TData = any> = (target: TParent, input: TData, // Don't use unknown here, otherwise users can't easily cast it
|
|
214
162
|
info: {
|
|
215
163
|
schema: GraphQLSchema;
|
|
216
164
|
fieldName: string;
|
|
@@ -222,7 +170,7 @@ export type InputObjectTypeBakedInfo = {
|
|
|
222
170
|
applyChildren(val: any): void;
|
|
223
171
|
};
|
|
224
172
|
export type InputObjectTypeBakedResolver = (input: Record<string, any>, info: InputObjectTypeBakedInfo) => any;
|
|
225
|
-
export type ArgumentApplyPlanResolver<
|
|
173
|
+
export type ArgumentApplyPlanResolver<TSource extends Step = any, TFieldStep extends Step = any, TData = any> = ($parentPlan: TSource, $fieldPlan: TFieldStep, input: FieldArg<TData>, info: {
|
|
226
174
|
schema: GraphQLSchema;
|
|
227
175
|
arg: GraphQLArgument;
|
|
228
176
|
argName: string;
|
|
@@ -252,16 +200,13 @@ export type ScalarInputPlanResolver<TResultStep extends Step = Step> = ($inputVa
|
|
|
252
200
|
* @experimental
|
|
253
201
|
*/
|
|
254
202
|
export type EnumValueApplyResolver<TParent = any> = (parent: TParent) => void;
|
|
255
|
-
type OutputPlanForNamedType<TType extends GraphQLType> = TType extends GrafastObjectType<infer TStep, any> ? TStep : Step;
|
|
256
|
-
export type OutputPlanForType<TType extends GraphQLOutputType> = TType extends GraphQLNonNull<GraphQLList<GraphQLNonNull<infer U>>> ? ListCapableStep<any, OutputPlanForNamedType<U>> | Step<ReadonlyArray<any>> : TType extends GraphQLNonNull<GraphQLList<infer U>> ? ListCapableStep<any, OutputPlanForNamedType<U>> | Step<ReadonlyArray<any>> : TType extends GraphQLList<GraphQLNonNull<infer U>> ? ListCapableStep<any, OutputPlanForNamedType<U>> | Step<ReadonlyArray<any>> : TType extends GraphQLList<infer U> ? ListCapableStep<any, OutputPlanForNamedType<U>> | Step<ReadonlyArray<any>> : TType extends GraphQLNonNull<infer U> ? OutputPlanForNamedType<U> : OutputPlanForNamedType<TType>;
|
|
257
203
|
/**
|
|
258
204
|
* Basically GraphQLFieldConfig but with an easy to access `plan` method.
|
|
259
205
|
*/
|
|
260
|
-
export type GrafastFieldConfig<
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
subscribePlan?: FieldPlanResolver<TArgs, TParentStep, TFieldStep>;
|
|
206
|
+
export type GrafastFieldConfig<TParentStep extends Step, TArgs extends BaseGraphQLArguments = any, TFieldStep extends Step = any> = Omit<GraphQLFieldConfig<any, any>, "args" | "type"> & {
|
|
207
|
+
type: GraphQLOutputType;
|
|
208
|
+
plan?: FieldPlanResolver<TParentStep, TArgs, TFieldStep>;
|
|
209
|
+
subscribePlan?: FieldPlanResolver<TParentStep, TArgs, TFieldStep>;
|
|
265
210
|
args?: GrafastFieldConfigArgumentMap;
|
|
266
211
|
};
|
|
267
212
|
/**
|
|
@@ -273,10 +218,10 @@ export type GrafastFieldConfigArgumentMap = {
|
|
|
273
218
|
/**
|
|
274
219
|
* Basically GraphQLArgumentConfig but allowing for a plan.
|
|
275
220
|
*/
|
|
276
|
-
export type GrafastArgumentConfig<
|
|
277
|
-
type:
|
|
278
|
-
applyPlan?: ArgumentApplyPlanResolver<
|
|
279
|
-
applySubscribePlan?: ArgumentApplyPlanResolver<
|
|
221
|
+
export type GrafastArgumentConfig<TSource extends Step = any, TFieldStep extends Step = any, TData = any> = Omit<GraphQLArgumentConfig, "type"> & {
|
|
222
|
+
type: GraphQLInputType;
|
|
223
|
+
applyPlan?: ArgumentApplyPlanResolver<TSource, TFieldStep, TData>;
|
|
224
|
+
applySubscribePlan?: ArgumentApplyPlanResolver<TSource, TFieldStep, TData>;
|
|
280
225
|
inputPlan?: never;
|
|
281
226
|
autoApplyAfterParentPlan?: never;
|
|
282
227
|
autoApplyAfterParentSubscribePlan?: never;
|
|
@@ -284,9 +229,9 @@ export type GrafastArgumentConfig<TInputType extends GraphQLInputType = GraphQLI
|
|
|
284
229
|
/**
|
|
285
230
|
* Basically GraphQLInputFieldConfig but allowing for the field to have a plan.
|
|
286
231
|
*/
|
|
287
|
-
export type GrafastInputFieldConfig<TParent = any,
|
|
288
|
-
type:
|
|
289
|
-
apply?: InputObjectFieldApplyResolver<TParent>;
|
|
232
|
+
export type GrafastInputFieldConfig<TParent = any, TData = any> = Omit<GraphQLInputFieldConfig, "type"> & {
|
|
233
|
+
type: GraphQLInputType;
|
|
234
|
+
apply?: InputObjectFieldApplyResolver<TParent, TData>;
|
|
290
235
|
inputPlan?: never;
|
|
291
236
|
applyPlan?: never;
|
|
292
237
|
autoApplyAfterParentInputPlan?: never;
|
|
@@ -296,7 +241,7 @@ export type GrafastInputFieldConfig<TParent = any, TInputType extends GraphQLInp
|
|
|
296
241
|
* The args passed to a field plan resolver, the values are plans.
|
|
297
242
|
*/
|
|
298
243
|
export type TrackedArguments<TArgs extends BaseGraphQLArguments = BaseGraphQLArguments> = {
|
|
299
|
-
|
|
244
|
+
[TKey in keyof TArgs & string]: AnyInputStep;
|
|
300
245
|
};
|
|
301
246
|
/**
|
|
302
247
|
* `@stream` directive meta.
|
|
@@ -432,32 +377,6 @@ export interface ExecutionExtra extends ExecutionExtraBase {
|
|
|
432
377
|
export interface UnbatchedExecutionExtra extends ExecutionExtraBase {
|
|
433
378
|
stream: ExecutionDetailsStream | null;
|
|
434
379
|
}
|
|
435
|
-
/**
|
|
436
|
-
* A bitwise number representing a number of flags:
|
|
437
|
-
*
|
|
438
|
-
* - 0: normal execution value
|
|
439
|
-
* - 1: errored (trappable)
|
|
440
|
-
* - 2: null (trappable)
|
|
441
|
-
* - 4: inhibited (trappable)
|
|
442
|
-
* - 8: disabled due to polymorphism (untrappable)
|
|
443
|
-
* - 16: stopped (untrappable) - e.g. due to fatal (unrecoverable) error
|
|
444
|
-
* - 32: ...
|
|
445
|
-
*/
|
|
446
|
-
export type ExecutionEntryFlags = number & {
|
|
447
|
-
readonly tsBrand?: unique symbol;
|
|
448
|
-
};
|
|
449
|
-
export declare const NO_FLAGS: ExecutionEntryFlags;
|
|
450
|
-
export declare const FLAG_ERROR: ExecutionEntryFlags;
|
|
451
|
-
export declare const FLAG_NULL: ExecutionEntryFlags;
|
|
452
|
-
export declare const FLAG_INHIBITED: ExecutionEntryFlags;
|
|
453
|
-
export declare const FLAG_POLY_SKIPPED: ExecutionEntryFlags;
|
|
454
|
-
export declare const FLAG_STOPPED: ExecutionEntryFlags;
|
|
455
|
-
export declare const ALL_FLAGS: ExecutionEntryFlags;
|
|
456
|
-
/** By default, accept null values as an input */
|
|
457
|
-
export declare const DEFAULT_ACCEPT_FLAGS: ExecutionEntryFlags;
|
|
458
|
-
export declare const TRAPPABLE_FLAGS: ExecutionEntryFlags;
|
|
459
|
-
export declare const DEFAULT_FORBIDDEN_FLAGS: ExecutionEntryFlags;
|
|
460
|
-
export declare const FORBIDDEN_BY_NULLABLE_BOUNDARY_FLAGS: ExecutionEntryFlags;
|
|
461
380
|
export type ExecutionValue<TData = any> = BatchExecutionValue<TData> | UnaryExecutionValue<TData>;
|
|
462
381
|
interface ExecutionValueBase<TData = any> {
|
|
463
382
|
at(i: number): TData;
|
|
@@ -518,19 +437,27 @@ export interface GrafastArgs extends GraphQLArgs {
|
|
|
518
437
|
middleware?: Middleware<GraphileConfig.GrafastMiddleware> | null;
|
|
519
438
|
}
|
|
520
439
|
export type Maybe<T> = T | null | undefined;
|
|
521
|
-
export * from "./planJSONInterfaces.js";
|
|
522
|
-
export interface
|
|
440
|
+
export type * from "./planJSONInterfaces.js";
|
|
441
|
+
export interface BaseDependencyOptions<TStep extends Step = Step> {
|
|
523
442
|
step: TStep;
|
|
524
443
|
skipDeduplication?: boolean;
|
|
525
444
|
/** @defaultValue `FLAG_NULL` */
|
|
526
445
|
acceptFlags?: ExecutionEntryFlags;
|
|
527
446
|
onReject?: Maybe<Error>;
|
|
447
|
+
}
|
|
448
|
+
export interface AddDependencyOptions<TStep extends Step = Step> extends BaseDependencyOptions<TStep> {
|
|
449
|
+
nonUnaryMessage?: never;
|
|
450
|
+
dataOnly?: boolean;
|
|
451
|
+
}
|
|
452
|
+
export interface AddUnaryDependencyOptions<TStep extends Step = Step> extends BaseDependencyOptions<TStep> {
|
|
528
453
|
nonUnaryMessage?: ($dependent: Step, $dependency: Step) => string;
|
|
454
|
+
dataOnly?: never;
|
|
529
455
|
}
|
|
530
456
|
export interface DependencyOptions<TStep extends Step = Step> {
|
|
531
457
|
step: TStep;
|
|
532
458
|
acceptFlags: ExecutionEntryFlags;
|
|
533
459
|
onReject: Maybe<Error>;
|
|
460
|
+
dataOnly: boolean;
|
|
534
461
|
}
|
|
535
462
|
export type DataFromStep<TStep extends Step> = TStep extends Step<infer TData> ? TData : never;
|
|
536
463
|
export interface GrafastExecutionArgs extends ExecutionArgs {
|
|
@@ -564,12 +491,43 @@ export interface EstablishOperationPlanEvent {
|
|
|
564
491
|
variableValues: Record<string, any>;
|
|
565
492
|
context: any;
|
|
566
493
|
rootValue: any;
|
|
567
|
-
planningTimeout: number | undefined;
|
|
568
494
|
args: GrafastExecutionArgs;
|
|
495
|
+
options: GrafastOperationOptions;
|
|
569
496
|
}
|
|
570
497
|
export interface ExecuteStepEvent {
|
|
571
498
|
args: GrafastExecutionArgs;
|
|
572
499
|
step: Step;
|
|
573
500
|
executeDetails: ExecutionDetails;
|
|
574
501
|
}
|
|
502
|
+
export interface PlanTypeInfo {
|
|
503
|
+
abstractType: GraphQLUnionType | GraphQLInterfaceType;
|
|
504
|
+
resolverEmulation: boolean;
|
|
505
|
+
/**
|
|
506
|
+
* If this polymorphic position was represented by exactly one source step,
|
|
507
|
+
* this will be that step and you may use it to implement a more optimal
|
|
508
|
+
* planType. If more than one step was combined as input to this
|
|
509
|
+
* polymorphism, this will be null.
|
|
510
|
+
*/
|
|
511
|
+
$original: Step | null;
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* When planning an abstract type, an interface or union, it should have a
|
|
515
|
+
* `extensions.grafast.planType` method which accepts an incoming step
|
|
516
|
+
* representing the polymorphic data (we call this the `$specifier`) and will
|
|
517
|
+
* return a AbstractTypePlanner object. This object has a key `$__typename`
|
|
518
|
+
* whose value must be a step that represents the GraphQL type name to use for
|
|
519
|
+
* the given $specifier, and a method `planForType` that should return the step
|
|
520
|
+
* to use for a specific object type within the interface/union.
|
|
521
|
+
*/
|
|
522
|
+
export interface AbstractTypePlanner {
|
|
523
|
+
/**
|
|
524
|
+
* Must be a step representing the name of the object type associated with
|
|
525
|
+
* the given `$specifier`, or `null` if no such type could be determined.
|
|
526
|
+
*/
|
|
527
|
+
$__typename: Step<string | null>;
|
|
528
|
+
/**
|
|
529
|
+
* If not provided, will call `t.planType($specifier)`
|
|
530
|
+
*/
|
|
531
|
+
planForType?(t: GraphQLObjectType): Step | null;
|
|
532
|
+
}
|
|
575
533
|
//# sourceMappingURL=interfaces.d.ts.map
|