grafast 0.0.1-0.1 → 0.0.1-0.10
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/LICENSES.txt +27 -0
- package/dist/args.d.ts +1 -1
- package/dist/config.d.ts +12 -2
- package/dist/constraints.d.ts +1 -1
- package/dist/engine/LayerPlan.d.ts +81 -0
- package/dist/engine/OperationPlan.d.ts +120 -0
- package/dist/engine/OutputPlan.d.ts +84 -0
- package/dist/engine/StepTracker.d.ts +35 -0
- package/dist/engine/executeBucket.d.ts +5 -0
- package/dist/engine/executeOutputPlan.d.ts +42 -0
- package/dist/engine/lib/withGlobalLayerPlan.d.ts +5 -0
- package/dist/error.d.ts +2 -0
- package/dist/establishOperationPlan.d.ts +17 -1
- package/dist/execute.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -6
- package/dist/input.d.ts +1 -1
- package/dist/interfaces.d.ts +35 -35
- package/dist/makeGrafastSchema.d.ts +7 -7
- package/dist/prepare.d.ts +9 -2
- package/dist/step.d.ts +3 -3
- package/dist/steps/__inputDynamicScalar.d.ts +18 -0
- package/dist/steps/__inputList.d.ts +23 -0
- package/dist/steps/__inputObject.d.ts +24 -0
- package/dist/steps/__inputStaticLeaf.d.ts +15 -0
- package/dist/steps/__item.d.ts +19 -0
- package/dist/steps/__trackedObject.d.ts +28 -0
- package/dist/steps/__value.d.ts +16 -0
- package/dist/steps/access.d.ts +24 -0
- package/dist/steps/connection.d.ts +84 -0
- package/dist/steps/constant.d.ts +20 -0
- package/dist/steps/deepEval.d.ts +19 -0
- package/dist/steps/each.d.ts +5 -0
- package/dist/steps/error.d.ts +15 -0
- package/dist/steps/filter.d.ts +6 -0
- package/dist/steps/first.d.ts +18 -0
- package/dist/steps/graphqlResolver.d.ts +65 -0
- package/dist/steps/groupBy.d.ts +5 -0
- package/dist/steps/index.d.ts +37 -0
- package/dist/steps/lambda.d.ts +23 -0
- package/dist/steps/last.d.ts +17 -0
- package/dist/steps/list.d.ts +24 -0
- package/dist/steps/listTransform.d.ts +45 -0
- package/dist/steps/listen.d.ts +26 -0
- package/dist/steps/loadMany.d.ts +47 -0
- package/dist/steps/loadOne.d.ts +30 -0
- package/dist/steps/map.d.ts +26 -0
- package/dist/steps/node.d.ts +29 -0
- package/dist/steps/object.d.ts +49 -0
- package/dist/steps/partitionByIndex.d.ts +4 -0
- package/dist/steps/proxy.d.ts +28 -0
- package/dist/steps/reverse.d.ts +18 -0
- package/dist/steps/setter.d.ts +27 -0
- package/dist/stringifyPayload.d.ts +1 -1
- package/dist/subscribe.d.ts +1 -1
- package/dist/utils.d.ts +14 -10
- package/package.json +10 -4
package/dist/LICENSES.txt
CHANGED
|
@@ -253,6 +253,33 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
253
253
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
254
254
|
|
|
255
255
|
|
|
256
|
+
--------------------------------------------------------------------------------
|
|
257
|
+
tamedevil v0.0.0-0.3 - Benjie Gillam <benjie@jemjie.com>
|
|
258
|
+
git+https://github.com/graphile/heart.git
|
|
259
|
+
--------------------------------------------------------------------------------
|
|
260
|
+
|
|
261
|
+
# The MIT License (MIT)
|
|
262
|
+
|
|
263
|
+
Copyright © `2023` Benjie Gillam
|
|
264
|
+
|
|
265
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
266
|
+
this software and associated documentation files (the “Software”), to deal in
|
|
267
|
+
the Software without restriction, including without limitation the rights to
|
|
268
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
269
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
270
|
+
subject to the following conditions:
|
|
271
|
+
|
|
272
|
+
The above copyright notice and this permission notice shall be included in all
|
|
273
|
+
copies or substantial portions of the Software.
|
|
274
|
+
|
|
275
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
276
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
277
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
278
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
279
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
280
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
281
|
+
|
|
282
|
+
|
|
256
283
|
--------------------------------------------------------------------------------
|
|
257
284
|
tslib v2.4.0 - Microsoft Corp.
|
|
258
285
|
https://github.com/Microsoft/tslib.git
|
package/dist/args.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ExecutionArgs } from "graphql";
|
|
2
|
-
export declare function hookArgs(args: ExecutionArgs, ctx: GraphileConfig.GraphQLRequestContext
|
|
2
|
+
export declare function hookArgs(args: ExecutionArgs, ctx: Partial<GraphileConfig.GraphQLRequestContext>, resolvedPreset?: GraphileConfig.ResolvedPreset): ExecutionArgs | PromiseLike<ExecutionArgs>;
|
|
3
3
|
//# sourceMappingURL=args.d.ts.map
|
package/dist/config.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import type { AsyncHooks, PluginHook } from "graphile-config";
|
|
2
2
|
export declare const NULL_PRESET: GraphileConfig.ResolvedPreset;
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type GraphileConfigModule = typeof import("graphile-config");
|
|
4
|
+
type PromiseOrValue<T> = T | Promise<T>;
|
|
5
5
|
export declare function withGraphileConfig<T>(callback: (graphileConfig: GraphileConfigModule | null) => PromiseOrValue<T>): PromiseOrValue<T>;
|
|
6
|
+
declare const $$skipHooks: unique symbol;
|
|
7
|
+
declare const $$hooksForPreset: unique symbol;
|
|
8
|
+
declare global {
|
|
9
|
+
namespace GraphileConfig {
|
|
10
|
+
interface ResolvedPreset {
|
|
11
|
+
[$$hooksForPreset]?: null | AsyncHooks<GraphileConfig.GrafastHooks>;
|
|
12
|
+
[$$skipHooks]?: Record<string, boolean>;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
6
16
|
export declare function withHooks<TResult>(resolvedPreset: GraphileConfig.ResolvedPreset, callback: (hooks: AsyncHooks<GraphileConfig.GrafastHooks> | null) => PromiseOrValue<TResult>): PromiseOrValue<TResult>;
|
|
7
17
|
export declare function hook<THookName extends keyof GraphileConfig.GrafastHooks>(resolvedPreset: GraphileConfig.ResolvedPreset, hookName: THookName, ...args: Parameters<GraphileConfig.GrafastHooks[THookName] extends PluginHook<infer U> ? U : never>): PromiseOrValue<void>;
|
|
8
18
|
export {};
|
package/dist/constraints.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ interface IsEmptyConstraint {
|
|
|
24
24
|
path: (string | number)[];
|
|
25
25
|
isEmpty: boolean;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export type Constraint = ValueConstraint | EqualityConstraint | ExistsConstraint | LengthConstraint | IsEmptyConstraint;
|
|
28
28
|
export declare function matchesConstraints(constraints: Constraint[], object: unknown): boolean;
|
|
29
29
|
export {};
|
|
30
30
|
//# sourceMappingURL=constraints.d.ts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { TE } from "tamedevil";
|
|
2
|
+
import type { Bucket } from "../bucket.js";
|
|
3
|
+
import type { ExecutableStep, ModifierStep, UnbatchedExecutableStep } from "../step";
|
|
4
|
+
import type { OperationPlan } from "./OperationPlan";
|
|
5
|
+
export interface LayerPlanReasonRoot {
|
|
6
|
+
type: "root";
|
|
7
|
+
}
|
|
8
|
+
export interface LayerPlanReasonNullableField {
|
|
9
|
+
type: "nullableBoundary";
|
|
10
|
+
parentStep: ExecutableStep;
|
|
11
|
+
}
|
|
12
|
+
export interface LayerPlanReasonListItem {
|
|
13
|
+
type: "listItem";
|
|
14
|
+
parentStep: ExecutableStep;
|
|
15
|
+
stream?: {
|
|
16
|
+
initialCount: number;
|
|
17
|
+
label?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface LayerPlanReasonSubscription {
|
|
21
|
+
type: "subscription";
|
|
22
|
+
}
|
|
23
|
+
export interface LayerPlanReasonMutationField {
|
|
24
|
+
type: "mutationField";
|
|
25
|
+
}
|
|
26
|
+
export interface LayerPlanReasonDefer {
|
|
27
|
+
type: "defer";
|
|
28
|
+
label?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface LayerPlanReasonPolymorphic {
|
|
31
|
+
type: "polymorphic";
|
|
32
|
+
typeNames: string[];
|
|
33
|
+
parentStep: ExecutableStep;
|
|
34
|
+
}
|
|
35
|
+
export interface LayerPlanReasonSubroutine {
|
|
36
|
+
type: "subroutine";
|
|
37
|
+
parentStep: ExecutableStep;
|
|
38
|
+
}
|
|
39
|
+
export declare function isBranchingLayerPlan(layerPlan: LayerPlan<any>): boolean;
|
|
40
|
+
export declare function isDeferredLayerPlan(layerPlan: LayerPlan<any>): boolean;
|
|
41
|
+
export declare function isPolymorphicLayerPlan(layerPlan: LayerPlan<any>): boolean;
|
|
42
|
+
export type LayerPlanReason = LayerPlanReasonRoot | LayerPlanReasonNullableField | LayerPlanReasonListItem | LayerPlanReasonSubscription | LayerPlanReasonMutationField | LayerPlanReasonDefer | LayerPlanReasonPolymorphic | LayerPlanReasonSubroutine;
|
|
43
|
+
export type HasParent<A extends LayerPlanReason> = A extends any ? A extends {
|
|
44
|
+
parentStep: ExecutableStep;
|
|
45
|
+
} ? A : never : never;
|
|
46
|
+
export type LayerPlanReasonsWithParentStep = HasParent<LayerPlanReason>;
|
|
47
|
+
export interface LayerPlanPhase {
|
|
48
|
+
normalSteps?: Array<{
|
|
49
|
+
step: ExecutableStep;
|
|
50
|
+
}>;
|
|
51
|
+
unbatchedSyncAndSafeSteps?: Array<{
|
|
52
|
+
step: UnbatchedExecutableStep;
|
|
53
|
+
scratchpad: any;
|
|
54
|
+
}>;
|
|
55
|
+
_allSteps: ExecutableStep[];
|
|
56
|
+
}
|
|
57
|
+
export declare class LayerPlan<TReason extends LayerPlanReason = LayerPlanReason> {
|
|
58
|
+
readonly operationPlan: OperationPlan;
|
|
59
|
+
parentLayerPlan: LayerPlan | null;
|
|
60
|
+
readonly reason: TReason;
|
|
61
|
+
polymorphicPaths: ReadonlySet<string>;
|
|
62
|
+
id: number;
|
|
63
|
+
readonly rootStep: ExecutableStep | null;
|
|
64
|
+
copyPlanIds: number[];
|
|
65
|
+
children: LayerPlan[];
|
|
66
|
+
steps: ExecutableStep[];
|
|
67
|
+
pendingSteps: ExecutableStep[];
|
|
68
|
+
phases: Array<LayerPlanPhase>;
|
|
69
|
+
ancestry: LayerPlan[];
|
|
70
|
+
constructor(operationPlan: OperationPlan, parentLayerPlan: LayerPlan | null, reason: TReason, polymorphicPaths: ReadonlySet<string>);
|
|
71
|
+
toString(): string;
|
|
72
|
+
print(depth?: number): string;
|
|
73
|
+
setRootStep($root: ExecutableStep): void;
|
|
74
|
+
getStep(id: number, requestingStep: ExecutableStep): ExecutableStep;
|
|
75
|
+
_addStep(step: ExecutableStep): number;
|
|
76
|
+
_addModifierStep(step: ModifierStep<any>): string;
|
|
77
|
+
makeNewBucketCallback(this: LayerPlan<TReason>, inner: TE): typeof this.newBucket;
|
|
78
|
+
finalize(): void;
|
|
79
|
+
newBucket(parentBucket: Bucket): Bucket | null;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=LayerPlan.d.ts.map
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { FragmentDefinitionNode, GraphQLObjectType, GraphQLSchema, GraphQLUnionType, OperationDefinitionNode } from "graphql";
|
|
2
|
+
import type { Constraint } from "../constraints.js";
|
|
3
|
+
import type { ModifierStep } from "../index.js";
|
|
4
|
+
import { __TrackedObjectStep, __ValueStep, ExecutableStep } from "../index.js";
|
|
5
|
+
import type { PrintPlanGraphOptions } from "../mermaid.js";
|
|
6
|
+
import type { LayerPlanReasonSubroutine } from "./LayerPlan.js";
|
|
7
|
+
import { LayerPlan } from "./LayerPlan.js";
|
|
8
|
+
import { OutputPlan } from "./OutputPlan.js";
|
|
9
|
+
import { StepTracker } from "./StepTracker.js";
|
|
10
|
+
export declare const POLYMORPHIC_ROOT_PATH = "";
|
|
11
|
+
export type OperationPlanPhase = "init" | "plan" | "validate" | "optimize" | "finalize" | "ready";
|
|
12
|
+
export interface MetaByMetaKey {
|
|
13
|
+
[metaKey: string | number | symbol]: Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
export declare class OperationPlan {
|
|
16
|
+
readonly schema: GraphQLSchema;
|
|
17
|
+
readonly operation: OperationDefinitionNode;
|
|
18
|
+
readonly fragments: {
|
|
19
|
+
[fragmentName: string]: FragmentDefinitionNode;
|
|
20
|
+
};
|
|
21
|
+
readonly variableValues: {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
};
|
|
24
|
+
readonly context: {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
};
|
|
27
|
+
readonly rootValue: any;
|
|
28
|
+
readonly queryType: GraphQLObjectType;
|
|
29
|
+
readonly mutationType: GraphQLObjectType | null;
|
|
30
|
+
readonly subscriptionType: GraphQLObjectType | null;
|
|
31
|
+
readonly unionsContainingObjectType: {
|
|
32
|
+
[objectTypeName: string]: ReadonlyArray<GraphQLUnionType>;
|
|
33
|
+
};
|
|
34
|
+
private operationType;
|
|
35
|
+
phase: OperationPlanPhase;
|
|
36
|
+
loc: string[] | null;
|
|
37
|
+
rootLayerPlan: LayerPlan;
|
|
38
|
+
rootOutputPlan: OutputPlan;
|
|
39
|
+
private modifierStepCount;
|
|
40
|
+
private modifierDepthCount;
|
|
41
|
+
private modifierSteps;
|
|
42
|
+
readonly stepTracker: StepTracker;
|
|
43
|
+
private maxDeduplicatedStepId;
|
|
44
|
+
private maxValidatedStepId;
|
|
45
|
+
readonly variableValuesConstraints: Constraint[];
|
|
46
|
+
readonly variableValuesStep: __ValueStep<{
|
|
47
|
+
[key: string]: any;
|
|
48
|
+
}>;
|
|
49
|
+
readonly trackedVariableValuesStep: __TrackedObjectStep<{
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
}>;
|
|
52
|
+
readonly contextConstraints: Constraint[];
|
|
53
|
+
readonly contextStep: __ValueStep<{
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}>;
|
|
56
|
+
readonly trackedContextStep: __TrackedObjectStep<{
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
}>;
|
|
59
|
+
readonly rootValueConstraints: Constraint[];
|
|
60
|
+
readonly rootValueStep: __ValueStep<any>;
|
|
61
|
+
readonly trackedRootValueStep: __TrackedObjectStep<any>;
|
|
62
|
+
makeMetaByMetaKey: () => MetaByMetaKey;
|
|
63
|
+
readonly itemStepIdByListStepId: {
|
|
64
|
+
[listStepId: number]: number | undefined;
|
|
65
|
+
};
|
|
66
|
+
pure: boolean;
|
|
67
|
+
constructor(schema: GraphQLSchema, operation: OperationDefinitionNode, fragments: {
|
|
68
|
+
[fragmentName: string]: FragmentDefinitionNode;
|
|
69
|
+
}, variableValues: {
|
|
70
|
+
[key: string]: any;
|
|
71
|
+
}, context: {
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
}, rootValue: any);
|
|
74
|
+
addLayerPlan(layerPlan: LayerPlan): number;
|
|
75
|
+
_addStep(plan: ExecutableStep): number;
|
|
76
|
+
_addModifierStep(step: ModifierStep<any>): string;
|
|
77
|
+
getStep: (id: number, requestingStep: ExecutableStep) => ExecutableStep;
|
|
78
|
+
dangerouslyGetStep(id: number): ExecutableStep;
|
|
79
|
+
private planOperation;
|
|
80
|
+
private planQuery;
|
|
81
|
+
private planMutation;
|
|
82
|
+
private planSubscription;
|
|
83
|
+
private itemStepForListStep;
|
|
84
|
+
private planSelectionSet;
|
|
85
|
+
private planIntoOutputPlan;
|
|
86
|
+
private polymorphicLayerPlanByPathByLayerPlan;
|
|
87
|
+
private getPolymorphicLayerPlan;
|
|
88
|
+
private planField;
|
|
89
|
+
private getTrackedArguments;
|
|
90
|
+
withModifiers<T>(cb: () => T): T;
|
|
91
|
+
private track;
|
|
92
|
+
private validateSteps;
|
|
93
|
+
private replaceStep;
|
|
94
|
+
processSteps(actionDescription: string, fromStepId: number, order: "dependents-first" | "dependencies-first", callback: (plan: ExecutableStep<any>) => ExecutableStep<any>): void;
|
|
95
|
+
private getPeers;
|
|
96
|
+
private isImmoveable;
|
|
97
|
+
private hoistStep;
|
|
98
|
+
private pushDown;
|
|
99
|
+
private _deduplicateInnerLogic;
|
|
100
|
+
private deduplicateStep;
|
|
101
|
+
private deduplicateSteps;
|
|
102
|
+
private hoistSteps;
|
|
103
|
+
private pushDownSteps;
|
|
104
|
+
private getStepOptionsForStep;
|
|
105
|
+
private optimizeStep;
|
|
106
|
+
private optimizeSteps;
|
|
107
|
+
private finalizeSteps;
|
|
108
|
+
private finalizeLayerPlans;
|
|
109
|
+
private optimizeOutputPlans;
|
|
110
|
+
private finalizeOutputPlans;
|
|
111
|
+
private walkOutputPlans;
|
|
112
|
+
printPlanGraph(options?: PrintPlanGraphOptions): string;
|
|
113
|
+
finishSubroutine(subroutineStep: ExecutableStep, layerPlan: LayerPlan<LayerPlanReasonSubroutine>): void;
|
|
114
|
+
deleteLayerPlan(layerPlan: LayerPlan): void;
|
|
115
|
+
getStepsByMetaKey(metaKey: string | number | symbol): ExecutableStep[];
|
|
116
|
+
getStepsByStepClass<TClass extends ExecutableStep>(klass: {
|
|
117
|
+
new (...args: any[]): TClass;
|
|
118
|
+
}): TClass[];
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=OperationPlan.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type LRU from "@graphile/lru";
|
|
2
|
+
import type { FieldNode, GraphQLEnumType, GraphQLObjectType, GraphQLScalarType } from "graphql";
|
|
3
|
+
import { GraphQLError } from "graphql";
|
|
4
|
+
import type { Bucket } from "../bucket.js";
|
|
5
|
+
import type { JSONValue, LocationDetails } from "../interfaces.js";
|
|
6
|
+
import type { ExecutableStep } from "../step.js";
|
|
7
|
+
import type { PayloadRoot } from "./executeOutputPlan.js";
|
|
8
|
+
import type { LayerPlan } from "./LayerPlan.js";
|
|
9
|
+
export type OutputPlanTypeIntrospection = {
|
|
10
|
+
mode: "introspection";
|
|
11
|
+
field: FieldNode;
|
|
12
|
+
variableNames: string[];
|
|
13
|
+
introspectionCacheByVariableValues: LRU<string, JSONValue>;
|
|
14
|
+
};
|
|
15
|
+
export type OutputPlanTypeRoot = {
|
|
16
|
+
mode: "root";
|
|
17
|
+
typeName: string;
|
|
18
|
+
};
|
|
19
|
+
export type OutputPlanTypeObject = {
|
|
20
|
+
mode: "object";
|
|
21
|
+
typeName: string;
|
|
22
|
+
deferLabel: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
export type OutputPlanTypePolymorphicObject = {
|
|
25
|
+
mode: "polymorphic";
|
|
26
|
+
typeNames: string[];
|
|
27
|
+
deferLabel: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
export type OutputPlanTypeArray = {
|
|
30
|
+
mode: "array";
|
|
31
|
+
};
|
|
32
|
+
export type OutputPlanTypeLeaf = {
|
|
33
|
+
mode: "leaf";
|
|
34
|
+
serialize: GraphQLScalarType["serialize"];
|
|
35
|
+
graphqlType: GraphQLScalarType | GraphQLEnumType;
|
|
36
|
+
};
|
|
37
|
+
export type OutputPlanTypeNull = {
|
|
38
|
+
mode: "null";
|
|
39
|
+
};
|
|
40
|
+
export type OutputPlanType = OutputPlanTypeRoot | OutputPlanTypeObject | OutputPlanTypePolymorphicObject | OutputPlanTypeLeaf | OutputPlanTypeNull | OutputPlanTypeArray | OutputPlanTypeIntrospection;
|
|
41
|
+
export type OutputPlanKeyValueOutputPlan = {
|
|
42
|
+
type: "outputPlan";
|
|
43
|
+
outputPlan: OutputPlan;
|
|
44
|
+
isNonNull: boolean;
|
|
45
|
+
locationDetails: LocationDetails;
|
|
46
|
+
};
|
|
47
|
+
export type OutputPlanKeyValueTypeName = {
|
|
48
|
+
type: "__typename";
|
|
49
|
+
locationDetails: LocationDetails;
|
|
50
|
+
};
|
|
51
|
+
export type OutputPlanKeyValue = OutputPlanKeyValueOutputPlan | OutputPlanKeyValueTypeName;
|
|
52
|
+
export type OutputPlanKeyValueOutputPlanWithCachedBits = OutputPlanKeyValueOutputPlan & {
|
|
53
|
+
layerPlanId: number;
|
|
54
|
+
};
|
|
55
|
+
export declare class OutputPlan<TType extends OutputPlanType = OutputPlanType> {
|
|
56
|
+
layerPlan: LayerPlan;
|
|
57
|
+
readonly type: TType;
|
|
58
|
+
readonly locationDetails: LocationDetails;
|
|
59
|
+
readonly rootStep: ExecutableStep;
|
|
60
|
+
private processRoot;
|
|
61
|
+
keys: {
|
|
62
|
+
[key: string]: OutputPlanKeyValueTypeName | OutputPlanKeyValueOutputPlanWithCachedBits;
|
|
63
|
+
};
|
|
64
|
+
child: OutputPlan | null;
|
|
65
|
+
childIsNonNull: boolean;
|
|
66
|
+
childByTypeName: {
|
|
67
|
+
[typeName: string]: OutputPlan<OutputPlanTypeObject>;
|
|
68
|
+
};
|
|
69
|
+
deferredOutputPlans: OutputPlan<OutputPlanTypeObject | OutputPlanTypePolymorphicObject>[];
|
|
70
|
+
constructor(layerPlan: LayerPlan, rootStep: ExecutableStep, type: TType, locationDetails: LocationDetails);
|
|
71
|
+
print(): string;
|
|
72
|
+
toString(): string;
|
|
73
|
+
addChild(type: GraphQLObjectType | null, key: string | null, child: OutputPlanKeyValue): void;
|
|
74
|
+
getLayerPlans(layerPlans?: Set<LayerPlan<import("./LayerPlan.js").LayerPlanReason>>): Set<LayerPlan>;
|
|
75
|
+
makeNextStepByLayerPlan(): Record<number, any[]>;
|
|
76
|
+
execute(this: OutputPlan, _root: PayloadRoot, _mutablePath: Array<string | number>, _bucket: Bucket, _bucketIndex: number): JSONValue;
|
|
77
|
+
executeString(this: OutputPlan, _root: PayloadRoot, _mutablePath: Array<string | number>, _bucket: Bucket, _bucketIndex: number): string;
|
|
78
|
+
optimize(): void;
|
|
79
|
+
finalize(): void;
|
|
80
|
+
}
|
|
81
|
+
export declare function coerceError(error: Error, locationDetails: LocationDetails, path: ReadonlyArray<string | number>): GraphQLError;
|
|
82
|
+
export declare function nonNullError(locationDetails: LocationDetails, path: readonly (string | number)[]): GraphQLError;
|
|
83
|
+
export declare function getChildBucketAndIndex(childOutputPlan: OutputPlan, outputPlan: OutputPlan | null, bucket: Bucket, bucketIndex: number, arrayIndex?: number | null): [Bucket, number] | null;
|
|
84
|
+
//# sourceMappingURL=OutputPlan.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { OperationPlan } from "../index.js";
|
|
2
|
+
import type { ExecutableStep } from "../step";
|
|
3
|
+
import type { LayerPlan, LayerPlanReasonsWithParentStep } from "./LayerPlan";
|
|
4
|
+
import type { OutputPlan } from "./OutputPlan";
|
|
5
|
+
export declare class StepTracker {
|
|
6
|
+
private readonly operationPlan;
|
|
7
|
+
stepCount: number;
|
|
8
|
+
activeSteps: Set<ExecutableStep<any>>;
|
|
9
|
+
stepById: {
|
|
10
|
+
[stepId: number]: ExecutableStep;
|
|
11
|
+
};
|
|
12
|
+
private aliasesById;
|
|
13
|
+
stepsWithNoDependencies: Set<ExecutableStep<any>>;
|
|
14
|
+
outputPlansByRootStep: Map<ExecutableStep<any>, Set<OutputPlan<import("./OutputPlan").OutputPlanType>>>;
|
|
15
|
+
layerPlansByRootStep: Map<ExecutableStep<any>, Set<LayerPlan<import("./LayerPlan").LayerPlanReason>>>;
|
|
16
|
+
layerPlansByParentStep: Map<ExecutableStep<any>, Set<LayerPlan<LayerPlanReasonsWithParentStep>>>;
|
|
17
|
+
layerPlans: Array<LayerPlan | null>;
|
|
18
|
+
allOutputPlans: OutputPlan[];
|
|
19
|
+
constructor(operationPlan: OperationPlan);
|
|
20
|
+
private assertPhaseNot;
|
|
21
|
+
addStep($step: ExecutableStep): number;
|
|
22
|
+
addLayerPlan(layerPlan: LayerPlan): number;
|
|
23
|
+
addOutputPlan(outputPlan: OutputPlan): void;
|
|
24
|
+
deleteLayerPlan(layerPlan: LayerPlan): void;
|
|
25
|
+
getStepById(id: number): ExecutableStep;
|
|
26
|
+
getStepById(id: number, allowUnset: true): ExecutableStep | null;
|
|
27
|
+
addStepDependency($dependent: ExecutableStep, $dependency: ExecutableStep): number;
|
|
28
|
+
setOutputPlanRootStep(outputPlan: OutputPlan, $dependency: ExecutableStep): void;
|
|
29
|
+
setLayerPlanRootStep(layerPlan: LayerPlan, $dependency: ExecutableStep): void;
|
|
30
|
+
replaceStep($original: ExecutableStep, $replacement: ExecutableStep): void;
|
|
31
|
+
treeShakeSteps(): void;
|
|
32
|
+
private isNotNeeded;
|
|
33
|
+
private eradicate;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=StepTracker.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Bucket, RequestContext } from "../bucket.js";
|
|
2
|
+
import type { PromiseOrDirect } from "../interfaces.js";
|
|
3
|
+
export declare function executeBucket(bucket: Bucket, requestContext: RequestContext): PromiseOrDirect<void>;
|
|
4
|
+
export declare function newBucket(spec: Pick<Bucket, "layerPlan" | "store" | "size" | "hasErrors" | "polymorphicPathList">): Bucket;
|
|
5
|
+
//# sourceMappingURL=executeBucket.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { GraphQLError } from "graphql";
|
|
2
|
+
import type { Bucket, RequestContext } from "../bucket.js";
|
|
3
|
+
import type { JSONValue } from "../interfaces.js";
|
|
4
|
+
import type { OutputPlan } from "./OutputPlan.js";
|
|
5
|
+
export type OutputPath = Array<string | number>;
|
|
6
|
+
export interface OutputStream {
|
|
7
|
+
asyncIterable: AsyncIterableIterator<any>;
|
|
8
|
+
}
|
|
9
|
+
export interface PayloadRoot {
|
|
10
|
+
insideGraphQL: boolean;
|
|
11
|
+
errors: GraphQLError[];
|
|
12
|
+
queue: Array<SubsequentPayloadSpec>;
|
|
13
|
+
streams: Array<SubsequentStreamSpec>;
|
|
14
|
+
variables: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface OutputPlanContext {
|
|
19
|
+
requestContext: RequestContext;
|
|
20
|
+
root: PayloadRoot;
|
|
21
|
+
path: ReadonlyArray<string | number>;
|
|
22
|
+
}
|
|
23
|
+
export interface SubsequentPayloadSpec {
|
|
24
|
+
root: PayloadRoot;
|
|
25
|
+
path: ReadonlyArray<string | number>;
|
|
26
|
+
bucket: Bucket;
|
|
27
|
+
bucketIndex: number;
|
|
28
|
+
outputPlan: OutputPlan;
|
|
29
|
+
label: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
export interface SubsequentStreamSpec {
|
|
32
|
+
root: PayloadRoot;
|
|
33
|
+
path: ReadonlyArray<string | number>;
|
|
34
|
+
bucket: Bucket;
|
|
35
|
+
bucketIndex: number;
|
|
36
|
+
outputPlan: OutputPlan;
|
|
37
|
+
label: string | undefined;
|
|
38
|
+
stream: AsyncIterableIterator<any>;
|
|
39
|
+
startIndex: number;
|
|
40
|
+
}
|
|
41
|
+
export declare function executeOutputPlan(ctx: OutputPlanContext, outputPlan: OutputPlan, bucket: Bucket, bucketIndex: number, outputDataAsString: boolean): JSONValue;
|
|
42
|
+
//# sourceMappingURL=executeOutputPlan.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LayerPlan } from "../LayerPlan";
|
|
2
|
+
export declare function withGlobalLayerPlan<T>(layerPlan: LayerPlan, polymorphicPaths: ReadonlySet<string>, callback: () => T): T;
|
|
3
|
+
export declare function currentLayerPlan(): LayerPlan;
|
|
4
|
+
export declare function currentPolymorphicPaths(): ReadonlySet<string>;
|
|
5
|
+
//# sourceMappingURL=withGlobalLayerPlan.d.ts.map
|
package/dist/error.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { $$extensions } from "./interfaces.js";
|
|
1
2
|
export interface GrafastError extends Error {
|
|
2
3
|
originalError: Error;
|
|
4
|
+
[$$extensions]?: Record<string, any>;
|
|
3
5
|
}
|
|
4
6
|
export declare const $$error: unique symbol;
|
|
5
7
|
export declare class _GrafastError extends Error implements GrafastError {
|
|
@@ -1,9 +1,25 @@
|
|
|
1
|
+
import LRU from "@graphile/lru";
|
|
1
2
|
import type { FragmentDefinitionNode, GraphQLSchema, OperationDefinitionNode } from "graphql";
|
|
2
3
|
import { OperationPlan } from "./index.js";
|
|
3
4
|
import type { BaseGraphQLContext, BaseGraphQLRootValue, BaseGraphQLVariables } from "./interfaces.js";
|
|
4
|
-
|
|
5
|
+
type Fragments = {
|
|
5
6
|
[key: string]: FragmentDefinitionNode;
|
|
6
7
|
};
|
|
8
|
+
interface LinkedList<T> {
|
|
9
|
+
value: T;
|
|
10
|
+
next: LinkedList<T> | null;
|
|
11
|
+
}
|
|
12
|
+
interface Cache {
|
|
13
|
+
possibleOpPlans: LinkedList<OperationPlan>;
|
|
14
|
+
fragments: Fragments;
|
|
15
|
+
}
|
|
16
|
+
type CacheByOperation = LRU<OperationDefinitionNode, Cache>;
|
|
17
|
+
declare const $$cacheByOperation: unique symbol;
|
|
18
|
+
declare module "graphql" {
|
|
19
|
+
interface GraphQLSchema {
|
|
20
|
+
[$$cacheByOperation]?: CacheByOperation;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
7
23
|
export declare function establishOperationPlan<TVariables extends BaseGraphQLVariables = BaseGraphQLVariables, TContext extends BaseGraphQLContext = BaseGraphQLContext, TRootValue extends BaseGraphQLRootValue = BaseGraphQLRootValue>(schema: GraphQLSchema, operation: OperationDefinitionNode, fragments: Fragments, variableValues: TVariables, context: TContext, rootValue: TRootValue): OperationPlan;
|
|
8
24
|
export {};
|
|
9
25
|
//# sourceMappingURL=establishOperationPlan.d.ts.map
|
package/dist/execute.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AsyncExecutionResult, ExecutionArgs, ExecutionResult } from "graphql";
|
|
2
2
|
import type { PromiseOrValue } from "graphql/jsutils/PromiseOrValue";
|
|
3
|
-
export declare function withGrafastArgs(args: ExecutionArgs, resolvedPreset: GraphileConfig.ResolvedPreset,
|
|
4
|
-
export declare function execute(args: ExecutionArgs, resolvedPreset?: GraphileConfig.ResolvedPreset,
|
|
3
|
+
export declare function withGrafastArgs(args: ExecutionArgs, resolvedPreset: GraphileConfig.ResolvedPreset, outputDataAsString: boolean): PromiseOrValue<ExecutionResult | AsyncGenerator<AsyncExecutionResult, void, void>>;
|
|
4
|
+
export declare function execute(args: ExecutionArgs, resolvedPreset?: GraphileConfig.ResolvedPreset, outputDataAsString?: boolean): PromiseOrValue<ExecutionResult | AsyncGenerator<AsyncExecutionResult, void, undefined>>;
|
|
5
5
|
//# sourceMappingURL=execute.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ import { __InputListStep, __InputObjectStep, __InputStaticLeafStep, __ItemStep,
|
|
|
16
16
|
import { stringifyPayload } from "./stringifyPayload.js";
|
|
17
17
|
import { stripAnsi } from "./stripAnsi.js";
|
|
18
18
|
import { subscribe } from "./subscribe.js";
|
|
19
|
-
import { arrayOfLength, arraysMatch,
|
|
19
|
+
import { arrayOfLength, arraysMatch, getEnumValueConfig, GraphileInputFieldConfigMap, GraphileInputObjectType, GraphileObjectType, inputObjectFieldSpec, InputObjectTypeSpec, isPromiseLike, newGraphileFieldConfigBuilder, newInputObjectTypeBuilder, newObjectTypeBuilder, objectFieldSpec, objectSpec, ObjectTypeFields, ObjectTypeSpec, stepADependsOnStepB, stepAMayDependOnStepB, stepsAreInSamePhase } from "./utils.js";
|
|
20
20
|
export { isAsyncIterable } from "iterall";
|
|
21
|
-
export { __InputListStep, __InputObjectStep, __InputStaticLeafStep, __ItemStep, __ListTransformStep, __TrackedObjectStep, __ValueStep, $$bypassGraphQL, $$concreteType, $$data, $$eventEmitter, $$extensions, $$idempotent, $$verbatim, access, AccessStep, ActualKeyByDesiredKey, ArgumentApplyPlanResolver, ArgumentInputPlanResolver, arrayOfLength, arraysMatch, assertListCapableStep, BaseEventMap, BaseGraphQLArguments, BaseGraphQLContext, BaseGraphQLRootValue, BaseGraphQLVariables, BaseStep,
|
|
21
|
+
export { __InputListStep, __InputObjectStep, __InputStaticLeafStep, __ItemStep, __ListTransformStep, __TrackedObjectStep, __ValueStep, $$bypassGraphQL, $$concreteType, $$data, $$eventEmitter, $$extensions, $$idempotent, $$verbatim, access, AccessStep, ActualKeyByDesiredKey, ArgumentApplyPlanResolver, ArgumentInputPlanResolver, arrayOfLength, arraysMatch, assertListCapableStep, BaseEventMap, BaseGraphQLArguments, BaseGraphQLContext, BaseGraphQLRootValue, BaseGraphQLVariables, BaseStep, connection, ConnectionCapableStep, ConnectionStep, constant, ConstantStep, context, debugPlans, deepEval, DeepEvalStep, defer, Deferred, each, EdgeCapableStep, EdgeStep, EnumPlans, EnumValueApplyPlanResolver, error, ErrorStep, EventCallback, EventMapKey, ExecutableStep, execute, ExecutionEventEmitter, ExecutionEventMap, ExecutionExtra, exportAsMany, FieldArgs, FieldInfo, FieldPlanResolver, FieldPlans, filter, FilterPlanMemo, first, FirstStep, getEnumValueConfig, grafastGraphql as grafast, GrafastArgumentExtensions, GrafastEnumValueExtensions, GrafastError, GrafastFieldExtensions, grafastGraphql, grafastGraphqlSync, GrafastInputFieldExtensions, GrafastObjectTypeExtensions, GrafastPlans, grafastPrint, GrafastResultsList, GrafastResultStreamList, GrafastSubscriber, grafastGraphqlSync as grafastSync, GrafastValuesList, GraphileArgumentConfig, GraphileFieldConfig, GraphileFieldConfigArgumentMap, GraphileInputFieldConfig, GraphileInputFieldConfigMap, GraphileInputObjectType, GraphileObjectType, GraphQLItemHandler, graphqlItemHandler, GraphQLPolymorphicUnwrap, graphqlPolymorphicUnwrap, graphqlResolver, GraphQLResolverStep, groupBy, GroupByPlanMemo, InputObjectFieldApplyPlanResolver, InputObjectFieldInputPlanResolver, inputObjectFieldSpec, InputObjectPlans, InputObjectTypeInputPlanResolver, InputObjectTypeSpec, InputStep, InterfaceOrUnionPlans, isDev, isExecutableStep, isGrafastError, isListCapableStep, isModifierStep, isObjectLikeStep, isPromiseLike, isStreamableStep, lambda, LambdaStep, last, LastStep, list, ListCapableStep, listen, ListenStep, ListStep, listTransform, ListTransformItemPlanCallback, ListTransformOptions, ListTransformReduce, loadMany, LoadManyCallback, loadManyCallback, LoadManyOptions, LoadManySingleRecordStep, LoadManyStep, loadOne, LoadOneCallback, loadOneCallback, LoadOneOptions, LoadOneStep, makeGrafastSchema, makeMapper, map, MapStep, ModifierStep, newGraphileFieldConfigBuilder, newInputObjectTypeBuilder, newObjectTypeBuilder, node, NodeIdCodec, NodeIdHandler, NodeStep, noop, object, objectFieldSpec, ObjectLikeStep, ObjectPlanMeta, ObjectPlans, objectSpec, ObjectStep, ObjectTypeFields, ObjectTypeSpec, OperationPlan, operationPlan, OutputPlanForType, PageInfoCapableStep, partitionByIndex, PolymorphicData, PolymorphicStep, polymorphicWrap, PrintPlanGraphOptions, PromiseOrDirect, proxy, ProxyStep, resolveType, reverse, reverseArray, ReverseStep, ScalarPlanResolver, ScalarPlans, setter, SetterCapableStep, SetterStep, specFromNodeId, stepADependsOnStepB, stepAMayDependOnStepB, StepOptimizeOptions, stepsAreInSamePhase, StepStreamOptions, StreamableStep, stringifyPayload, stripAnsi, subscribe, TypedEventEmitter, UnbatchedExecutableStep, };
|
|
22
22
|
export { hookArgs } from "./args.js";
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|