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/prepare.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.grafastPrepare =
|
|
3
|
+
exports.grafastPrepare = grafastPrepare;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const graphql = tslib_1.__importStar(require("graphql"));
|
|
6
6
|
const execute_1 = require("graphql/execution/execute");
|
|
@@ -228,7 +228,7 @@ function executePreemptive(args, operationPlan, variableValues, context, rootVal
|
|
|
228
228
|
const [ctx, result] = outputBucket(operationPlan.rootOutputPlan, subscriptionBucket, ZERO, requestContext, [], rootBucket.store
|
|
229
229
|
.get(operationPlan.variableValuesStep.id)
|
|
230
230
|
.at(rootBucketIndex), outputDataAsString);
|
|
231
|
-
return finalize(result, ctx, index === 0 ? rootValue[interfaces_js_1.$$extensions] ?? undefined : undefined, outputDataAsString);
|
|
231
|
+
return finalize(result, ctx, index === 0 ? (rootValue[interfaces_js_1.$$extensions] ?? undefined) : undefined, outputDataAsString);
|
|
232
232
|
}
|
|
233
233
|
if ((0, utils_js_1.isPromiseLike)(bucketPromise)) {
|
|
234
234
|
return bucketPromise.then(outputStreamBucket);
|
|
@@ -265,6 +265,7 @@ function executePreemptive(args, operationPlan, variableValues, context, rootVal
|
|
|
265
265
|
}
|
|
266
266
|
return payload;
|
|
267
267
|
}
|
|
268
|
+
// NOTE: this is where we determine whether to stream or not
|
|
268
269
|
if (bucketRootValue != null &&
|
|
269
270
|
subscriptionLayerPlan != null &&
|
|
270
271
|
Array.isArray(bucketRootValue) &&
|
|
@@ -399,7 +400,6 @@ function grafastPrepare(args, options = {}) {
|
|
|
399
400
|
const executionTimeout = options.timeouts?.execution ?? null;
|
|
400
401
|
return executePreemptive(args, operationPlan, variableValues, context, rootValue, options.outputDataAsString ?? false, executionTimeout);
|
|
401
402
|
}
|
|
402
|
-
exports.grafastPrepare = grafastPrepare;
|
|
403
403
|
function newIterator(abort) {
|
|
404
404
|
const valueQueue = [];
|
|
405
405
|
const pullQueue = [];
|
|
@@ -417,7 +417,7 @@ function newIterator(abort) {
|
|
|
417
417
|
const cbs = pullQueue.shift();
|
|
418
418
|
if (cbs !== undefined) {
|
|
419
419
|
if ((0, utils_js_1.isPromiseLike)(v)) {
|
|
420
|
-
v.then((v) => cbs[0]({ done, value: v }), (e) => {
|
|
420
|
+
v.then((v) => cbs[0]({ done: false, value: v }), (e) => {
|
|
421
421
|
try {
|
|
422
422
|
const r = cbs[1](e);
|
|
423
423
|
if ((0, utils_js_1.isPromiseLike)(r)) {
|
|
@@ -431,7 +431,7 @@ function newIterator(abort) {
|
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
433
|
else {
|
|
434
|
-
cbs[0]({ done, value: v });
|
|
434
|
+
cbs[0]({ done: false, value: v });
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
else {
|
|
@@ -463,7 +463,7 @@ function newIterator(abort) {
|
|
|
463
463
|
abort();
|
|
464
464
|
for (const entry of pullQueue) {
|
|
465
465
|
try {
|
|
466
|
-
entry[0]({ done, value: undefined });
|
|
466
|
+
entry[0]({ done: true, value: undefined });
|
|
467
467
|
}
|
|
468
468
|
catch (e) {
|
|
469
469
|
// ignore
|
package/dist/step.d.ts
CHANGED
|
@@ -1,47 +1,21 @@
|
|
|
1
1
|
import type { GraphQLObjectType } from "graphql";
|
|
2
2
|
import type { LayerPlan, LayerPlanReasonSubroutine } from "./engine/LayerPlan.js";
|
|
3
3
|
import type { OperationPlan } from "./engine/OperationPlan.js";
|
|
4
|
-
import type { AddDependencyOptions, ExecutionDetails, ExecutionEntryFlags,
|
|
4
|
+
import type { AddDependencyOptions, DependencyOptions, ExecutionDetails, ExecutionEntryFlags, ExecutionResults, GrafastResultsList, JSONValue, PromiseOrDirect, StepOptimizeOptions, UnbatchedExecutionExtra } from "./interfaces.js";
|
|
5
5
|
import { $$subroutine } from "./interfaces.js";
|
|
6
|
-
import type { __ItemStep } from "./steps/index.js";
|
|
7
|
-
declare function reallyAssertFinalized(plan:
|
|
6
|
+
import type { __FlagStep, __ItemStep } from "./steps/index.js";
|
|
7
|
+
declare function reallyAssertFinalized(plan: Step): void;
|
|
8
8
|
export declare const assertFinalized: typeof reallyAssertFinalized;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* ModifierStep (for use when planning arguments/input fields).
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
*
|
|
16
|
-
* Though it might seem that ModifierStep should be used for all inputs
|
|
17
|
-
* (arguments, input objects), this is not the case. When planning an output
|
|
18
|
-
* field, all inputs to it (including arguments, parent plan, context, etc)
|
|
19
|
-
* should be other executable plans. The only time that ModifierStep is used is
|
|
20
|
-
* when writing specific plans as part of the argument or input field
|
|
21
|
-
* definitions themself; even in these cases the inputs to these plan resolvers
|
|
22
|
-
* will be ExecutablePlans.
|
|
10
|
+
* Executable plans are the plans associated with leaves on the GraphQL tree,
|
|
11
|
+
* they must be able to execute to return values.
|
|
23
12
|
*/
|
|
24
|
-
export declare
|
|
13
|
+
export declare class Step<TData = any> {
|
|
25
14
|
readonly operationPlan: OperationPlan;
|
|
26
15
|
[$$subroutine]: LayerPlan<LayerPlanReasonSubroutine> | null;
|
|
27
16
|
isArgumentsFinalized: boolean;
|
|
28
17
|
isFinalized: boolean;
|
|
29
18
|
debug: boolean;
|
|
30
|
-
constructor();
|
|
31
|
-
toString(): string;
|
|
32
|
-
/**
|
|
33
|
-
* This metadata will be merged into toString when referencing this plan.
|
|
34
|
-
*/
|
|
35
|
-
toStringMeta(): string | null;
|
|
36
|
-
planJSONExtra(): Record<string, JSONValue | undefined> | undefined;
|
|
37
|
-
finalize(): void;
|
|
38
|
-
destroy(): void;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Executable plans are the plans associated with leaves on the GraphQL tree,
|
|
42
|
-
* they must be able to execute to return values.
|
|
43
|
-
*/
|
|
44
|
-
export declare class ExecutableStep<TData = any> extends BaseStep {
|
|
45
19
|
static $$export: any;
|
|
46
20
|
/**
|
|
47
21
|
* Setting this true is a performance optimisation, but it comes with strong
|
|
@@ -73,13 +47,7 @@ export declare class ExecutableStep<TData = any> extends BaseStep {
|
|
|
73
47
|
/**
|
|
74
48
|
* The plan this plan will need data from in order to execute.
|
|
75
49
|
*/
|
|
76
|
-
protected readonly dependencies: ReadonlyArray<
|
|
77
|
-
/**
|
|
78
|
-
* What execution entry flags we can't handle for the given indexed dependency
|
|
79
|
-
* (default = this.defaultForbiddenFlags)
|
|
80
|
-
*/
|
|
81
|
-
protected readonly dependencyForbiddenFlags: ReadonlyArray<ExecutionEntryFlags>;
|
|
82
|
-
protected readonly dependencyOnReject: ReadonlyArray<Error | null | undefined>;
|
|
50
|
+
protected readonly dependencies: ReadonlyArray<Step>;
|
|
83
51
|
/**
|
|
84
52
|
* Unique identifier for this step within the plan.
|
|
85
53
|
*/
|
|
@@ -126,17 +94,29 @@ export declare class ExecutableStep<TData = any> extends BaseStep {
|
|
|
126
94
|
*/
|
|
127
95
|
hasSideEffects: boolean;
|
|
128
96
|
constructor();
|
|
97
|
+
/**
|
|
98
|
+
* Generally you should only use this once the dependencies of a step are
|
|
99
|
+
* established, if you use it beforehand and it returns `true` then adding a
|
|
100
|
+
* non-unary dependency later will result in an error.
|
|
101
|
+
*/
|
|
102
|
+
getAndFreezeIsUnary(): boolean;
|
|
129
103
|
protected withMyLayerPlan<T>(callback: () => T): T;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
protected
|
|
104
|
+
/** @experimental */
|
|
105
|
+
withLayerPlan<T>(callback: () => T): T;
|
|
106
|
+
protected getStep(id: number): Step;
|
|
107
|
+
protected getDepOptions<TStep extends Step = Step>(depId: number): DependencyOptions<TStep>;
|
|
108
|
+
protected getDep<TStep extends Step = Step>(_depId: number): TStep | __FlagStep<TStep>;
|
|
109
|
+
protected getDep<TStep extends Step = Step>(_depId: number, throwOnFlagged: true): TStep;
|
|
110
|
+
protected maybeGetDep<TStep extends Step = Step>(depId: number | null | undefined): TStep | __FlagStep<TStep> | null;
|
|
111
|
+
protected maybeGetDep<TStep extends Step = Step>(depId: number | null | undefined, throwOnFlagged: true): TStep | null;
|
|
112
|
+
protected getDepOrConstant<TData = any>(_depId: number | null, _fallback: TData): Step<TData>;
|
|
133
113
|
/**
|
|
134
114
|
* Like getDep, except it skips over __ItemStep and similar steps to get to
|
|
135
115
|
* where the parent really is.
|
|
136
116
|
*
|
|
137
117
|
* @experimental
|
|
138
118
|
*/
|
|
139
|
-
protected getDepDeep(depId: number):
|
|
119
|
+
protected getDepDeep(depId: number): Step;
|
|
140
120
|
/**
|
|
141
121
|
* Cache a generated step by a given identifier (cacheKey) such that we don't
|
|
142
122
|
* need to regenerate it on future calls, significantly reducing the load on
|
|
@@ -144,17 +124,22 @@ export declare class ExecutableStep<TData = any> extends BaseStep {
|
|
|
144
124
|
*
|
|
145
125
|
* @experimental
|
|
146
126
|
*/
|
|
147
|
-
protected cacheStep<T extends
|
|
127
|
+
protected cacheStep<T extends Step>(actionKey: string, cacheKey: symbol | string | number, cb: () => T): T;
|
|
148
128
|
toString(): string;
|
|
149
|
-
|
|
150
|
-
|
|
129
|
+
/**
|
|
130
|
+
* This metadata will be merged into toString when referencing this plan.
|
|
131
|
+
*/
|
|
132
|
+
toStringMeta(): string | null;
|
|
133
|
+
planJSONExtra(): Record<string, JSONValue | undefined> | undefined;
|
|
134
|
+
protected canAddDependency(step: Step): boolean;
|
|
135
|
+
protected addDependency(stepOrOptions: Step | AddDependencyOptions): number;
|
|
151
136
|
/**
|
|
152
137
|
* Adds "unary" dependencies; in `execute({count, values})` you'll receive a
|
|
153
138
|
* `values[index]` (where `index` is the return value of this function) with
|
|
154
139
|
* `isBatch = false` so you can use the `values[index].value` property
|
|
155
140
|
* directly.
|
|
156
141
|
*/
|
|
157
|
-
protected addUnaryDependency(stepOrOptions:
|
|
142
|
+
protected addUnaryDependency(stepOrOptions: Step | AddDependencyOptions): number;
|
|
158
143
|
/**
|
|
159
144
|
* Given a list of "peer" steps, return a list of these `peers` that are
|
|
160
145
|
* equivalent to this step.
|
|
@@ -165,17 +150,17 @@ export declare class ExecutableStep<TData = any> extends BaseStep {
|
|
|
165
150
|
* If you need to transform the peer to be equivalent you should do so via
|
|
166
151
|
* the `deduplicatedWith` callback later.
|
|
167
152
|
*/
|
|
168
|
-
deduplicate?(_peers: readonly
|
|
153
|
+
deduplicate?(_peers: readonly Step[]): readonly Step[];
|
|
169
154
|
/**
|
|
170
155
|
* If this plan is replaced via deduplication, this method gives it a chance
|
|
171
156
|
* to hand over its responsibilities to its replacement.
|
|
172
157
|
*/
|
|
173
|
-
deduplicatedWith?(replacement:
|
|
158
|
+
deduplicatedWith?(replacement: Step): void;
|
|
174
159
|
/**
|
|
175
160
|
* Our chance to optimise the plan (which could go as far as to inline the
|
|
176
161
|
* plan into the parent plan).
|
|
177
162
|
*/
|
|
178
|
-
optimize?(_options: StepOptimizeOptions):
|
|
163
|
+
optimize?(_options: StepOptimizeOptions): Step;
|
|
179
164
|
finalize(): void;
|
|
180
165
|
/**
|
|
181
166
|
* This function will be called with 'execution details', an object containing:
|
|
@@ -202,10 +187,10 @@ export declare class ExecutableStep<TData = any> extends BaseStep {
|
|
|
202
187
|
* add attributes to meta for each purpose (e.g. use `meta.cache` for
|
|
203
188
|
* memoizing results) so that you can expand your usage of meta in future.
|
|
204
189
|
*/
|
|
205
|
-
execute(details: ExecutionDetails):
|
|
190
|
+
execute(details: ExecutionDetails): ExecutionResults<TData>;
|
|
206
191
|
destroy(): void;
|
|
207
192
|
}
|
|
208
|
-
export declare abstract class
|
|
193
|
+
export declare abstract class UnbatchedStep<TData = any> extends Step<TData> {
|
|
209
194
|
static $$export: {
|
|
210
195
|
moduleName: string;
|
|
211
196
|
exportName: string;
|
|
@@ -214,62 +199,45 @@ export declare abstract class UnbatchedExecutableStep<TData = any> extends Execu
|
|
|
214
199
|
execute({ indexMap, values, extra, }: ExecutionDetails): PromiseOrDirect<GrafastResultsList<TData>>;
|
|
215
200
|
abstract unbatchedExecute(extra: UnbatchedExecutionExtra, ...tuple: any[]): PromiseOrDirect<TData>;
|
|
216
201
|
}
|
|
217
|
-
export declare function
|
|
218
|
-
export declare function
|
|
219
|
-
export declare function
|
|
202
|
+
export declare function isStep<TData = any>(step: unknown): step is Step<TData>;
|
|
203
|
+
export declare function assertStep<TData>(step: unknown): asserts step is Step<TData>;
|
|
204
|
+
export declare function isUnbatchedStep<TData = any>(step: unknown): step is UnbatchedStep<TData>;
|
|
220
205
|
export type ObjectLikeStep<TData extends {
|
|
221
|
-
[key: string]:
|
|
206
|
+
[key: string]: Step;
|
|
222
207
|
} = {
|
|
223
|
-
[key: string]:
|
|
224
|
-
}> =
|
|
225
|
-
[key in keyof TData]: TData[key] extends
|
|
208
|
+
[key: string]: Step;
|
|
209
|
+
}> = Step<{
|
|
210
|
+
[key in keyof TData]: TData[key] extends Step<infer U> ? U : never;
|
|
226
211
|
}> & {
|
|
227
|
-
get<TKey extends keyof TData>(key: TKey):
|
|
212
|
+
get<TKey extends keyof TData>(key: TKey): Step<TData[TKey]>;
|
|
228
213
|
};
|
|
229
214
|
export declare function isObjectLikeStep<TData extends {
|
|
230
|
-
[key: string]:
|
|
215
|
+
[key: string]: Step;
|
|
231
216
|
} = {
|
|
232
|
-
[key: string]:
|
|
233
|
-
}>(plan:
|
|
234
|
-
export type ListLikeStep<TData extends [...
|
|
235
|
-
[key in keyof TData]: TData[key] extends
|
|
217
|
+
[key: string]: Step;
|
|
218
|
+
}>(plan: Step): plan is ObjectLikeStep<TData>;
|
|
219
|
+
export type ListLikeStep<TData extends [...Step[]] = [...Step[]]> = Step<{
|
|
220
|
+
[key in keyof TData]: TData[key] extends Step<infer U> ? U : never;
|
|
236
221
|
}> & {
|
|
237
|
-
at<TKey extends keyof TData>(key: TKey):
|
|
222
|
+
at<TKey extends keyof TData>(key: TKey): Step<TData[TKey]>;
|
|
238
223
|
};
|
|
239
|
-
export declare function isListLikeStep<TData extends [...
|
|
240
|
-
export type
|
|
241
|
-
|
|
224
|
+
export declare function isListLikeStep<TData extends [...Step[]] = [...Step[]]>(plan: Step): plan is ListLikeStep<TData>;
|
|
225
|
+
export type PolymorphicStep = Step & {
|
|
226
|
+
planForType(objectType: GraphQLObjectType): Step;
|
|
242
227
|
};
|
|
243
|
-
export declare function
|
|
244
|
-
export
|
|
245
|
-
planForType(objectType: GraphQLObjectType): ExecutableStep;
|
|
246
|
-
};
|
|
247
|
-
export declare function isPolymorphicStep(s: ExecutableStep): s is PolymorphicStep;
|
|
248
|
-
/**
|
|
249
|
-
* Modifier plans modify their parent plan (which may be another ModifierStep
|
|
250
|
-
* or an ExecutableStep). First they gather all the requirements from their
|
|
251
|
-
* children (if any) being applied to them, then they apply themselves to their
|
|
252
|
-
* parent plan. This application is done through the `apply()` method.
|
|
253
|
-
*
|
|
254
|
-
* Modifier plans do not use dependencies.
|
|
255
|
-
*/
|
|
256
|
-
export declare abstract class ModifierStep<TParentStep extends BaseStep = BaseStep> extends BaseStep {
|
|
257
|
-
protected readonly $parent: TParentStep;
|
|
258
|
-
static $$export: any;
|
|
259
|
-
readonly id: string;
|
|
260
|
-
constructor($parent: TParentStep);
|
|
261
|
-
toString(): string;
|
|
262
|
-
/**
|
|
263
|
-
* In this method, you should apply the changes to your `this.$parent` plan
|
|
264
|
-
*/
|
|
265
|
-
abstract apply(): void;
|
|
266
|
-
}
|
|
267
|
-
export declare function isModifierStep<TParentStep extends ExecutableStep | ModifierStep<any>>(plan: BaseStep): plan is ModifierStep<TParentStep>;
|
|
268
|
-
export declare function assertModifierStep<TParentStep extends ExecutableStep | ModifierStep<any>>(plan: BaseStep, pathDescription: string): asserts plan is ModifierStep<TParentStep>;
|
|
269
|
-
export interface ListCapableStep<TOutputData, TItemStep extends ExecutableStep<TOutputData> = ExecutableStep<TOutputData>> extends ExecutableStep<ReadonlyArray<any>> {
|
|
228
|
+
export declare function isPolymorphicStep(s: Step): s is PolymorphicStep;
|
|
229
|
+
export interface ListCapableStep<TOutputData, TItemStep extends Step<TOutputData> = Step<TOutputData>> extends Step<ReadonlyArray<any>> {
|
|
270
230
|
listItem(itemPlan: __ItemStep<this>): TItemStep;
|
|
271
231
|
}
|
|
272
|
-
export declare function isListCapableStep<TData, TItemStep extends
|
|
273
|
-
export declare function assertListCapableStep<TData, TItemStep extends
|
|
274
|
-
export {
|
|
232
|
+
export declare function isListCapableStep<TData, TItemStep extends Step<TData>>(plan: Step<ReadonlyArray<TData>>): plan is ListCapableStep<TData, TItemStep>;
|
|
233
|
+
export declare function assertListCapableStep<TData, TItemStep extends Step<TData>>(plan: Step<ReadonlyArray<TData>>, pathDescription: string): asserts plan is ListCapableStep<TData, TItemStep>;
|
|
234
|
+
export {
|
|
235
|
+
/** @deprecated Use ExecutableStep instead */
|
|
236
|
+
Step as ExecutableStep,
|
|
237
|
+
/** @deprecated Use UnbatchedStep instead */
|
|
238
|
+
UnbatchedStep as UnbatchedExecutableStep, };
|
|
239
|
+
/** @deprecated Use isStep instead */
|
|
240
|
+
export declare const isExecutableStep: typeof isStep;
|
|
241
|
+
/** @deprecated Use isStep instead */
|
|
242
|
+
export declare function assertExecutableStep<TData>(step: unknown): asserts step is Step<TData>;
|
|
275
243
|
//# sourceMappingURL=step.d.ts.map
|