grafast 0.1.1-beta.20 → 0.1.1-beta.21
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/dist/args.js +2 -3
- package/dist/assert.js +2 -3
- package/dist/constraints.js +1 -2
- package/dist/deferred.js +1 -2
- package/dist/dev.js +2 -2
- package/dist/engine/LayerPlan.d.ts +20 -16
- package/dist/engine/LayerPlan.js +5 -10
- package/dist/engine/OperationPlan.d.ts +12 -13
- package/dist/engine/OperationPlan.js +210 -146
- package/dist/engine/OutputPlan.d.ts +4 -4
- package/dist/engine/OutputPlan.js +13 -10
- package/dist/engine/StepTracker.js +11 -2
- package/dist/engine/executeBucket.js +135 -94
- package/dist/engine/executeOutputPlan.js +1 -2
- package/dist/engine/lib/defaultPlanResolver.d.ts +6 -0
- package/dist/engine/lib/defaultPlanResolver.js +11 -0
- package/dist/engine/lib/withGlobalLayerPlan.d.ts +2 -2
- package/dist/engine/lib/withGlobalLayerPlan.js +4 -5
- package/dist/engine/lock.d.ts +3 -3
- package/dist/engine/lock.js +3 -3
- package/dist/error.js +4 -4
- package/dist/establishOperationPlan.js +2 -3
- package/dist/execute.js +3 -4
- package/dist/exportAs.js +2 -3
- package/dist/global.js +2 -3
- package/dist/grafastGraphql.js +2 -3
- package/dist/grafastPrint.js +7 -8
- package/dist/graphqlCollectFields.js +6 -7
- package/dist/graphqlMergeSelectionSets.js +1 -2
- package/dist/index.d.ts +22 -18
- package/dist/index.js +41 -16
- package/dist/input.js +75 -28
- package/dist/inspect.d.ts +9 -4
- package/dist/inspect.js +2 -2
- package/dist/interfaces.d.ts +110 -89
- package/dist/makeGrafastSchema.d.ts +18 -9
- package/dist/makeGrafastSchema.js +64 -30
- package/dist/mermaid.js +53 -14
- package/dist/middleware.js +1 -2
- package/dist/multistep.d.ts +6 -6
- package/dist/multistep.js +6 -7
- package/dist/operationPlan-input.d.ts +5 -4
- package/dist/operationPlan-input.js +131 -399
- package/dist/planJSONInterfaces.d.ts +6 -2
- package/dist/polymorphic.js +4 -5
- package/dist/prepare.js +6 -6
- package/dist/step.d.ts +67 -99
- package/dist/step.js +99 -127
- package/dist/steps/__flag.d.ts +16 -16
- package/dist/steps/__flag.js +9 -6
- package/dist/steps/__inputDefault.d.ts +14 -0
- package/dist/steps/__inputDefault.js +48 -0
- package/dist/steps/__inputDynamicScalar.d.ts +2 -4
- package/dist/steps/__inputDynamicScalar.js +4 -2
- package/dist/steps/__inputList.d.ts +5 -9
- package/dist/steps/__inputList.js +4 -1
- package/dist/steps/__inputObject.d.ts +6 -11
- package/dist/steps/__inputObject.js +13 -3
- package/dist/steps/__inputStaticLeaf.d.ts +2 -4
- package/dist/steps/__inputStaticLeaf.js +3 -1
- package/dist/steps/__item.d.ts +6 -6
- package/dist/steps/__item.js +1 -1
- package/dist/steps/__trackedValue.d.ts +4 -49
- package/dist/steps/__trackedValue.js +24 -6
- package/dist/steps/__value.d.ts +3 -3
- package/dist/steps/__value.js +3 -2
- package/dist/steps/access.d.ts +7 -6
- package/dist/steps/access.js +14 -7
- package/dist/steps/applyInput.d.ts +44 -0
- package/dist/steps/applyInput.js +206 -0
- package/dist/steps/applyTransforms.d.ts +2 -2
- package/dist/steps/applyTransforms.js +7 -5
- package/dist/steps/bakedInput.d.ts +23 -0
- package/dist/steps/bakedInput.js +90 -0
- package/dist/steps/condition.d.ts +5 -5
- package/dist/steps/condition.js +3 -3
- package/dist/steps/connection.d.ts +42 -39
- package/dist/steps/connection.js +51 -35
- package/dist/steps/constant.d.ts +4 -8
- package/dist/steps/constant.js +54 -6
- package/dist/steps/each.d.ts +3 -3
- package/dist/steps/each.js +1 -2
- package/dist/steps/error.d.ts +2 -2
- package/dist/steps/error.js +3 -3
- package/dist/steps/filter.d.ts +3 -2
- package/dist/steps/filter.js +1 -2
- package/dist/steps/first.d.ts +6 -5
- package/dist/steps/first.js +5 -4
- package/dist/steps/graphqlResolver.d.ts +2 -2
- package/dist/steps/graphqlResolver.js +44 -56
- package/dist/steps/groupBy.d.ts +3 -2
- package/dist/steps/groupBy.js +1 -2
- package/dist/steps/index.d.ts +4 -2
- package/dist/steps/index.js +21 -9
- package/dist/steps/lambda.d.ts +5 -5
- package/dist/steps/lambda.js +4 -4
- package/dist/steps/last.d.ts +6 -5
- package/dist/steps/last.js +5 -4
- package/dist/steps/list.d.ts +7 -7
- package/dist/steps/list.js +3 -3
- package/dist/steps/listTransform.d.ts +14 -12
- package/dist/steps/listTransform.js +14 -7
- package/dist/steps/listen.d.ts +6 -8
- package/dist/steps/listen.js +7 -7
- package/dist/steps/load.d.ts +6 -6
- package/dist/steps/load.js +7 -7
- package/dist/steps/node.d.ts +16 -10
- package/dist/steps/node.js +14 -7
- package/dist/steps/object.d.ts +11 -11
- package/dist/steps/object.js +5 -5
- package/dist/steps/partitionByIndex.d.ts +3 -2
- package/dist/steps/partitionByIndex.js +1 -2
- package/dist/steps/polymorphicBranch.d.ts +8 -8
- package/dist/steps/polymorphicBranch.js +4 -4
- package/dist/steps/proxy.d.ts +8 -8
- package/dist/steps/proxy.js +3 -3
- package/dist/steps/remapKeys.d.ts +6 -6
- package/dist/steps/remapKeys.js +3 -3
- package/dist/steps/reverse.d.ts +5 -5
- package/dist/steps/reverse.js +4 -4
- package/dist/steps/setter.d.ts +9 -18
- package/dist/steps/setter.js +24 -14
- package/dist/steps/sideEffect.d.ts +4 -4
- package/dist/steps/sideEffect.js +3 -3
- package/dist/stringifyPayload.js +1 -2
- package/dist/stripAnsi.js +2 -2
- package/dist/subscribe.js +2 -3
- package/dist/timeSource.d.ts +0 -1
- package/dist/utils.d.ts +43 -31
- package/dist/utils.js +97 -61
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/input.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.assertInputStep = assertInputStep;
|
|
4
|
+
exports.graphqlGetTypeForNode = graphqlGetTypeForNode;
|
|
5
|
+
exports.inputStep = inputStep;
|
|
4
6
|
const tslib_1 = require("tslib");
|
|
5
7
|
const graphql = tslib_1.__importStar(require("graphql"));
|
|
6
8
|
const inspect_js_1 = require("./inspect.js");
|
|
9
|
+
const __inputDefault_js_1 = require("./steps/__inputDefault.js");
|
|
7
10
|
const __inputDynamicScalar_js_1 = require("./steps/__inputDynamicScalar.js");
|
|
8
11
|
const __inputObject_js_1 = require("./steps/__inputObject.js");
|
|
9
12
|
const index_js_1 = require("./steps/index.js");
|
|
13
|
+
const utils_js_1 = require("./utils.js");
|
|
10
14
|
const { assertScalarType, GraphQLError, GraphQLList, GraphQLNonNull, isInputType, isLeafType, isInputObjectType, Kind, } = graphql;
|
|
11
15
|
function assertInputStep(itemPlan) {
|
|
12
16
|
if (itemPlan instanceof index_js_1.__TrackedValueStep)
|
|
@@ -19,7 +23,6 @@ function assertInputStep(itemPlan) {
|
|
|
19
23
|
return;
|
|
20
24
|
throw new Error(`Expected an InputStep, but found ${itemPlan}`);
|
|
21
25
|
}
|
|
22
|
-
exports.assertInputStep = assertInputStep;
|
|
23
26
|
function graphqlGetTypeForNode(operationPlan, node) {
|
|
24
27
|
switch (node.kind) {
|
|
25
28
|
case Kind.NAMED_TYPE: {
|
|
@@ -41,7 +44,6 @@ function graphqlGetTypeForNode(operationPlan, node) {
|
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
|
-
exports.graphqlGetTypeForNode = graphqlGetTypeForNode;
|
|
45
47
|
/**
|
|
46
48
|
* Returns a plan for the given `rawInputValue` AST node which could be a
|
|
47
49
|
* variable or a literal, and could be nested so that a variable (or more than
|
|
@@ -49,14 +51,21 @@ exports.graphqlGetTypeForNode = graphqlGetTypeForNode;
|
|
|
49
51
|
*
|
|
50
52
|
* @internal
|
|
51
53
|
*/
|
|
52
|
-
function inputStep(operationPlan, inputType,
|
|
53
|
-
|
|
54
|
-
if (
|
|
55
|
-
|
|
54
|
+
function inputStep(operationPlan, inputType, inputValue, defaultValue = undefined) {
|
|
55
|
+
const { valueNodeToStaticValueCache } = operationPlan;
|
|
56
|
+
if (inputValue === undefined) {
|
|
57
|
+
// Definitely can't be or contain a variable!
|
|
58
|
+
if (defaultValue === undefined) {
|
|
59
|
+
return (0, index_js_1.constant)(undefined);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
return valueNodeToCachedStaticValueConstantStep(valueNodeToStaticValueCache, defaultValue, inputType);
|
|
63
|
+
}
|
|
56
64
|
}
|
|
57
65
|
const isObj = isInputObjectType(inputType);
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
if (inputValue.kind === "Variable") {
|
|
67
|
+
// Note: this is the only other place where `defaultValue` might be used
|
|
68
|
+
// we know `inputValue` is not a variable.
|
|
60
69
|
const variableName = inputValue.name.value;
|
|
61
70
|
const variableDefinition = operationPlan.operation.variableDefinitions?.find((def) => def.variable.name.value === variableName);
|
|
62
71
|
if (!variableDefinition) {
|
|
@@ -68,17 +77,27 @@ function inputStep(operationPlan, inputType, rawInputValue, defaultValue = undef
|
|
|
68
77
|
if (!isInputType(variableType)) {
|
|
69
78
|
throw new Error(`Expected varible type to be an input type`);
|
|
70
79
|
}
|
|
71
|
-
|
|
80
|
+
const variableWillDefinitelyBeSet = variableType instanceof GraphQLNonNull ||
|
|
81
|
+
variableDefinition.defaultValue != null;
|
|
82
|
+
return inputVariablePlan(operationPlan, variableName, variableType, inputType, defaultValue, variableWillDefinitelyBeSet);
|
|
72
83
|
}
|
|
73
|
-
|
|
74
|
-
// we know `inputValue` is not a variable.
|
|
75
|
-
inputValue = inputValue ?? defaultValue;
|
|
76
|
-
if (inputType instanceof GraphQLNonNull) {
|
|
84
|
+
else if (inputType instanceof GraphQLNonNull) {
|
|
77
85
|
const innerType = inputType.ofType;
|
|
86
|
+
if (inputValue.kind === Kind.NULL) {
|
|
87
|
+
throw new Error(`Null found in non-null position; this should have been prevented by validation.`);
|
|
88
|
+
}
|
|
78
89
|
const valuePlan = inputStep(operationPlan, innerType, inputValue, undefined);
|
|
79
90
|
return inputNonNullPlan(operationPlan, valuePlan);
|
|
80
91
|
}
|
|
92
|
+
else if (inputValue.kind === Kind.NULL) {
|
|
93
|
+
return (0, index_js_1.constant)(null);
|
|
94
|
+
}
|
|
81
95
|
else if (inputType instanceof GraphQLList) {
|
|
96
|
+
const variableNames = new Set();
|
|
97
|
+
(0, utils_js_1.findVariableNamesUsedInValueNode)(inputValue, variableNames);
|
|
98
|
+
if (variableNames.size === 0) {
|
|
99
|
+
return valueNodeToCachedStaticValueConstantStep(valueNodeToStaticValueCache, inputValue, inputType);
|
|
100
|
+
}
|
|
82
101
|
return new index_js_1.__InputListStep(inputType, inputValue);
|
|
83
102
|
}
|
|
84
103
|
else if (isLeafType(inputType)) {
|
|
@@ -100,7 +119,6 @@ function inputStep(operationPlan, inputType, rawInputValue, defaultValue = undef
|
|
|
100
119
|
throw new Error(`Unsupported type in inputPlan: '${(0, inspect_js_1.inspect)(never)}'`);
|
|
101
120
|
}
|
|
102
121
|
}
|
|
103
|
-
exports.inputStep = inputStep;
|
|
104
122
|
function doTypesMatch(variableType, expectedType) {
|
|
105
123
|
if (variableType instanceof GraphQLNonNull &&
|
|
106
124
|
expectedType instanceof GraphQLNonNull) {
|
|
@@ -118,36 +136,57 @@ function doTypesMatch(variableType, expectedType) {
|
|
|
118
136
|
return variableType === expectedType;
|
|
119
137
|
}
|
|
120
138
|
}
|
|
121
|
-
|
|
139
|
+
/**
|
|
140
|
+
* Returns a step representing a variable's value.
|
|
141
|
+
*
|
|
142
|
+
* @param operationPlan -
|
|
143
|
+
* @param variableName -
|
|
144
|
+
* @param variableType -
|
|
145
|
+
* @param inputType -
|
|
146
|
+
* @param defaultValue -
|
|
147
|
+
* @param variableWillDefinitelyBeSet - If `true` the variable is either
|
|
148
|
+
* non-null _or_ it has a default value (including null). In this case, the
|
|
149
|
+
* variable will never be `undefined` and thus an input position's defaultValue
|
|
150
|
+
* will never be invoked where it is used.
|
|
151
|
+
*/
|
|
152
|
+
function inputVariablePlan(operationPlan, variableName, variableType, inputType, defaultValue, variableWillDefinitelyBeSet) {
|
|
122
153
|
if (variableType instanceof GraphQLNonNull &&
|
|
123
154
|
!(inputType instanceof GraphQLNonNull)) {
|
|
124
155
|
const unwrappedVariableType = variableType.ofType;
|
|
125
|
-
return inputVariablePlan(operationPlan, variableName, unwrappedVariableType, inputType, defaultValue);
|
|
156
|
+
return inputVariablePlan(operationPlan, variableName, unwrappedVariableType, inputType, defaultValue, variableWillDefinitelyBeSet);
|
|
126
157
|
}
|
|
127
158
|
const typesMatch = doTypesMatch(variableType, inputType);
|
|
128
159
|
if (!typesMatch) {
|
|
129
160
|
// REF: https://spec.graphql.org/draft/#IsVariableUsageAllowed()
|
|
130
161
|
if (inputType instanceof GraphQLNonNull &&
|
|
131
162
|
!(variableType instanceof GraphQLNonNull)) {
|
|
132
|
-
const variablePlan = inputVariablePlan(operationPlan, variableName, variableType, inputType.ofType, defaultValue);
|
|
133
|
-
|
|
163
|
+
const variablePlan = inputVariablePlan(operationPlan, variableName, variableType, inputType.ofType, defaultValue, variableWillDefinitelyBeSet);
|
|
164
|
+
// TODO: find a way to do this without doing eval. For example: track list of variables that may not be nullish.
|
|
165
|
+
if (variablePlan.evalIs(null) ||
|
|
166
|
+
(!variableWillDefinitelyBeSet && variablePlan.evalIs(undefined))) {
|
|
134
167
|
throw new GraphQLError(`Expected non-null value of type ${inputType.ofType.toString()}`);
|
|
135
168
|
}
|
|
136
169
|
return variablePlan;
|
|
137
170
|
}
|
|
138
171
|
throw new Error("Expected variable and input types to match");
|
|
139
172
|
}
|
|
140
|
-
const
|
|
141
|
-
if (defaultValue === undefined
|
|
142
|
-
// There's no default value
|
|
143
|
-
|
|
144
|
-
|
|
173
|
+
const $variableValue = operationPlan.trackedVariableValuesStep.get(variableName);
|
|
174
|
+
if (defaultValue === undefined) {
|
|
175
|
+
// There's no default value and thus the default will not be used; use the variable.
|
|
176
|
+
return $variableValue;
|
|
177
|
+
}
|
|
178
|
+
else if (variableWillDefinitelyBeSet) {
|
|
179
|
+
// The variable will DEFINITELY be set (even if it is set to null, possibly
|
|
180
|
+
// by a default), so the input position's default value will never apply.
|
|
181
|
+
return $variableValue;
|
|
145
182
|
}
|
|
146
183
|
else {
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
|
|
184
|
+
// Here:
|
|
185
|
+
// - the variable is nullable, optional, and has no default value
|
|
186
|
+
// - the input position has a default value
|
|
187
|
+
// We thus need a step that results in `variableValue === undefined ? defaultValue : variableValue`
|
|
188
|
+
const runtimeDefaultValue = (0, utils_js_1.valueNodeToStaticValue)(defaultValue, inputType);
|
|
189
|
+
return new __inputDefault_js_1.__InputDefaultStep($variableValue, runtimeDefaultValue);
|
|
151
190
|
}
|
|
152
191
|
}
|
|
153
192
|
/**
|
|
@@ -156,4 +195,12 @@ function inputVariablePlan(operationPlan, variableName, variableType, inputType,
|
|
|
156
195
|
function inputNonNullPlan(_operationPlan, innerPlan) {
|
|
157
196
|
return innerPlan;
|
|
158
197
|
}
|
|
198
|
+
function valueNodeToCachedStaticValueConstantStep(cache, valueNode, inputType) {
|
|
199
|
+
let step = cache.get(valueNode);
|
|
200
|
+
if (!step) {
|
|
201
|
+
step = (0, index_js_1.constant)((0, utils_js_1.valueNodeToStaticValue)(valueNode, inputType), false);
|
|
202
|
+
cache.set(valueNode, step);
|
|
203
|
+
}
|
|
204
|
+
return step;
|
|
205
|
+
}
|
|
159
206
|
//# sourceMappingURL=input.js.map
|
package/dist/inspect.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
export declare let inspect:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export declare let inspect: {
|
|
2
|
+
(obj: any, options?: {
|
|
3
|
+
colors?: boolean;
|
|
4
|
+
depth?: number;
|
|
5
|
+
compact?: boolean | number;
|
|
6
|
+
breakLength?: number;
|
|
7
|
+
}): string;
|
|
8
|
+
custom: symbol;
|
|
9
|
+
};
|
|
5
10
|
//# sourceMappingURL=inspect.d.ts.map
|
package/dist/inspect.js
CHANGED
|
@@ -8,13 +8,13 @@ try {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
catch {
|
|
11
|
-
exports.inspect = (obj) => {
|
|
11
|
+
exports.inspect = Object.assign((obj) => {
|
|
12
12
|
return Array.isArray(obj) ||
|
|
13
13
|
!obj ||
|
|
14
14
|
Object.getPrototypeOf(obj) === null ||
|
|
15
15
|
Object.getPrototypeOf(obj) === Object.prototype
|
|
16
16
|
? String(JSON.stringify(obj))
|
|
17
17
|
: String(obj);
|
|
18
|
-
};
|
|
18
|
+
}, { custom: Symbol.for("nodejs.util.inspect.custom") });
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=inspect.js.map
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -3,12 +3,15 @@ import type { Middleware } from "graphile-config";
|
|
|
3
3
|
import type { ASTNode, ExecutionArgs, FragmentDefinitionNode, GraphQLArgs, GraphQLArgument, GraphQLArgumentConfig, GraphQLField, GraphQLFieldConfig, GraphQLInputField, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLInputType, GraphQLList, GraphQLNonNull, GraphQLOutputType, GraphQLScalarType, GraphQLSchema, GraphQLType, OperationDefinitionNode, Source, ValueNode, VariableNode } from "graphql";
|
|
4
4
|
import type { ObjMap } from "graphql/jsutils/ObjMap.js";
|
|
5
5
|
import type { Constraint } from "./constraints.js";
|
|
6
|
+
import type { LayerPlanReasonListItemStream } from "./engine/LayerPlan.js";
|
|
6
7
|
import type { OperationPlan } from "./engine/OperationPlan.js";
|
|
7
8
|
import type { FlaggedValue, SafeError } from "./error.js";
|
|
8
|
-
import type {
|
|
9
|
+
import type { ListCapableStep, Step } from "./step.js";
|
|
10
|
+
import type { __InputDefaultStep } from "./steps/__inputDefault.js";
|
|
9
11
|
import type { __InputDynamicScalarStep } from "./steps/__inputDynamicScalar.js";
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
12
|
+
import type { ApplyableExecutableStep } from "./steps/applyInput.js";
|
|
13
|
+
import type { __InputListStep, __InputObjectStepWithDollars, __InputStaticLeafStep, __TrackedValueStepWithDollars, ConstantStep, ObjectStep } from "./steps/index.js";
|
|
14
|
+
import type { GrafastObjectType } from "./utils.js";
|
|
12
15
|
export interface GrafastTimeouts {
|
|
13
16
|
/**
|
|
14
17
|
* How many milliseconds should we allow for planning. Remember: planning is
|
|
@@ -139,10 +142,13 @@ export interface PolymorphicData<TType extends string = string, TData = any> {
|
|
|
139
142
|
export interface IndexByListItemStepId {
|
|
140
143
|
[listItemStepId: number]: number;
|
|
141
144
|
}
|
|
142
|
-
export type GrafastValuesList<
|
|
145
|
+
export type GrafastValuesList<TData> = ReadonlyArray<TData>;
|
|
143
146
|
export type PromiseOrDirect<T> = PromiseLike<T> | T;
|
|
144
|
-
export type
|
|
145
|
-
export type
|
|
147
|
+
export type ExecutionResultValue<T> = T | FlaggedValue<Error> | FlaggedValue<null>;
|
|
148
|
+
export type GrafastResultsList<TData> = ReadonlyArray<PromiseOrDirect<ExecutionResultValue<TData>>>;
|
|
149
|
+
export type GrafastResultStreamList<TStreamItem> = ReadonlyArray<PromiseOrDirect<AsyncIterable<PromiseOrDirect<ExecutionResultValue<TStreamItem>>>> | PromiseLike<never>>;
|
|
150
|
+
export type AwaitedExecutionResults<TData> = ReadonlyArray<PromiseOrDirect<ExecutionResultValue<TData> | AsyncIterable<PromiseOrDirect<ExecutionResultValue<TData extends ReadonlyArray<infer UStreamItem> ? UStreamItem : never>>>>>;
|
|
151
|
+
export type ExecutionResults<TData> = PromiseOrDirect<AwaitedExecutionResults<TData>> | PromiseLike<never>;
|
|
146
152
|
export type BaseGraphQLRootValue = any;
|
|
147
153
|
export interface BaseGraphQLVariables {
|
|
148
154
|
[key: string]: unknown;
|
|
@@ -151,17 +157,27 @@ export interface BaseGraphQLArguments {
|
|
|
151
157
|
[key: string]: any;
|
|
152
158
|
}
|
|
153
159
|
export type BaseGraphQLInputObject = BaseGraphQLArguments;
|
|
154
|
-
export type TargetStepOrCallback = ExecutableStep | ModifierStep | ((indexOrFieldName: number | string) => TargetStepOrCallback);
|
|
155
160
|
export type FieldArgs = {
|
|
156
|
-
/**
|
|
157
|
-
get
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
/** @deprecated Use bakedInput() step instead. */
|
|
162
|
+
get?: never;
|
|
163
|
+
getRaw(path?: string | ReadonlyArray<string | number>): AnyInputStep | ObjectStep<{
|
|
164
|
+
[argName: string]: AnyInputStep;
|
|
165
|
+
}>;
|
|
166
|
+
typeAt(path: string | ReadonlyArray<string | number>): GraphQLInputType;
|
|
160
167
|
/** This also works (without path) to apply each list entry against $target */
|
|
161
|
-
apply($target:
|
|
168
|
+
apply<TArg extends object>($target: ApplyableExecutableStep<TArg>, path?: string | ReadonlyArray<string | number>, getTargetFromParent?: (parent: TArg, inputValue: any) => object | undefined): void;
|
|
169
|
+
apply<TArg extends object>($target: ApplyableExecutableStep<TArg>, getTargetFromParent: (parent: TArg, inputValue: any) => object | undefined, justTargetFromParent?: never): void;
|
|
162
170
|
} & AnyInputStepDollars;
|
|
163
|
-
export type
|
|
164
|
-
|
|
171
|
+
export type FieldArg = {
|
|
172
|
+
/** @deprecated Use bakedInput() step instead. */
|
|
173
|
+
get?: never;
|
|
174
|
+
getRaw(path?: string | ReadonlyArray<string | number>): AnyInputStep;
|
|
175
|
+
typeAt(path: string | ReadonlyArray<string | number>): GraphQLInputType;
|
|
176
|
+
/** This also works (without path) to apply each list entry against $target */
|
|
177
|
+
apply<TArg extends object>($target: ApplyableExecutableStep<TArg>, path?: string | ReadonlyArray<string | number>, getTargetFromParent?: (parent: TArg, inputValue: any) => object | undefined): void;
|
|
178
|
+
apply<TArg extends object>($target: ApplyableExecutableStep<TArg>, getTargetFromParent: (parent: TArg, inputValue: any) => object | undefined, justTargetFromParent?: never): void;
|
|
179
|
+
};
|
|
180
|
+
export type AnyInputStep = __TrackedValueStepWithDollars<any, GraphQLInputType> | __InputListStep | __InputStaticLeafStep | __InputDynamicScalarStep | __InputObjectStepWithDollars<GraphQLInputObjectType> | __InputDefaultStep | ConstantStep<any>;
|
|
165
181
|
export type AnyInputStepWithDollars = AnyInputStep & AnyInputStepDollars;
|
|
166
182
|
/**
|
|
167
183
|
* Lies to make it easier to write TypeScript code like
|
|
@@ -172,6 +188,7 @@ export type AnyInputStepDollars = {
|
|
|
172
188
|
[key in string as `$${key}`]: AnyInputStepWithDollars;
|
|
173
189
|
};
|
|
174
190
|
export interface FieldInfo {
|
|
191
|
+
fieldName: string;
|
|
175
192
|
field: GraphQLField<any, any, any>;
|
|
176
193
|
schema: GraphQLSchema;
|
|
177
194
|
}
|
|
@@ -192,52 +209,36 @@ export interface FieldInfo {
|
|
|
192
209
|
* We're using `TrackedObject<...>` so we can later consider caching these
|
|
193
210
|
* executions.
|
|
194
211
|
*/
|
|
195
|
-
export type FieldPlanResolver<_TArgs extends BaseGraphQLArguments, TParentStep extends
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
* (from an argument, or from a parent input object) or null if none, and an
|
|
199
|
-
* input plan that represents the value the user will pass to this field. The
|
|
200
|
-
* resolver must return either a ModifierStep or null.
|
|
201
|
-
*/
|
|
202
|
-
export type InputObjectFieldInputPlanResolver<TResultStep extends ExecutableStep = ExecutableStep> = (input: FieldArgs, info: {
|
|
212
|
+
export type FieldPlanResolver<_TArgs extends BaseGraphQLArguments, TParentStep extends Step | null, TResultStep extends Step | null> = ($parentPlan: TParentStep, args: FieldArgs, info: FieldInfo) => TResultStep;
|
|
213
|
+
export type InputObjectFieldApplyResolver<TParent> = (target: TParent, input: any, // Don't use unknown here, otherwise users can't easily cast it
|
|
214
|
+
info: {
|
|
203
215
|
schema: GraphQLSchema;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
entity: GraphQLInputField;
|
|
209
|
-
}) => TResultStep;
|
|
210
|
-
export type InputObjectTypeInputPlanResolver = (input: FieldArgs, info: {
|
|
216
|
+
fieldName: string;
|
|
217
|
+
field: GraphQLInputField;
|
|
218
|
+
}) => any;
|
|
219
|
+
export type InputObjectTypeBakedInfo = {
|
|
211
220
|
schema: GraphQLSchema;
|
|
212
221
|
type: GraphQLInputObjectType;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
* the field plan (the plan that represents the field the arg is defined on)
|
|
218
|
-
* and an input plan that represents the value the user will pass to this
|
|
219
|
-
* argument. The resolver must return either a ModifierStep or null.
|
|
220
|
-
*/
|
|
221
|
-
export type ArgumentInputPlanResolver<TParentStep extends ExecutableStep = ExecutableStep, TResultStep extends ExecutableStep = ExecutableStep> = ($parentPlan: TParentStep, input: FieldArgs, info: {
|
|
222
|
-
schema: GraphQLSchema;
|
|
223
|
-
entity: GraphQLArgument;
|
|
224
|
-
}) => TResultStep;
|
|
225
|
-
export type ArgumentApplyPlanResolver<TParentStep extends ExecutableStep = ExecutableStep, TFieldStep extends ExecutableStep | ModifierStep<any> = ExecutableStep | ModifierStep<any>, TResultStep extends ExecutableStep | ModifierStep<ExecutableStep | ModifierStep> | null | void = ExecutableStep | ModifierStep<ExecutableStep | ModifierStep> | null | void> = ($parentPlan: TParentStep, $fieldPlan: TFieldStep, input: FieldArgs, info: {
|
|
222
|
+
applyChildren(val: any): void;
|
|
223
|
+
};
|
|
224
|
+
export type InputObjectTypeBakedResolver = (input: Record<string, any>, info: InputObjectTypeBakedInfo) => any;
|
|
225
|
+
export type ArgumentApplyPlanResolver<TParentStep extends Step = Step, TFieldStep extends Step = Step> = ($parentPlan: TParentStep, $fieldPlan: TFieldStep, input: FieldArg, info: {
|
|
226
226
|
schema: GraphQLSchema;
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
arg: GraphQLArgument;
|
|
228
|
+
argName: string;
|
|
229
|
+
}) => void;
|
|
229
230
|
/**
|
|
230
231
|
* GraphQLScalarTypes can have plans, these are passed the field plan and must
|
|
231
232
|
* return an executable plan.
|
|
232
233
|
*/
|
|
233
|
-
export type ScalarPlanResolver<TParentStep extends
|
|
234
|
+
export type ScalarPlanResolver<TParentStep extends Step = Step, TResultStep extends Step = Step> = ($parentPlan: TParentStep, info: {
|
|
234
235
|
schema: GraphQLSchema;
|
|
235
236
|
}) => TResultStep;
|
|
236
237
|
/**
|
|
237
238
|
* GraphQLScalarTypes can have plans, these are passed the field plan and must
|
|
238
239
|
* return an executable plan.
|
|
239
240
|
*/
|
|
240
|
-
export type ScalarInputPlanResolver<TResultStep extends
|
|
241
|
+
export type ScalarInputPlanResolver<TResultStep extends Step = Step> = ($inputValue: AnyInputStep, info: {
|
|
241
242
|
schema: GraphQLSchema;
|
|
242
243
|
type: GraphQLScalarType;
|
|
243
244
|
}) => TResultStep;
|
|
@@ -250,48 +251,46 @@ export type ScalarInputPlanResolver<TResultStep extends ExecutableStep = Executa
|
|
|
250
251
|
*
|
|
251
252
|
* @experimental
|
|
252
253
|
*/
|
|
253
|
-
export type
|
|
254
|
-
type OutputPlanForNamedType<TType extends GraphQLType> = TType extends GrafastObjectType<
|
|
255
|
-
export type OutputPlanForType<TType extends GraphQLOutputType> = TType extends GraphQLNonNull<GraphQLList<GraphQLNonNull<infer U>>> ? ListCapableStep<any, OutputPlanForNamedType<U>> |
|
|
256
|
-
type InputPlanForNamedType<TType extends GraphQLType> = TType extends GrafastInputObjectType<any, infer U, any> ? U : ModifierStep<any>;
|
|
257
|
-
type InputPlanForType<TType extends GraphQLInputType> = TType extends GraphQLNonNull<GraphQLList<GraphQLNonNull<infer U>>> ? InputPlanForNamedType<U> : TType extends GraphQLNonNull<GraphQLList<infer U>> ? InputPlanForNamedType<U> : TType extends GraphQLList<GraphQLNonNull<infer U>> ? InputPlanForNamedType<U> : TType extends GraphQLList<infer U> ? InputPlanForNamedType<U> : TType extends GraphQLNonNull<infer U> ? InputPlanForNamedType<U> : InputPlanForNamedType<TType>;
|
|
258
|
-
type InputTypeForNamedType<TType extends GraphQLType> = TType extends GraphQLScalarType<infer U> ? U : any;
|
|
259
|
-
type InputTypeFor<TType extends GraphQLInputType> = TType extends GraphQLNonNull<GraphQLList<GraphQLNonNull<infer U>>> ? InputTypeForNamedType<U> : TType extends GraphQLNonNull<GraphQLList<infer U>> ? InputTypeForNamedType<U> : TType extends GraphQLList<GraphQLNonNull<infer U>> ? InputTypeForNamedType<U> : TType extends GraphQLList<infer U> ? InputTypeForNamedType<U> : TType extends GraphQLNonNull<infer U> ? InputTypeForNamedType<U> : InputTypeForNamedType<TType>;
|
|
254
|
+
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>;
|
|
260
257
|
/**
|
|
261
258
|
* Basically GraphQLFieldConfig but with an easy to access `plan` method.
|
|
262
259
|
*/
|
|
263
|
-
export type GrafastFieldConfig<TType extends GraphQLOutputType,
|
|
260
|
+
export type GrafastFieldConfig<TType extends GraphQLOutputType, TParentStep extends Step | null, TFieldStep extends Step, // TODO: should be OutputPlanForType<TType>, but that results in everything thinking it should be a ListStep
|
|
264
261
|
TArgs extends BaseGraphQLArguments> = Omit<GraphQLFieldConfig<any, any>, "args" | "type"> & {
|
|
265
262
|
type: TType;
|
|
266
263
|
plan?: FieldPlanResolver<TArgs, TParentStep, TFieldStep>;
|
|
267
264
|
subscribePlan?: FieldPlanResolver<TArgs, TParentStep, TFieldStep>;
|
|
268
|
-
args?: GrafastFieldConfigArgumentMap
|
|
265
|
+
args?: GrafastFieldConfigArgumentMap;
|
|
269
266
|
};
|
|
270
267
|
/**
|
|
271
268
|
* Basically GraphQLFieldConfigArgumentMap but allowing for args to have plans.
|
|
272
269
|
*/
|
|
273
|
-
export type GrafastFieldConfigArgumentMap
|
|
274
|
-
[argName: string]: GrafastArgumentConfig
|
|
270
|
+
export type GrafastFieldConfigArgumentMap = {
|
|
271
|
+
[argName: string]: GrafastArgumentConfig;
|
|
275
272
|
};
|
|
276
273
|
/**
|
|
277
274
|
* Basically GraphQLArgumentConfig but allowing for a plan.
|
|
278
275
|
*/
|
|
279
|
-
export type GrafastArgumentConfig<TInputType extends GraphQLInputType = GraphQLInputType, _TContext extends Grafast.Context = Grafast.Context, _TParentStep extends
|
|
276
|
+
export type GrafastArgumentConfig<TInputType extends GraphQLInputType = GraphQLInputType, _TContext extends Grafast.Context = Grafast.Context, _TParentStep extends Step | null = Step | null> = Omit<GraphQLArgumentConfig, "type"> & {
|
|
280
277
|
type: TInputType;
|
|
281
|
-
inputPlan?: ArgumentInputPlanResolver<any>;
|
|
282
278
|
applyPlan?: ArgumentApplyPlanResolver<any, any>;
|
|
283
|
-
|
|
284
|
-
|
|
279
|
+
applySubscribePlan?: ArgumentApplyPlanResolver<any, any>;
|
|
280
|
+
inputPlan?: never;
|
|
281
|
+
autoApplyAfterParentPlan?: never;
|
|
282
|
+
autoApplyAfterParentSubscribePlan?: never;
|
|
285
283
|
};
|
|
286
284
|
/**
|
|
287
285
|
* Basically GraphQLInputFieldConfig but allowing for the field to have a plan.
|
|
288
286
|
*/
|
|
289
|
-
export type GrafastInputFieldConfig<
|
|
287
|
+
export type GrafastInputFieldConfig<TParent = any, TInputType extends GraphQLInputType = GraphQLInputType> = Omit<GraphQLInputFieldConfig, "type"> & {
|
|
290
288
|
type: TInputType;
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
289
|
+
apply?: InputObjectFieldApplyResolver<TParent>;
|
|
290
|
+
inputPlan?: never;
|
|
291
|
+
applyPlan?: never;
|
|
292
|
+
autoApplyAfterParentInputPlan?: never;
|
|
293
|
+
autoApplyAfterParentApplyPlan?: never;
|
|
295
294
|
};
|
|
296
295
|
/**
|
|
297
296
|
* The args passed to a field plan resolver, the values are plans.
|
|
@@ -302,8 +301,7 @@ export type TrackedArguments<TArgs extends BaseGraphQLArguments = BaseGraphQLArg
|
|
|
302
301
|
/**
|
|
303
302
|
* `@stream` directive meta.
|
|
304
303
|
*/
|
|
305
|
-
export interface StepStreamOptions {
|
|
306
|
-
initialCount: number;
|
|
304
|
+
export interface StepStreamOptions extends LayerPlanReasonListItemStream {
|
|
307
305
|
}
|
|
308
306
|
/**
|
|
309
307
|
* Additional details about the planning for a field; currently only relates to
|
|
@@ -314,12 +312,23 @@ export interface StepOptions {
|
|
|
314
312
|
* Details for the `@stream` directive.
|
|
315
313
|
*/
|
|
316
314
|
stream: StepStreamOptions | null;
|
|
315
|
+
/**
|
|
316
|
+
* Should we walk an iterable if presented. This is important because we
|
|
317
|
+
* don't want to walk things like Map/Set except if we're doing it as part of
|
|
318
|
+
* a list step.
|
|
319
|
+
*/
|
|
320
|
+
walkIterable: boolean;
|
|
317
321
|
}
|
|
318
322
|
/**
|
|
319
323
|
* Options passed to the `optimize` method of a plan to give more context.
|
|
320
324
|
*/
|
|
321
325
|
export interface StepOptimizeOptions {
|
|
322
|
-
|
|
326
|
+
/**
|
|
327
|
+
* If null, this step will not stream. If non-null, this step _might_ stream,
|
|
328
|
+
* but it's not guaranteed - it may be dependent on user variables, e.g. the
|
|
329
|
+
* `if` parameter.
|
|
330
|
+
*/
|
|
331
|
+
stream: null | {};
|
|
323
332
|
meta: Record<string, unknown> | undefined;
|
|
324
333
|
}
|
|
325
334
|
/**
|
|
@@ -348,7 +357,7 @@ export interface NodeIdCodec<T = any> {
|
|
|
348
357
|
* Determines if a NodeID relates to a given object type, and also relates to
|
|
349
358
|
* encoding the NodeID for that type.
|
|
350
359
|
*/
|
|
351
|
-
export type NodeIdHandler<TCodec extends NodeIdCodec<any> = NodeIdCodec<any>, TNodeStep extends
|
|
360
|
+
export type NodeIdHandler<TIdentifiers extends readonly any[] = readonly any[], TCodec extends NodeIdCodec<any> = NodeIdCodec<any>, TNodeStep extends Step = Step, TSpec = any> = {
|
|
352
361
|
/**
|
|
353
362
|
* The name of the object type this handler is for.
|
|
354
363
|
*/
|
|
@@ -361,11 +370,16 @@ export type NodeIdHandler<TCodec extends NodeIdCodec<any> = NodeIdCodec<any>, TN
|
|
|
361
370
|
* Returns true if the given decoded Node ID value represents this type.
|
|
362
371
|
*/
|
|
363
372
|
match(specifier: TCodec extends NodeIdCodec<infer U> ? U : any): boolean;
|
|
373
|
+
/**
|
|
374
|
+
* Returns the underlying identifiers extracted from the decoded NodeID
|
|
375
|
+
* value.
|
|
376
|
+
*/
|
|
377
|
+
getIdentifiers(value: TCodec extends NodeIdCodec<infer U> ? U : any): TIdentifiers;
|
|
364
378
|
/**
|
|
365
379
|
* Returns a plan that returns the value ready to be encoded. When the result
|
|
366
380
|
* of this plan is fed into `match`, it should return `true`.
|
|
367
381
|
*/
|
|
368
|
-
plan($thing: TNodeStep):
|
|
382
|
+
plan($thing: TNodeStep): Step<TCodec extends NodeIdCodec<infer U> ? U : any>;
|
|
369
383
|
/**
|
|
370
384
|
* Returns a specification based on the Node ID, this can be in any format
|
|
371
385
|
* you like. It is intended to then be fed into `get` or handled in your own
|
|
@@ -373,7 +387,7 @@ export type NodeIdHandler<TCodec extends NodeIdCodec<any> = NodeIdCodec<any>, TN
|
|
|
373
387
|
* referencing a node without actually fetching it - e.g. allowing you to
|
|
374
388
|
* delete a node by its ID without first fetching it.)
|
|
375
389
|
*/
|
|
376
|
-
getSpec(plan:
|
|
390
|
+
getSpec(plan: Step<TCodec extends NodeIdCodec<infer U> ? U : any>): TSpec;
|
|
377
391
|
/**
|
|
378
392
|
* Combined with `getSpec`, this forms the recprocal of `plan`; i.e.
|
|
379
393
|
* `get(getSpec( plan(node) ))` should return a plan that results in the
|
|
@@ -416,6 +430,7 @@ export interface ExecutionExtraBase {
|
|
|
416
430
|
export interface ExecutionExtra extends ExecutionExtraBase {
|
|
417
431
|
}
|
|
418
432
|
export interface UnbatchedExecutionExtra extends ExecutionExtraBase {
|
|
433
|
+
stream: ExecutionDetailsStream | null;
|
|
419
434
|
}
|
|
420
435
|
/**
|
|
421
436
|
* A bitwise number representing a number of flags:
|
|
@@ -447,19 +462,26 @@ export type ExecutionValue<TData = any> = BatchExecutionValue<TData> | UnaryExec
|
|
|
447
462
|
interface ExecutionValueBase<TData = any> {
|
|
448
463
|
at(i: number): TData;
|
|
449
464
|
isBatch: boolean;
|
|
465
|
+
/** Returns this.value for a unary execution value; throws if non-unary */
|
|
466
|
+
unaryValue(): TData;
|
|
450
467
|
}
|
|
451
468
|
export interface BatchExecutionValue<TData = any> extends ExecutionValueBase<TData> {
|
|
452
469
|
isBatch: true;
|
|
453
470
|
entries: ReadonlyArray<TData>;
|
|
454
|
-
|
|
471
|
+
/** Always throws, since this should only be called on unary execution values */
|
|
472
|
+
unaryValue(): never;
|
|
455
473
|
}
|
|
456
474
|
export interface UnaryExecutionValue<TData = any> extends ExecutionValueBase<TData> {
|
|
457
475
|
isBatch: false;
|
|
458
476
|
value: TData;
|
|
459
|
-
|
|
477
|
+
/** Same as getting .value */
|
|
478
|
+
unaryValue(): TData;
|
|
460
479
|
}
|
|
461
480
|
export type IndexMap = <T>(callback: (i: number) => T) => ReadonlyArray<T>;
|
|
462
481
|
export type IndexForEach = (callback: (i: number) => any) => void;
|
|
482
|
+
export interface ExecutionDetailsStream {
|
|
483
|
+
initialCount: number;
|
|
484
|
+
}
|
|
463
485
|
export interface ExecutionDetails<TDeps extends readonly [...any[]] = readonly [...any[]]> {
|
|
464
486
|
count: number;
|
|
465
487
|
indexMap: IndexMap;
|
|
@@ -471,9 +493,7 @@ export interface ExecutionDetails<TDeps extends readonly [...any[]] = readonly [
|
|
|
471
493
|
map: ReadonlyArray<ExecutionValue<TDeps[number]>>["map"];
|
|
472
494
|
};
|
|
473
495
|
extra: ExecutionExtra;
|
|
474
|
-
|
|
475
|
-
export interface StreamDetails<TDeps extends readonly [...any[]] = readonly [...any[]]> extends ExecutionDetails<TDeps> {
|
|
476
|
-
streamOptions: StepStreamOptions;
|
|
496
|
+
stream: ExecutionDetailsStream | null;
|
|
477
497
|
}
|
|
478
498
|
export interface LocationDetails {
|
|
479
499
|
node: ASTNode | readonly ASTNode[];
|
|
@@ -482,8 +502,8 @@ export interface LocationDetails {
|
|
|
482
502
|
/** This should only be null for the root selection */
|
|
483
503
|
fieldName: string | null;
|
|
484
504
|
}
|
|
485
|
-
export type UnwrapPlanTuple</* const */ TIn extends readonly
|
|
486
|
-
[Index in keyof TIn]: TIn[Index]
|
|
505
|
+
export type UnwrapPlanTuple</* const */ TIn extends readonly Step[]> = {
|
|
506
|
+
[Index in keyof TIn]: DataFromStep<TIn[Index]>;
|
|
487
507
|
};
|
|
488
508
|
export type NotVariableValueNode = Exclude<ValueNode, VariableNode>;
|
|
489
509
|
export type StreamMaybeMoreableArray<T = any> = Array<T> & {
|
|
@@ -499,14 +519,20 @@ export interface GrafastArgs extends GraphQLArgs {
|
|
|
499
519
|
}
|
|
500
520
|
export type Maybe<T> = T | null | undefined;
|
|
501
521
|
export * from "./planJSONInterfaces.js";
|
|
502
|
-
export interface AddDependencyOptions {
|
|
503
|
-
step:
|
|
522
|
+
export interface AddDependencyOptions<TStep extends Step = Step> {
|
|
523
|
+
step: TStep;
|
|
504
524
|
skipDeduplication?: boolean;
|
|
505
525
|
/** @defaultValue `FLAG_NULL` */
|
|
506
526
|
acceptFlags?: ExecutionEntryFlags;
|
|
507
|
-
onReject?:
|
|
527
|
+
onReject?: Maybe<Error>;
|
|
528
|
+
nonUnaryMessage?: ($dependent: Step, $dependency: Step) => string;
|
|
508
529
|
}
|
|
509
|
-
export
|
|
530
|
+
export interface DependencyOptions<TStep extends Step = Step> {
|
|
531
|
+
step: TStep;
|
|
532
|
+
acceptFlags: ExecutionEntryFlags;
|
|
533
|
+
onReject: Maybe<Error>;
|
|
534
|
+
}
|
|
535
|
+
export type DataFromStep<TStep extends Step> = TStep extends Step<infer TData> ? TData : never;
|
|
510
536
|
export interface GrafastExecutionArgs extends ExecutionArgs {
|
|
511
537
|
resolvedPreset?: GraphileConfig.ResolvedPreset;
|
|
512
538
|
middleware?: Middleware<GraphileConfig.GrafastMiddleware> | null;
|
|
@@ -543,12 +569,7 @@ export interface EstablishOperationPlanEvent {
|
|
|
543
569
|
}
|
|
544
570
|
export interface ExecuteStepEvent {
|
|
545
571
|
args: GrafastExecutionArgs;
|
|
546
|
-
step:
|
|
572
|
+
step: Step;
|
|
547
573
|
executeDetails: ExecutionDetails;
|
|
548
574
|
}
|
|
549
|
-
export interface StreamStepEvent {
|
|
550
|
-
args: GrafastExecutionArgs;
|
|
551
|
-
step: StreamableStep<unknown>;
|
|
552
|
-
streamDetails: StreamDetails;
|
|
553
|
-
}
|
|
554
575
|
//# sourceMappingURL=interfaces.d.ts.map
|