grafast 0.0.1-alpha.2 → 0.0.1-alpha.4

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 CHANGED
@@ -254,7 +254,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
254
254
 
255
255
 
256
256
  --------------------------------------------------------------------------------
257
- tamedevil v0.0.0-alpha.1 - Benjie Gillam <benjie@jemjie.com>
257
+ tamedevil v0.0.0-alpha.2 - Benjie Gillam <benjie@jemjie.com>
258
258
  git+https://github.com/graphile/heart.git
259
259
  --------------------------------------------------------------------------------
260
260
 
package/dist/bucket.d.ts CHANGED
@@ -2,6 +2,8 @@ import type { LayerPlan } from "./engine/LayerPlan";
2
2
  import type { MetaByMetaKey } from "./engine/OperationPlan";
3
3
  import type { ExecutionEventEmitter } from "./interfaces.js";
4
4
  export interface RequestTools {
5
+ startTime: number;
6
+ stopTime: number | null;
5
7
  readonly eventEmitter: ExecutionEventEmitter | undefined;
6
8
  metaByMetaKey: MetaByMetaKey;
7
9
  insideGraphQL: false;
@@ -9,7 +11,7 @@ export interface RequestTools {
9
11
  export interface Bucket {
10
12
  layerPlan: LayerPlan;
11
13
  size: number;
12
- polymorphicPathList: readonly string[];
14
+ polymorphicPathList: readonly (string | null)[];
13
15
  store: Map<number, any[]>;
14
16
  isComplete: boolean;
15
17
  hasErrors: boolean;
@@ -1,4 +1,3 @@
1
- import type { TE } from "tamedevil";
2
1
  import type { Bucket } from "../bucket.js";
3
2
  import type { ExecutableStep, ModifierStep, UnbatchedExecutableStep } from "../step";
4
3
  import type { OperationPlan } from "./OperationPlan";
@@ -32,6 +31,7 @@ export interface LayerPlanReasonPolymorphic {
32
31
  type: "polymorphic";
33
32
  typeNames: string[];
34
33
  parentStep: ExecutableStep;
34
+ polymorphicPaths: Set<string>;
35
35
  }
36
36
  export interface LayerPlanReasonSubroutine {
37
37
  type: "subroutine";
@@ -46,20 +46,20 @@ export type HasParent<A extends LayerPlanReason> = A extends any ? A extends {
46
46
  } ? A : never : never;
47
47
  export type LayerPlanReasonsWithParentStep = HasParent<LayerPlanReason>;
48
48
  export interface LayerPlanPhase {
49
- normalSteps?: Array<{
49
+ checkTimeout: boolean;
50
+ normalSteps: Array<{
50
51
  step: ExecutableStep;
51
- }>;
52
- unbatchedSyncAndSafeSteps?: Array<{
52
+ }> | undefined;
53
+ unbatchedSyncAndSafeSteps: Array<{
53
54
  step: UnbatchedExecutableStep;
54
55
  scratchpad: any;
55
- }>;
56
+ }> | undefined;
56
57
  _allSteps: ExecutableStep[];
57
58
  }
58
59
  export declare class LayerPlan<TReason extends LayerPlanReason = LayerPlanReason> {
59
60
  readonly operationPlan: OperationPlan;
60
61
  parentLayerPlan: LayerPlan | null;
61
62
  readonly reason: TReason;
62
- polymorphicPaths: ReadonlySet<string>;
63
63
  id: number;
64
64
  readonly rootStep: ExecutableStep | null;
65
65
  copyStepIds: number[];
@@ -68,14 +68,16 @@ export declare class LayerPlan<TReason extends LayerPlanReason = LayerPlanReason
68
68
  pendingSteps: ExecutableStep[];
69
69
  phases: Array<LayerPlanPhase>;
70
70
  ancestry: LayerPlan[];
71
- constructor(operationPlan: OperationPlan, parentLayerPlan: LayerPlan | null, reason: TReason, polymorphicPaths: ReadonlySet<string>);
71
+ depth: number;
72
+ deferBoundaryDepth: number;
73
+ stepsByConstructor: Map<Function, Set<ExecutableStep>>;
74
+ constructor(operationPlan: OperationPlan, parentLayerPlan: LayerPlan | null, reason: TReason);
72
75
  toString(): string;
73
76
  print(depth?: number): string;
74
77
  setRootStep($root: ExecutableStep): void;
75
78
  getStep(id: number, requestingStep: ExecutableStep): ExecutableStep;
76
79
  _addStep(step: ExecutableStep): number;
77
80
  _addModifierStep(step: ModifierStep<any>): string;
78
- makeNewBucketCallback(this: LayerPlan<TReason>, inner: TE): typeof this.newBucket;
79
81
  finalize(): void;
80
82
  newBucket(parentBucket: Bucket): Bucket | null;
81
83
  }
@@ -1,13 +1,16 @@
1
- import type { FragmentDefinitionNode, GraphQLObjectType, GraphQLSchema, GraphQLUnionType, OperationDefinitionNode } from "graphql";
1
+ import type { FragmentDefinitionNode, GraphQLFieldMap, GraphQLObjectType, GraphQLSchema, GraphQLUnionType, OperationDefinitionNode } from "graphql";
2
2
  import type { Constraint } from "../constraints.js";
3
+ import type { SelectionSetDigest } from "../graphqlCollectFields.js";
3
4
  import type { ModifierStep } from "../index.js";
4
5
  import { __TrackedValueStep, __ValueStep, ExecutableStep } from "../index.js";
6
+ import { $$timeout, $$ts } from "../interfaces.js";
5
7
  import type { PrintPlanGraphOptions } from "../mermaid.js";
6
8
  import type { LayerPlanReasonSubroutine } from "./LayerPlan.js";
7
9
  import { LayerPlan } from "./LayerPlan.js";
8
10
  import { OutputPlan } from "./OutputPlan.js";
9
11
  import { StepTracker } from "./StepTracker.js";
10
- export declare const POLYMORPHIC_ROOT_PATH = "";
12
+ export declare const POLYMORPHIC_ROOT_PATH: null;
13
+ export declare const POLYMORPHIC_ROOT_PATHS: ReadonlySet<string> | null;
11
14
  export type OperationPlanPhase = "init" | "plan" | "validate" | "optimize" | "finalize" | "ready";
12
15
  export interface MetaByMetaKey {
13
16
  [metaKey: string | number | symbol]: Record<string, any>;
@@ -25,6 +28,9 @@ export declare class OperationPlan {
25
28
  [key: string]: any;
26
29
  };
27
30
  readonly rootValue: any;
31
+ private readonly planningTimeout;
32
+ readonly [$$timeout]: undefined;
33
+ readonly [$$ts]: undefined;
28
34
  readonly queryType: GraphQLObjectType;
29
35
  readonly mutationType: GraphQLObjectType | null;
30
36
  readonly subscriptionType: GraphQLObjectType | null;
@@ -62,13 +68,20 @@ export declare class OperationPlan {
62
68
  [listStepId: number]: number | undefined;
63
69
  };
64
70
  pure: boolean;
71
+ private startTime;
72
+ private previousLap;
73
+ private laps;
74
+ private optimizeMeta;
75
+ private scalarPlanInfo;
65
76
  constructor(schema: GraphQLSchema, operation: OperationDefinitionNode, fragments: {
66
77
  [fragmentName: string]: FragmentDefinitionNode;
67
78
  }, variableValues: {
68
79
  [key: string]: any;
69
80
  }, context: {
70
81
  [key: string]: any;
71
- }, rootValue: any);
82
+ }, rootValue: any, planningTimeout: number | null);
83
+ private lap;
84
+ private checkTimeout;
72
85
  addLayerPlan(layerPlan: LayerPlan): number;
73
86
  _addStep(plan: ExecutableStep): number;
74
87
  _addModifierStep(step: ModifierStep<any>): string;
@@ -79,6 +92,7 @@ export declare class OperationPlan {
79
92
  private planMutation;
80
93
  private planSubscription;
81
94
  private itemStepForListStep;
95
+ processGroupedFieldSet(outputPlan: OutputPlan, path: readonly string[], polymorphicPath: string | null, polymorphicPaths: ReadonlySet<string> | null, parentStep: ExecutableStep, objectType: GraphQLObjectType, objectTypeFields: GraphQLFieldMap<any, any>, isMutation: boolean, groupedFieldSet: SelectionSetDigest): void;
82
96
  private planSelectionSet;
83
97
  private planIntoOutputPlan;
84
98
  private polymorphicLayerPlanByPathByLayerPlan;
@@ -89,14 +103,17 @@ export declare class OperationPlan {
89
103
  private track;
90
104
  private validateSteps;
91
105
  private replaceStep;
92
- processSteps(actionDescription: string, fromStepId: number, order: "dependents-first" | "dependencies-first", callback: (plan: ExecutableStep) => ExecutableStep): void;
106
+ private processStep;
107
+ processSteps(actionDescription: string, order: "dependents-first" | "dependencies-first", callback: (plan: ExecutableStep) => ExecutableStep): void;
93
108
  private getPeers;
94
109
  private isImmoveable;
95
110
  private hoistStep;
96
111
  private pushDown;
97
112
  private _deduplicateInnerLogic;
98
113
  private deduplicateStep;
114
+ private deduplicateStepsProcess;
99
115
  private deduplicateSteps;
116
+ private hoistAndDeduplicate;
100
117
  private hoistSteps;
101
118
  private pushDownSteps;
102
119
  private getStepOptionsForStep;
@@ -1,6 +1,6 @@
1
- import type LRU from "@graphile/lru";
1
+ import LRU from "@graphile/lru";
2
2
  import type { FieldNode, GraphQLEnumType, GraphQLObjectType, GraphQLScalarType } from "graphql";
3
- import { GraphQLError } from "graphql";
3
+ import * as graphql from "graphql";
4
4
  import type { Bucket } from "../bucket.js";
5
5
  import type { JSONValue, LocationDetails } from "../interfaces.js";
6
6
  import type { ExecutableStep } from "../step.js";
@@ -31,7 +31,6 @@ export type OutputPlanTypeArray = {
31
31
  };
32
32
  export type OutputPlanTypeLeaf = {
33
33
  mode: "leaf";
34
- serialize: GraphQLScalarType["serialize"];
35
34
  graphqlType: GraphQLScalarType | GraphQLEnumType;
36
35
  };
37
36
  export type OutputPlanTypeNull = {
@@ -65,7 +64,7 @@ export declare class OutputPlan<TType extends OutputPlanType = OutputPlanType> {
65
64
  childIsNonNull: boolean;
66
65
  childByTypeName: {
67
66
  [typeName: string]: OutputPlan<OutputPlanTypeObject>;
68
- };
67
+ } | undefined;
69
68
  deferredOutputPlans: OutputPlan<OutputPlanTypeObject | OutputPlanTypePolymorphicObject>[];
70
69
  constructor(layerPlan: LayerPlan, rootStep: ExecutableStep, type: TType, locationDetails: LocationDetails);
71
70
  print(): string;
@@ -78,7 +77,7 @@ export declare class OutputPlan<TType extends OutputPlanType = OutputPlanType> {
78
77
  optimize(): void;
79
78
  finalize(): void;
80
79
  }
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;
80
+ export declare function coerceError(error: Error, locationDetails: LocationDetails, path: ReadonlyArray<string | number>): graphql.GraphQLError;
81
+ export declare function nonNullError(locationDetails: LocationDetails, path: readonly (string | number)[]): graphql.GraphQLError;
83
82
  export declare function getChildBucketAndIndex(childOutputPlan: OutputPlan, outputPlan: OutputPlan | null, bucket: Bucket, bucketIndex: number, arrayIndex?: number | null): [Bucket, number] | null;
84
83
  //# sourceMappingURL=OutputPlan.d.ts.map
@@ -16,8 +16,10 @@ export declare class StepTracker {
16
16
  layerPlansByParentStep: Map<ExecutableStep<any>, Set<LayerPlan<LayerPlanReasonsWithParentStep>>>;
17
17
  layerPlans: Array<LayerPlan | null>;
18
18
  allOutputPlans: OutputPlan[];
19
+ nextStepIdToDeduplicate: number;
19
20
  constructor(operationPlan: OperationPlan);
20
- private assertPhaseNot;
21
+ newStepsSince(oldStepCount: number): ExecutableStep<any>[];
22
+ finalize(): void;
21
23
  addStep($step: ExecutableStep): number;
22
24
  addLayerPlan(layerPlan: LayerPlan): number;
23
25
  addOutputPlan(outputPlan: OutputPlan): void;
@@ -31,5 +33,8 @@ export declare class StepTracker {
31
33
  treeShakeSteps(): void;
32
34
  private isNotNeeded;
33
35
  private eradicate;
36
+ moveStepToLayerPlan(step: ExecutableStep, targetLayerPlan: LayerPlan): void;
37
+ addStepToItsLayerPlan(step: ExecutableStep): void;
38
+ removeStepFromItsLayerPlan(step: ExecutableStep): void;
34
39
  }
35
40
  //# sourceMappingURL=StepTracker.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import type { LayerPlan } from "../LayerPlan";
2
- export declare function withGlobalLayerPlan<T>(layerPlan: LayerPlan, polymorphicPaths: ReadonlySet<string>, callback: () => T): T;
2
+ export declare function withGlobalLayerPlan<T, TThis = any, TArgs extends [...args: any[]] = [...args: any[]]>(layerPlan: LayerPlan, polymorphicPaths: ReadonlySet<string> | null, callback: (this: TThis, ...args: TArgs) => T, callbackThis?: TThis, ...callbackArgs: TArgs): T;
3
3
  export declare function currentLayerPlan(): LayerPlan;
4
- export declare function currentPolymorphicPaths(): ReadonlySet<string>;
4
+ export declare function currentPolymorphicPaths(): ReadonlySet<string> | null;
5
5
  //# sourceMappingURL=withGlobalLayerPlan.d.ts.map
package/dist/envelop.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const { Buffer } = require('node:buffer');
2
2
  const { scryptSync, createDecipheriv } = require('node:crypto');
3
3
  const pkgName = "grafast";
4
- const pkgVersion = "0.0.1-alpha.2";
4
+ const pkgVersion = "0.0.1-alpha.4";
5
5
 
6
6
  const RESET = '\x1b[0m';
7
7
  const BOLD_BLACK_ON_RED = '\x1b[40;31;1;7m';
@@ -28,12 +28,12 @@ if (typeof password !== 'string') {
28
28
  }
29
29
 
30
30
  const algorithm = "aes-192-cbc";
31
- const salt = "We wouldn't be able to do so much OSS without sponsorship. 7777665428802603";
31
+ const salt = "We wouldn't be able to do so much OSS without sponsorship. 3693991404349659";
32
32
  const key = scryptSync(password, salt, 24);
33
- const ivBuffer = Buffer.from("UTn5rHSHDtO9iB0dJzh0lg==", "base64");
33
+ const ivBuffer = Buffer.from("1ehzGuFDK/vxkJkkAXteEw==", "base64");
34
34
  const iv = new Uint8Array(ivBuffer.buffer, ivBuffer.byteOffset, ivBuffer.length);
35
35
  const decipher = createDecipheriv(algorithm, key, iv);
36
- const encrypted = "2aRm3sP4vCPzOgKOIAIiv/QLKkxi+7fXZBgq+4rqywsEW/T2dguZ7GEe52aNHdn8CXTSgub7CFoyiE8gOJCGymB2sZFL+5ojjITP4K7BeVee5klB41WsaAp5qgv/2JMBOOOv27Z9FFQK4Whc44e+zkSvwqDsISGTVBVoECZrOWD7ruD5No/G96W04wCk5GaiN6rAuhZOqN+q0tir7DCvH0qx9CCHtKleydOJLk5HyF/2sxjFy/teQkXyyTBaLZ5PfbuGOtWPepycK9ItXlndqB9d+ZZAeep39rVd7d/DNJEet69KZtAZtj7eHC3sW3BnPK98XG+Z0h4O92j++0AoHxDMALyTMwddR1jpRtP8Ms154qkke4SS4HEvKk3MwcUSZUORvjOryMZEz5pt5Otepz7Ht2espl5DmEDkIQTAreuHFBD3aAlq6VmtENYzwTj2v4T9oVtZ2v7pp1Jvfqo2JCE8O9Wu8sK95xF8ANJjoitpVtlNd0QnZfKPOoalyz2v3LdIxVUVzflRd3H0/3iEi1+uEkRTLeSPKWJtVx3abjwkKpoKfZPOA+E+cGXE/KJ1k0SzJuOtd9rdsW1JTsHI8mohRiqeSsRxdFTCgf5YnOelD/n0VWj/Vua1KpivuWXGqO6lh0Ym41W1De2aztzktGBQ9iNtrVUG0d52zTTuVtB4oJBnz6bjCNx91WcSKbS/7WGcE16NOr4zgpyyGJFZE2v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JQMv8KA8ze6QeVMvFFA1QmXWkiQpqIz/JBmTZzgaf7l0J+HuzuHuSKrOFD1TbO7ou3pQjgDBrXjLiAT64wTJESsceYiCkM/cisD1Auxle8zpyysuGLegT2m8v/Z3i1f6ZYjW2VU95y5gMlXZWE7E/6eHX6NDNvklwiDERtfrkHcLLnBSIb5ELs1F2mBCxPbXJo7TaIudL8lJxe4xVrlOnwxQLcckGPI89WlolWQq4Nn3pYWZXcBDCapRnb2eoXWOkvbvrnD95NT1VBnsmGzuwIyWMOXAsns0OogRYTR6r3YrwOfM67eOmRAyUKO2qsEHeEHwcgFLCiqrDeGBLi9nmsDen3OiYfc3WKo1o/TjT2Wm6rE8/QMV4VAalITE3kFfo8aAvi2NHugT3EazwQNGKW+/qQIN2QwsKT1tCfvnX/T4xjMBDcYig9YowOnAQGe8R9WCwj/qEfnOX4ekPBlkQ1yA6kb1x52fX2lhhnNl8NkijEDxRUAZSBZe0Z6zG6lKQAg3TiCCbG9++0kBLEaGd0xsngJ1hP12oBtUj0CjbsTNb1/Il9JX4+DWULIa5Iim3efrKYd1o+SE5NVUnyo2sA+79EGR5CkMIWabQGr7mjggyHXGStIytY6K0kqdBacujO+954wN7miE4W2N6EXP76tFEIFeD6sh3rxyGxyM+45yj3mq93imKpKz3zTQwAMghUGqnPpZGih1hkUoIwQ2rFxI2iKaJHB7LYmu9st1uSxQwyu5B9e5GaY+o3KEs2F5eNTDrhubIixu9sA2hGPeJQU4/Ehn8JteVsLxOu6G0fPHveczpAxkMuYc="
37
37
  let decrypted;
38
38
  try {
39
39
  decrypted = decipher.update(encrypted, 'base64', 'utf8') + decipher.final('utf8');
package/dist/error.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import type { $$extensions } from "./interfaces.js";
2
3
  import { $$safeError } from "./interfaces.js";
3
4
  export interface GrafastError extends Error {
@@ -5,18 +6,34 @@ export interface GrafastError extends Error {
5
6
  [$$extensions]?: Record<string, any>;
6
7
  }
7
8
  export declare const $$error: unique symbol;
8
- export declare class _GrafastError extends Error implements GrafastError {
9
+ export declare const _GrafastError: {
10
+ new (originalError: Error, planId: number | null): {
11
+ readonly originalError: Error;
12
+ extensions: Record<string, any>;
13
+ [$$error]: boolean;
14
+ name: string;
15
+ message: string;
16
+ stack?: string | undefined;
17
+ cause?: unknown;
18
+ };
19
+ captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
20
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
21
+ stackTraceLimit: number;
22
+ };
23
+ export declare function newGrafastError(error: Error, planId: number | null): {
9
24
  readonly originalError: Error;
10
25
  extensions: Record<string, any>;
11
26
  [$$error]: boolean;
12
- constructor(originalError: Error, planId: number | null);
13
- }
14
- export declare function newGrafastError(error: Error, planId: number | null): _GrafastError;
27
+ name: string;
28
+ message: string;
29
+ stack?: string | undefined;
30
+ cause?: unknown;
31
+ };
15
32
  export declare function isGrafastError(value: any): value is GrafastError;
16
- export declare class SafeError extends Error {
17
- extensions?: Record<string, any> | undefined;
33
+ export declare class SafeError<TExtensions extends Record<string, any> | undefined = Record<string, any> | undefined> extends Error {
34
+ extensions: TExtensions;
18
35
  [$$safeError]: boolean;
19
- constructor(message: string, extensions?: Record<string, any> | undefined, errorOptions?: ErrorOptions);
36
+ constructor(message: string, extensions?: TExtensions, errorOptions?: ErrorOptions);
20
37
  }
21
38
  export declare function isSafeError(error: Error): error is SafeError;
22
39
  //# sourceMappingURL=error.d.ts.map
@@ -1,16 +1,24 @@
1
1
  import LRU from "@graphile/lru";
2
2
  import type { FragmentDefinitionNode, GraphQLSchema, OperationDefinitionNode } from "graphql";
3
- import { OperationPlan } from "./index.js";
3
+ import { OperationPlan, SafeError } from "./index.js";
4
4
  import type { BaseGraphQLRootValue, BaseGraphQLVariables } from "./interfaces.js";
5
+ import { $$timeout, $$ts } from "./interfaces.js";
5
6
  type Fragments = {
6
7
  [key: string]: FragmentDefinitionNode;
7
8
  };
9
+ type OperationPlanOrError = OperationPlan | Error | SafeError<{
10
+ [$$timeout]: number;
11
+ [$$ts]: number;
12
+ } | {
13
+ [$$timeout]?: undefined;
14
+ [$$ts]?: undefined;
15
+ } | undefined>;
8
16
  interface LinkedList<T> {
9
17
  value: T;
10
18
  next: LinkedList<T> | null;
11
19
  }
12
20
  interface Cache {
13
- possibleOperationPlans: LinkedList<OperationPlan>;
21
+ possibleOperationPlans: LinkedList<OperationPlanOrError> | null;
14
22
  fragments: Fragments;
15
23
  }
16
24
  type CacheByOperation = LRU<OperationDefinitionNode, Cache>;
@@ -20,6 +28,6 @@ declare module "graphql" {
20
28
  [$$cacheByOperation]?: CacheByOperation;
21
29
  }
22
30
  }
23
- export declare function establishOperationPlan<TVariables extends BaseGraphQLVariables = BaseGraphQLVariables, TContext extends Grafast.Context = Grafast.Context, TRootValue extends BaseGraphQLRootValue = BaseGraphQLRootValue>(schema: GraphQLSchema, operation: OperationDefinitionNode, fragments: Fragments, variableValues: TVariables, context: TContext, rootValue: TRootValue): OperationPlan;
31
+ export declare function establishOperationPlan<TVariables extends BaseGraphQLVariables = BaseGraphQLVariables, TContext extends Grafast.Context = Grafast.Context, TRootValue extends BaseGraphQLRootValue = BaseGraphQLRootValue>(schema: GraphQLSchema, operation: OperationDefinitionNode, fragments: Fragments, variableValues: TVariables, context: TContext, rootValue: TRootValue, planningTimeout?: number | null): OperationPlan;
24
32
  export {};
25
33
  //# sourceMappingURL=establishOperationPlan.d.ts.map
@@ -1,12 +1,15 @@
1
- import type { FieldNode, SelectionNode } from "graphql";
2
- import { GraphQLObjectType } from "graphql";
1
+ import type { DirectiveNode, FieldNode, SelectionNode } from "graphql";
2
+ import * as graphql from "graphql";
3
3
  import type { OperationPlan } from "./engine/OperationPlan.js";
4
4
  import type { __TrackedValueStep } from "./steps/index.js";
5
- export declare function evalDirectiveArg<T = unknown>(selection: SelectionNode, directiveName: string, argumentName: string, variableValuesStep: __TrackedValueStep): T | undefined;
5
+ export declare function evalDirectiveArg<T = unknown>(selection: SelectionNode, directiveName: string, argumentName: string, variableValuesStep: __TrackedValueStep, defaultValue: T): T | undefined;
6
+ export declare function evalDirectiveArgDirect<T = unknown>(directive: DirectiveNode, argumentName: string, variableValuesStep: __TrackedValueStep, defaultValue: T): T | undefined;
6
7
  export interface SelectionSetDigest {
7
8
  label: string | undefined;
8
9
  fields: Map<string, FieldNode[]>;
9
- deferred: SelectionSetDigest[];
10
+ deferred: SelectionSetDigest[] | undefined;
10
11
  }
11
- export declare function graphqlCollectFields(operationPlan: OperationPlan, parentStepId: number, objectType: GraphQLObjectType, selections: readonly SelectionNode[], isMutation?: boolean, visitedFragments?: Set<string>, selectionSetDigest?: SelectionSetDigest): SelectionSetDigest;
12
+ export declare function graphqlCollectFields(operationPlan: OperationPlan, parentStepId: number, objectType: graphql.GraphQLObjectType, selections: readonly SelectionNode[], isMutation?: boolean, visitedFragments?: {
13
+ [fragmentName: string]: true;
14
+ }, selectionSetDigest?: SelectionSetDigest): SelectionSetDigest;
12
15
  //# sourceMappingURL=graphqlCollectFields.d.ts.map