grafast 1.0.0-rc.4 → 1.0.0-rc.6

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.
Files changed (152) hide show
  1. package/dist/args.d.ts +1 -1
  2. package/dist/args.js +7 -7
  3. package/dist/engine/LayerPlan.d.ts +6 -6
  4. package/dist/engine/LayerPlan.js +44 -44
  5. package/dist/engine/OperationPlan.d.ts +28 -31
  6. package/dist/engine/OperationPlan.js +239 -242
  7. package/dist/engine/OperationPlanTypes.d.ts +10 -5
  8. package/dist/engine/OutputPlan.d.ts +8 -8
  9. package/dist/engine/OutputPlan.js +30 -30
  10. package/dist/engine/StepTracker.js +36 -36
  11. package/dist/engine/distributor.d.ts +4 -3
  12. package/dist/engine/distributor.js +17 -16
  13. package/dist/engine/executeBucket.d.ts +2 -2
  14. package/dist/engine/executeBucket.js +101 -101
  15. package/dist/engine/executeOutputPlan.d.ts +2 -2
  16. package/dist/engine/executeOutputPlan.js +2 -2
  17. package/dist/engine/lib/defaultPlanResolver.d.ts +1 -1
  18. package/dist/engine/lib/defaultPlanResolver.js +2 -2
  19. package/dist/engine/lib/withGlobalLayerPlan.d.ts +3 -3
  20. package/dist/engine/lib/withGlobalLayerPlan.js +12 -12
  21. package/dist/engine/lock.d.ts +1 -1
  22. package/dist/envelop.js +7 -7
  23. package/dist/error.d.ts +3 -3
  24. package/dist/error.js +14 -14
  25. package/dist/establishOperationPlan.d.ts +3 -3
  26. package/dist/establishOperationPlan.js +16 -16
  27. package/dist/execute.d.ts +2 -2
  28. package/dist/execute.js +15 -16
  29. package/dist/exportAs.js +2 -2
  30. package/dist/global.d.ts +2 -2
  31. package/dist/global.js +2 -2
  32. package/dist/grafastGraphql.d.ts +2 -2
  33. package/dist/grafastGraphql.js +16 -16
  34. package/dist/grafastPrint.d.ts +1 -1
  35. package/dist/grafastPrint.js +31 -31
  36. package/dist/graphqlCollectFields.d.ts +1 -1
  37. package/dist/graphqlCollectFields.js +2 -2
  38. package/dist/graphqlMergeSelectionSets.d.ts +1 -1
  39. package/dist/graphqlMergeSelectionSets.js +2 -2
  40. package/dist/index.d.ts +40 -35
  41. package/dist/index.js +322 -322
  42. package/dist/input.d.ts +2 -2
  43. package/dist/input.js +23 -23
  44. package/dist/interfaces.d.ts +13 -13
  45. package/dist/makeGrafastSchema.d.ts +2 -2
  46. package/dist/makeGrafastSchema.js +33 -33
  47. package/dist/mermaid.d.ts +2 -2
  48. package/dist/mermaid.js +4 -6
  49. package/dist/multistep.d.ts +2 -2
  50. package/dist/multistep.js +13 -13
  51. package/dist/operationPlan-input.d.ts +3 -3
  52. package/dist/operationPlan-input.js +13 -13
  53. package/dist/planJSONInterfaces.d.ts +1 -1
  54. package/dist/prepare.d.ts +1 -1
  55. package/dist/prepare.js +75 -75
  56. package/dist/step.d.ts +6 -6
  57. package/dist/step.js +29 -29
  58. package/dist/steps/__cloneStream.d.ts +4 -4
  59. package/dist/steps/__cloneStream.js +4 -4
  60. package/dist/steps/__flag.d.ts +4 -4
  61. package/dist/steps/__flag.js +39 -39
  62. package/dist/steps/__inputDefault.d.ts +4 -4
  63. package/dist/steps/__inputDefault.js +3 -3
  64. package/dist/steps/__inputDynamicScalar.d.ts +3 -3
  65. package/dist/steps/__inputDynamicScalar.js +8 -8
  66. package/dist/steps/__inputList.d.ts +3 -3
  67. package/dist/steps/__inputList.js +12 -12
  68. package/dist/steps/__inputObject.d.ts +5 -5
  69. package/dist/steps/__inputObject.js +10 -10
  70. package/dist/steps/__inputStaticLeaf.d.ts +3 -3
  71. package/dist/steps/__inputStaticLeaf.js +7 -7
  72. package/dist/steps/__item.d.ts +5 -5
  73. package/dist/steps/__item.js +5 -5
  74. package/dist/steps/__trackedValue.d.ts +6 -6
  75. package/dist/steps/__trackedValue.js +5 -5
  76. package/dist/steps/__value.d.ts +3 -3
  77. package/dist/steps/__value.js +6 -6
  78. package/dist/steps/_loadCommon.d.ts +3 -3
  79. package/dist/steps/_loadCommon.js +12 -12
  80. package/dist/steps/access.d.ts +6 -6
  81. package/dist/steps/access.js +7 -7
  82. package/dist/steps/applyInput.d.ts +8 -7
  83. package/dist/steps/applyInput.js +45 -31
  84. package/dist/steps/applyTransforms.d.ts +1 -1
  85. package/dist/steps/applyTransforms.js +24 -24
  86. package/dist/steps/bakedInput.d.ts +4 -4
  87. package/dist/steps/bakedInput.js +19 -17
  88. package/dist/steps/coalesce.d.ts +3 -3
  89. package/dist/steps/coalesce.js +4 -4
  90. package/dist/steps/condition.d.ts +4 -4
  91. package/dist/steps/condition.js +3 -3
  92. package/dist/steps/connection.d.ts +9 -9
  93. package/dist/steps/connection.js +41 -41
  94. package/dist/steps/constant.d.ts +4 -4
  95. package/dist/steps/constant.js +11 -11
  96. package/dist/steps/each.d.ts +4 -4
  97. package/dist/steps/each.js +7 -7
  98. package/dist/steps/error.d.ts +2 -2
  99. package/dist/steps/error.js +8 -8
  100. package/dist/steps/filter.d.ts +4 -4
  101. package/dist/steps/filter.js +4 -4
  102. package/dist/steps/first.d.ts +4 -4
  103. package/dist/steps/first.js +8 -8
  104. package/dist/steps/get.d.ts +1 -1
  105. package/dist/steps/get.js +2 -2
  106. package/dist/steps/graphqlResolver.d.ts +2 -2
  107. package/dist/steps/graphqlResolver.js +12 -12
  108. package/dist/steps/groupBy.d.ts +3 -3
  109. package/dist/steps/groupBy.js +6 -6
  110. package/dist/steps/index.d.ts +49 -38
  111. package/dist/steps/index.js +120 -120
  112. package/dist/steps/lambda.d.ts +5 -5
  113. package/dist/steps/lambda.js +7 -7
  114. package/dist/steps/last.d.ts +4 -4
  115. package/dist/steps/last.js +8 -8
  116. package/dist/steps/list.d.ts +6 -6
  117. package/dist/steps/list.js +6 -6
  118. package/dist/steps/listTransform.d.ts +7 -7
  119. package/dist/steps/listTransform.js +21 -21
  120. package/dist/steps/listen.d.ts +4 -4
  121. package/dist/steps/listen.js +10 -10
  122. package/dist/steps/loadMany.d.ts +7 -7
  123. package/dist/steps/loadMany.js +22 -22
  124. package/dist/steps/loadOne.d.ts +5 -5
  125. package/dist/steps/loadOne.js +17 -17
  126. package/dist/steps/loadedRecord.d.ts +8 -8
  127. package/dist/steps/loadedRecord.js +15 -15
  128. package/dist/steps/node.d.ts +4 -4
  129. package/dist/steps/node.js +5 -5
  130. package/dist/steps/object.d.ts +6 -6
  131. package/dist/steps/object.js +14 -14
  132. package/dist/steps/partitionByIndex.d.ts +3 -3
  133. package/dist/steps/partitionByIndex.js +6 -6
  134. package/dist/steps/proxy.d.ts +3 -3
  135. package/dist/steps/proxy.js +7 -7
  136. package/dist/steps/remapKeys.d.ts +4 -4
  137. package/dist/steps/remapKeys.js +5 -5
  138. package/dist/steps/reverse.d.ts +3 -3
  139. package/dist/steps/reverse.js +2 -2
  140. package/dist/steps/setter.d.ts +2 -2
  141. package/dist/steps/setter.js +2 -2
  142. package/dist/steps/sideEffect.d.ts +5 -5
  143. package/dist/steps/sideEffect.js +5 -5
  144. package/dist/stringifyPayload.d.ts +1 -1
  145. package/dist/subscribe.d.ts +2 -2
  146. package/dist/subscribe.js +5 -5
  147. package/dist/unbatchedStepExecute.js +7 -7
  148. package/dist/utils.d.ts +4 -4
  149. package/dist/utils.js +13 -13
  150. package/dist/version.d.ts +1 -1
  151. package/dist/version.js +1 -1
  152. package/package.json +3 -3
package/dist/args.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ExecutionArgs } from "graphql";
2
- import type { GrafastExecutionArgs, PromiseOrDirect } from "./interfaces.js";
2
+ import type { GrafastExecutionArgs, PromiseOrDirect } from "./interfaces.ts";
3
3
  /** @deprecated Pass `resolvedPreset` and `requestContext` via args directly */
4
4
  export declare function hookArgs(rawArgs: ExecutionArgs, resolvedPreset: GraphileConfig.ResolvedPreset, ctx: Partial<Grafast.RequestContext>): PromiseOrDirect<Grafast.ExecutionArgs>;
5
5
  export declare function hookArgs(rawArgs: GrafastExecutionArgs): PromiseOrDirect<Grafast.ExecutionArgs>;
package/dist/args.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hookArgs = hookArgs;
4
- const constants_js_1 = require("./constants.js");
5
- const middleware_js_1 = require("./middleware.js");
6
- const utils_js_1 = require("./utils.js");
4
+ const constants_ts_1 = require("./constants.js");
5
+ const middleware_ts_1 = require("./middleware.js");
6
+ const utils_ts_1 = require("./utils.js");
7
7
  const EMPTY_OBJECT = Object.freeze(Object.create(null));
8
8
  const $$writeTest = Symbol("grafastWriteTest");
9
9
  /**
@@ -28,17 +28,17 @@ function hookArgs(rawArgs, legacyResolvedPreset, legacyCtx) {
28
28
  rawArgs.contextValue = Object.assign(Object.create(null), rawContextValue);
29
29
  }
30
30
  const middleware = rawMiddleware === undefined && resolvedPreset != null
31
- ? (0, middleware_js_1.getGrafastMiddleware)(resolvedPreset)
31
+ ? (0, middleware_ts_1.getGrafastMiddleware)(resolvedPreset)
32
32
  : (rawMiddleware ?? null);
33
33
  if (rawMiddleware === undefined) {
34
34
  rawArgs.middleware = middleware;
35
35
  }
36
36
  const args = rawArgs;
37
37
  // Assert that args haven't already been hooked
38
- if (args[constants_js_1.$$hooked]) {
38
+ if (args[constants_ts_1.$$hooked]) {
39
39
  throw new Error("Must not call hookArgs twice!");
40
40
  }
41
- args[constants_js_1.$$hooked] = true;
41
+ args[constants_ts_1.$$hooked] = true;
42
42
  if (middleware != null) {
43
43
  return middleware.run("prepareArgs", { args }, finalizeWithEvent);
44
44
  }
@@ -51,7 +51,7 @@ function finalize(args) {
51
51
  const contextValue = args.contextValue;
52
52
  if (typeof userContext === "function") {
53
53
  const result = userContext(args.requestContext ?? EMPTY_OBJECT, args);
54
- if ((0, utils_js_1.isPromiseLike)(result)) {
54
+ if ((0, utils_ts_1.isPromiseLike)(result)) {
55
55
  // Deliberately shadowed 'result'
56
56
  return result.then((result) => {
57
57
  Object.assign(contextValue, result);
@@ -1,7 +1,7 @@
1
- import type { Bucket } from "../bucket.js";
2
- import type { Step } from "../step";
3
- import type { __ValueStep } from "../steps/index.js";
4
- import type { OperationPlan } from "./OperationPlan";
1
+ import type { Bucket } from "../bucket.ts";
2
+ import type { Step } from "../step.ts";
3
+ import type { __ValueStep } from "../steps/index.ts";
4
+ import type { OperationPlan } from "./OperationPlan.ts";
5
5
  /** Non-branching, non-deferred */
6
6
  export interface LayerPlanReasonRoot {
7
7
  type: "root";
@@ -150,8 +150,6 @@ export type LayerPlanReasonsWithParentStep = HasParent<LayerPlanReason>;
150
150
  *
151
151
  */
152
152
  export declare class LayerPlan<TReason extends LayerPlanReason = LayerPlanReason> {
153
- readonly operationPlan: OperationPlan;
154
- readonly reason: TReason;
155
153
  id: number;
156
154
  distributorDependencies: null | {
157
155
  [distributorStepId: number]: number[];
@@ -176,6 +174,8 @@ export declare class LayerPlan<TReason extends LayerPlanReason = LayerPlanReason
176
174
  */
177
175
  outOfBoundsLayerPlanIds: Set<number>;
178
176
  private sideEffectRootLayerPlan;
177
+ readonly operationPlan: OperationPlan;
178
+ readonly reason: TReason;
179
179
  constructor(operationPlan: OperationPlan, reason: TReason);
180
180
  toString(): string;
181
181
  print(depth?: number): string;
@@ -5,23 +5,23 @@ exports.hasParentLayerPlan = hasParentLayerPlan;
5
5
  exports.isDeferredLayerPlan = isDeferredLayerPlan;
6
6
  const tslib_1 = require("tslib");
7
7
  const assert = tslib_1.__importStar(require("../assert.js"));
8
- const constants_js_1 = require("../constants.js");
9
- const dev_js_1 = require("../dev.js");
10
- const error_js_1 = require("../error.js");
11
- const inspect_js_1 = require("../inspect.js");
12
- const utils_js_1 = require("../utils.js");
13
- const distributor_js_1 = require("./distributor.js");
14
- const executeBucket_js_1 = require("./executeBucket.js");
8
+ const constants_ts_1 = require("../constants.js");
9
+ const dev_ts_1 = require("../dev.js");
10
+ const error_ts_1 = require("../error.js");
11
+ const inspect_ts_1 = require("../inspect.js");
12
+ const utils_ts_1 = require("../utils.js");
13
+ const distributor_ts_1 = require("./distributor.js");
14
+ const executeBucket_ts_1 = require("./executeBucket.js");
15
15
  /**
16
16
  * If any of these flags exist on a value then it isn't the value we want to
17
17
  * include for the combo step.
18
18
  */
19
- const SKIP_FLAGS = constants_js_1.FLAG_ERROR | constants_js_1.FLAG_STOPPED | constants_js_1.FLAG_POLY_SKIPPED | constants_js_1.FLAG_INHIBITED;
19
+ const SKIP_FLAGS = constants_ts_1.FLAG_ERROR | constants_ts_1.FLAG_STOPPED | constants_ts_1.FLAG_POLY_SKIPPED | constants_ts_1.FLAG_INHIBITED;
20
20
  /**
21
21
  * If any of these flags exist on the "$__typename" step, then the value
22
22
  * should resolve to null
23
23
  */
24
- const NO_TYPENAME_FLAGS = constants_js_1.FLAG_ERROR | constants_js_1.FLAG_STOPPED | constants_js_1.FLAG_POLY_SKIPPED | constants_js_1.FLAG_INHIBITED | constants_js_1.FLAG_NULL;
24
+ const NO_TYPENAME_FLAGS = constants_ts_1.FLAG_ERROR | constants_ts_1.FLAG_STOPPED | constants_ts_1.FLAG_POLY_SKIPPED | constants_ts_1.FLAG_INHIBITED | constants_ts_1.FLAG_NULL;
25
25
  function hasParentLayerPlan(reason) {
26
26
  return reason.type !== "root" && reason.type !== "combined";
27
27
  }
@@ -59,11 +59,6 @@ function isDeferredLayerPlan(layerPlan) {
59
59
  */
60
60
  class LayerPlan {
61
61
  constructor(operationPlan, reason) {
62
- // This layer plan is dependent on the latest side effect. Note that when
63
- // we set a `rootStep` later, if the root step is dependent on this step
64
- // (directly or indirectly) we will clear this property.
65
- this.operationPlan = operationPlan;
66
- this.reason = reason;
67
62
  /**
68
63
  * Every layer plan has a "root step" that shapes the value the layer
69
64
  * returns. Note that this step may be dependent on other steps included in
@@ -133,6 +128,11 @@ class LayerPlan {
133
128
  this.combinations = [];
134
129
  /** @internal */
135
130
  this.finalCombinations = [];
131
+ this.operationPlan = operationPlan;
132
+ this.reason = reason;
133
+ // This layer plan is dependent on the latest side effect. Note that when
134
+ // we set a `rootStep` later, if the root step is dependent on this step
135
+ // (directly or indirectly) we will clear this property.
136
136
  this.stepsByConstructor = new Map();
137
137
  if (reason.type === "root") {
138
138
  this.sideEffectRootLayerPlan = null;
@@ -148,7 +148,7 @@ class LayerPlan {
148
148
  const firstParentLayerPlan = reason.parentLayerPlans[0];
149
149
  this.sideEffectRootLayerPlan =
150
150
  firstParentLayerPlan.sideEffectRootLayerPlan;
151
- if (dev_js_1.isDev) {
151
+ if (dev_ts_1.isDev) {
152
152
  for (const plp of reason.parentLayerPlans) {
153
153
  assert.strictEqual(plp.sideEffectRootLayerPlan, this.sideEffectRootLayerPlan, `Expected all parentLayerPlans to have the same sideEffectRootLayerPlan`);
154
154
  }
@@ -323,7 +323,7 @@ class LayerPlan {
323
323
  const hasNoNullsOrErrors = false;
324
324
  if (this.rootStep._isUnary) {
325
325
  const fieldValue = parentBucket.store.get(itemStepId);
326
- const forbiddenFlags = fieldValue._entryFlags & constants_js_1.FORBIDDEN_BY_NULLABLE_BOUNDARY_FLAGS;
326
+ const forbiddenFlags = fieldValue._entryFlags & constants_ts_1.FORBIDDEN_BY_NULLABLE_BOUNDARY_FLAGS;
327
327
  if (forbiddenFlags) {
328
328
  size = 0;
329
329
  }
@@ -334,7 +334,7 @@ class LayerPlan {
334
334
  const orig = parentBucket.store.get(stepId);
335
335
  if (orig.isBatch) {
336
336
  // Prepare store with an empty list for each copyPlanId
337
- const ev = (0, executeBucket_js_1.batchExecutionValue)([]);
337
+ const ev = (0, executeBucket_ts_1.batchExecutionValue)([]);
338
338
  store.set(stepId, ev);
339
339
  batchCopy.push({ orig, ev });
340
340
  }
@@ -345,7 +345,7 @@ class LayerPlan {
345
345
  const parentBucketSize = parentBucket.size;
346
346
  for (let originalIndex = 0; originalIndex < parentBucketSize; originalIndex++) {
347
347
  if (parentSideEffectValue === null ||
348
- !(parentSideEffectValue._flagsAt(originalIndex) & constants_js_1.FLAG_ERROR)) {
348
+ !(parentSideEffectValue._flagsAt(originalIndex) & constants_ts_1.FLAG_ERROR)) {
349
349
  const newIndex = size++;
350
350
  map.set(originalIndex, newIndex);
351
351
  polymorphicPathList[newIndex] =
@@ -379,14 +379,14 @@ class LayerPlan {
379
379
  }
380
380
  }
381
381
  else {
382
- const ev = (0, executeBucket_js_1.batchExecutionValue)([]);
382
+ const ev = (0, executeBucket_ts_1.batchExecutionValue)([]);
383
383
  store.set(itemStepId, ev);
384
384
  const batchCopy = [];
385
385
  for (const stepId of copyStepIds) {
386
386
  const orig = parentBucket.store.get(stepId);
387
387
  if (orig.isBatch) {
388
388
  // Prepare store with an empty list for each copyPlanId
389
- const ev = (0, executeBucket_js_1.batchExecutionValue)([]);
389
+ const ev = (0, executeBucket_ts_1.batchExecutionValue)([]);
390
390
  store.set(stepId, ev);
391
391
  batchCopy.push({ orig, ev });
392
392
  }
@@ -403,8 +403,8 @@ class LayerPlan {
403
403
  // we must "multiply up" (down) the store entries.
404
404
  for (let originalIndex = 0; originalIndex < parentBucket.size; originalIndex++) {
405
405
  if ((parentSideEffectValue === null ||
406
- !(parentSideEffectValue._flagsAt(originalIndex) & constants_js_1.FLAG_ERROR)) &&
407
- !(nullableStepStore._flagsAt(originalIndex) & constants_js_1.FLAG_NULL)) {
406
+ !(parentSideEffectValue._flagsAt(originalIndex) & constants_ts_1.FLAG_ERROR)) &&
407
+ !(nullableStepStore._flagsAt(originalIndex) & constants_ts_1.FLAG_NULL)) {
408
408
  const newIndex = size++;
409
409
  map.set(originalIndex, newIndex);
410
410
  ev._copyResult(newIndex, nullableStepStore, originalIndex);
@@ -436,7 +436,7 @@ class LayerPlan {
436
436
  if (this.rootStep._isUnary) {
437
437
  throw new Error("listItem layer plan can't have a unary root step!");
438
438
  }
439
- const ev = (0, executeBucket_js_1.batchExecutionValue)([]);
439
+ const ev = (0, executeBucket_ts_1.batchExecutionValue)([]);
440
440
  store.set(itemStepId, ev);
441
441
  const batchCopy = [];
442
442
  for (const stepId of copyStepIds) {
@@ -444,7 +444,7 @@ class LayerPlan {
444
444
  const orig = parentBucket.store.get(stepId);
445
445
  if (orig.isBatch) {
446
446
  // Prepare store with an empty list for each copyPlanId
447
- const ev = (0, executeBucket_js_1.batchExecutionValue)([]);
447
+ const ev = (0, executeBucket_ts_1.batchExecutionValue)([]);
448
448
  store.set(stepId, ev);
449
449
  batchCopy.push({ orig, ev });
450
450
  }
@@ -457,7 +457,7 @@ class LayerPlan {
457
457
  for (let originalIndex = 0; originalIndex < parentBucket.size; originalIndex++) {
458
458
  const list = listStepStore.at(originalIndex);
459
459
  if ((parentSideEffectValue === null ||
460
- !(parentSideEffectValue._flagsAt(originalIndex) & constants_js_1.FLAG_ERROR)) &&
460
+ !(parentSideEffectValue._flagsAt(originalIndex) & constants_ts_1.FLAG_ERROR)) &&
461
461
  Array.isArray(list)) {
462
462
  const newIndexes = [];
463
463
  map.set(originalIndex, newIndexes);
@@ -465,15 +465,15 @@ class LayerPlan {
465
465
  const newIndex = size++;
466
466
  newIndexes.push(newIndex);
467
467
  let val = list[j];
468
- let flags = constants_js_1.NO_FLAGS;
468
+ let flags = constants_ts_1.NO_FLAGS;
469
469
  if (val == null) {
470
- flags = flags | constants_js_1.FLAG_NULL;
470
+ flags = flags | constants_ts_1.FLAG_NULL;
471
471
  }
472
- else if (typeof val === "object" && (0, error_js_1.isFlaggedValue)(val)) {
472
+ else if (typeof val === "object" && (0, error_ts_1.isFlaggedValue)(val)) {
473
473
  flags = val.flags;
474
474
  val = val.value;
475
475
  if (val == null) {
476
- flags = flags | constants_js_1.FLAG_NULL;
476
+ flags = flags | constants_ts_1.FLAG_NULL;
477
477
  }
478
478
  }
479
479
  ev._setResult(newIndex, val, flags);
@@ -515,7 +515,7 @@ class LayerPlan {
515
515
  throw new Error(`GrafastInternalError<548f0d84-4556-4189-8655-fb16aa3345a6>: new bucket for ${this} wants to copy ${this.operationPlan.dangerouslyGetStep(stepId)}, but bucket for ${parentBucket.layerPlan} doesn't contain that plan`);
516
516
  }
517
517
  if (orig.isBatch) {
518
- const ev = (0, executeBucket_js_1.batchExecutionValue)([]);
518
+ const ev = (0, executeBucket_ts_1.batchExecutionValue)([]);
519
519
  store.set(stepId, ev);
520
520
  batchCopy.push({ orig, ev });
521
521
  }
@@ -530,7 +530,7 @@ class LayerPlan {
530
530
  continue;
531
531
  }
532
532
  if (parentSideEffectValue !== null &&
533
- parentSideEffectValue._flagsAt(originalIndex) & constants_js_1.FLAG_ERROR) {
533
+ parentSideEffectValue._flagsAt(originalIndex) & constants_ts_1.FLAG_ERROR) {
534
534
  skipIndex?.(originalIndex);
535
535
  continue;
536
536
  }
@@ -564,7 +564,7 @@ class LayerPlan {
564
564
  throw new Error(`GrafastInternalError<548f0d84-4556-4189-8655-fb16aa3345a6>: new bucket for ${this} wants to copy ${this.operationPlan.dangerouslyGetStep(stepId)}, but bucket for ${parentBucket.layerPlan} doesn't contain that plan`);
565
565
  }
566
566
  if (orig.isBatch) {
567
- const ev = (0, executeBucket_js_1.batchExecutionValue)([]);
567
+ const ev = (0, executeBucket_ts_1.batchExecutionValue)([]);
568
568
  store.set(stepId, ev);
569
569
  batchCopy.push({ orig, ev });
570
570
  }
@@ -574,7 +574,7 @@ class LayerPlan {
574
574
  }
575
575
  for (let originalIndex = 0; originalIndex < parentBucket.size; originalIndex++) {
576
576
  if (parentSideEffectValue !== null &&
577
- parentSideEffectValue._flagsAt(originalIndex) & constants_js_1.FLAG_ERROR) {
577
+ parentSideEffectValue._flagsAt(originalIndex) & constants_ts_1.FLAG_ERROR) {
578
578
  skipIndex?.(originalIndex);
579
579
  continue;
580
580
  }
@@ -609,12 +609,12 @@ class LayerPlan {
609
609
  }
610
610
  default: {
611
611
  const never = this.reason;
612
- throw new Error(`GrafastInternalError<8162e6c2-3d66-4d67-ba03-5310a4f9a6d4>: unhandled reason '${(0, inspect_js_1.inspect)(never)}'`);
612
+ throw new Error(`GrafastInternalError<8162e6c2-3d66-4d67-ba03-5310a4f9a6d4>: unhandled reason '${(0, inspect_ts_1.inspect)(never)}'`);
613
613
  }
614
614
  }
615
615
  if (size > 0) {
616
616
  if (this.distributorDependencies !== null) {
617
- if (dev_js_1.isDev) {
617
+ if (dev_ts_1.isDev) {
618
618
  if (this.reason.type === "listItem") {
619
619
  throw new Error(`distributorDependencies should not be set on ${this}`);
620
620
  }
@@ -625,7 +625,7 @@ class LayerPlan {
625
625
  const distribEV = parentBucket.store.get(Number(distributorStepId));
626
626
  for (const originalIndex of skippedIndicies) {
627
627
  const v = distribEV.at(originalIndex);
628
- if ((0, distributor_js_1.isDistributor)(v)) {
628
+ if ((0, distributor_ts_1.isDistributor)(v)) {
629
629
  for (const consumerStepId of consumerStepIds) {
630
630
  v.releaseIfUnused(consumerStepId);
631
631
  }
@@ -635,7 +635,7 @@ class LayerPlan {
635
635
  }
636
636
  }
637
637
  // Reference
638
- const childBucket = (0, executeBucket_js_1.newBucket)(parentBucket, {
638
+ const childBucket = (0, executeBucket_ts_1.newBucket)(parentBucket, {
639
639
  layerPlan: this,
640
640
  size,
641
641
  store,
@@ -658,7 +658,7 @@ class LayerPlan {
658
658
  const distribEV = parentBucket.store.get(Number(distributorStepId));
659
659
  for (let originalIndex = 0; originalIndex < parentBucketSize; originalIndex++) {
660
660
  const v = distribEV.at(originalIndex);
661
- if ((0, distributor_js_1.isDistributor)(v)) {
661
+ if ((0, distributor_ts_1.isDistributor)(v)) {
662
662
  for (const consumerStepId of consumerStepIds) {
663
663
  v.releaseIfUnused(consumerStepId);
664
664
  }
@@ -680,7 +680,7 @@ class LayerPlan {
680
680
  const polymorphicPathList = [];
681
681
  const iterators = [];
682
682
  const mapByParentLayerPlanId = Object.create(null);
683
- let flagUnion = constants_js_1.NO_FLAGS;
683
+ let flagUnion = constants_ts_1.NO_FLAGS;
684
684
  let totalSize = 0;
685
685
  const batchStepIdsToCopy = new Set();
686
686
  for (const plp of this.reason.parentLayerPlans) {
@@ -717,7 +717,7 @@ class LayerPlan {
717
717
  if (totalSize === 0)
718
718
  return null;
719
719
  for (const stepId of batchStepIdsToCopy) {
720
- const newEv = (0, executeBucket_js_1.batchExecutionValue)((0, utils_js_1.arrayOfLength)(totalSize, null), (0, utils_js_1.arrayOfLength)(totalSize, constants_js_1.FLAG_NULL | constants_js_1.FLAG_STOPPED));
720
+ const newEv = (0, executeBucket_ts_1.batchExecutionValue)((0, utils_ts_1.arrayOfLength)(totalSize, null), (0, utils_ts_1.arrayOfLength)(totalSize, constants_ts_1.FLAG_NULL | constants_ts_1.FLAG_STOPPED));
721
721
  store.set(stepId, newEv);
722
722
  let offset = 0;
723
723
  for (const plp of this.reason.parentLayerPlans) {
@@ -744,7 +744,7 @@ class LayerPlan {
744
744
  //
745
745
  for (const { targetStepId, sourceStepsByLayerPlanId } of this
746
746
  .finalCombinations) {
747
- const ev = (0, executeBucket_js_1.batchExecutionValue)((0, utils_js_1.arrayOfLength)(totalSize, null), (0, utils_js_1.arrayOfLength)(totalSize, constants_js_1.FLAG_NULL | constants_js_1.FLAG_STOPPED));
747
+ const ev = (0, executeBucket_ts_1.batchExecutionValue)((0, utils_ts_1.arrayOfLength)(totalSize, null), (0, utils_ts_1.arrayOfLength)(totalSize, constants_ts_1.FLAG_NULL | constants_ts_1.FLAG_STOPPED));
748
748
  store.set(targetStepId, ev);
749
749
  let offset = 0;
750
750
  for (const plp of this.reason.parentLayerPlans) {
@@ -776,7 +776,7 @@ class LayerPlan {
776
776
  //
777
777
  ////////////////////////////////////////////////////////////////////////////
778
778
  // Reference
779
- const childBucket = (0, executeBucket_js_1.newBucket)({ metaByMetaKey: undefined /* use defaults */, sharedState }, {
779
+ const childBucket = (0, executeBucket_ts_1.newBucket)({ metaByMetaKey: undefined /* use defaults */, sharedState }, {
780
780
  layerPlan: this,
781
781
  size: totalSize,
782
782
  store,
@@ -826,8 +826,8 @@ class LayerPlan {
826
826
  // unimportant because probably the order of all subsets will be the
827
827
  // same, so we don't need to do an order-independent comparison (which
828
828
  // would be more expensiv)
829
- (0, utils_js_1.arraysMatch)(c.reason.typeNames, typeNames) &&
830
- (0, utils_js_1.setsMatch)(c.reason.polymorphicPaths, polymorphicPaths));
829
+ (0, utils_ts_1.arraysMatch)(c.reason.typeNames, typeNames) &&
830
+ (0, utils_ts_1.setsMatch)(c.reason.polymorphicPaths, polymorphicPaths));
831
831
  if (existing) {
832
832
  return existing;
833
833
  }
@@ -1,15 +1,15 @@
1
1
  import type { FragmentDefinitionNode, GraphQLField, GraphQLObjectType, GraphQLOutputType, GraphQLSchema, GraphQLUnionType, OperationDefinitionNode } from "graphql";
2
- import { $$timeout, $$ts } from "../constants.js";
3
- import type { Constraint } from "../constraints.js";
4
- import type { ErrorBehavior, GrafastPlanJSON } from "../index.js";
5
- import { Step } from "../index.js";
6
- import type { FieldPlanResolver, LocationDetails, TrackedArguments } from "../interfaces.js";
7
- import type { ApplyAfterModeArg } from "../operationPlan-input.js";
8
- import type { GrafastOperationOptions } from "../prepare.js";
9
- import type { LayerPlanReasonSubroutine } from "./LayerPlan.js";
10
- import { LayerPlan } from "./LayerPlan.js";
11
- import type { ProcessGroupedFieldSetDetails, StreamDetails } from "./OperationPlanTypes.js";
12
- import { OutputPlan } from "./OutputPlan.js";
2
+ import { $$timeout, $$ts } from "../constants.ts";
3
+ import type { Constraint } from "../constraints.ts";
4
+ import type { ErrorBehavior, GrafastPlanJSON } from "../index.ts";
5
+ import { Step } from "../index.ts";
6
+ import type { FieldPlanResolver, LocationDetails, TrackedArguments } from "../interfaces.ts";
7
+ import type { ApplyAfterModeArg } from "../operationPlan-input.ts";
8
+ import type { GrafastOperationOptions } from "../prepare.ts";
9
+ import type { LayerPlanReasonSubroutine } from "./LayerPlan.ts";
10
+ import { LayerPlan } from "./LayerPlan.ts";
11
+ import type { ProcessGroupedFieldSetDetails, StreamDetails } from "./OperationPlanTypes.ts";
12
+ import { OutputPlan } from "./OutputPlan.ts";
13
13
  export declare const POLYMORPHIC_ROOT_PATH: null;
14
14
  export declare const POLYMORPHIC_ROOT_PATHS: ReadonlySet<string> | null;
15
15
  /** Beware: the list of phases may change over time... @experimental */
@@ -18,19 +18,6 @@ export interface MetaByMetaKey {
18
18
  [metaKey: string | number | symbol]: Record<string, any>;
19
19
  }
20
20
  export declare class OperationPlan {
21
- readonly schema: GraphQLSchema;
22
- readonly operation: OperationDefinitionNode;
23
- readonly fragments: {
24
- [fragmentName: string]: FragmentDefinitionNode;
25
- };
26
- readonly variableValues: {
27
- [key: string]: any;
28
- };
29
- readonly context: {
30
- [key: string]: any;
31
- };
32
- readonly rootValue: any;
33
- readonly errorBehavior: ErrorBehavior;
34
21
  readonly [$$timeout]: undefined;
35
22
  readonly [$$ts]: undefined;
36
23
  readonly queryType: GraphQLObjectType;
@@ -67,6 +54,19 @@ export declare class OperationPlan {
67
54
  private optimizeMeta;
68
55
  private scalarPlanInfo;
69
56
  private frozenPlanningPaths;
57
+ readonly schema: GraphQLSchema;
58
+ readonly operation: OperationDefinitionNode;
59
+ readonly fragments: {
60
+ [fragmentName: string]: FragmentDefinitionNode;
61
+ };
62
+ readonly variableValues: {
63
+ [key: string]: any;
64
+ };
65
+ readonly context: {
66
+ [key: string]: any;
67
+ };
68
+ readonly rootValue: any;
69
+ readonly errorBehavior: ErrorBehavior;
70
70
  private readonly planningTimeout;
71
71
  private readonly maxPlanningDepth;
72
72
  constructor(schema: GraphQLSchema, operation: OperationDefinitionNode, fragments: {
@@ -108,12 +108,9 @@ export declare class OperationPlan {
108
108
  }>;
109
109
  /**
110
110
  *
111
- * @param outputPlan - The output plan that this selection set is being added to
112
- * @param path - The path within the outputPlan that we're adding stuff (only for root/object OutputPlans)
113
- * @param parentStep - The step that represents the selection set root
114
- * @param objectType - The object type that this selection set is being evaluated for (note polymorphic selection should already have been handled by this point)
115
- * @param selections - The GraphQL selections (fields, fragment spreads, inline fragments) to evaluate
116
- * @param isMutation - If true this selection set should be executed serially rather than in parallel (each field gets its own LayerPlan)
111
+ * @param details - planning details for this selection set. Includes the
112
+ * output plan, path, parent step, position type, selections, and an
113
+ * `isMutation` flag to enforce serial execution.
117
114
  */
118
115
  private planSelectionSet;
119
116
  private planningQueue;
@@ -143,7 +140,7 @@ export declare class OperationPlan {
143
140
  haltTree: boolean;
144
141
  latestSideEffectStep: Step<any> | null;
145
142
  } | {
146
- step: import("../index.js").ErrorStep<any>;
143
+ step: import("../index.ts").ErrorStep<any>;
147
144
  haltTree: boolean;
148
145
  latestSideEffectStep: Step<any> | null;
149
146
  };