Skip to content

Commit

Permalink
Another assertNotPromise
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Oct 1, 2024
1 parent 0220a82 commit 21eca19
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions grafast/grafast/src/engine/OperationPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ import { timeSource } from "../timeSource.js";
import type { Sudo } from "../utils.js";
import {
assertNotAsync,
assertNotPromise,
defaultValueToValueNode,
findVariableNamesUsed,
hasItemPlan,
Expand Down Expand Up @@ -1439,18 +1440,23 @@ export class OperationPlan {
}
} else if (isScalarType(nullableFieldType)) {
const scalarPlanResolver = nullableFieldType.extensions?.grafast?.plan;
assertNotAsync(scalarPlanResolver, `${nullableFieldType.name}.plan`);
const fnDescription = `${nullableFieldType.name}.plan`;
assertNotAsync(scalarPlanResolver, fnDescription);
const $sideEffect = parentLayerPlan.latestSideEffectStep;
try {
const $leaf =
typeof scalarPlanResolver === "function"
? withGlobalLayerPlan(
parentLayerPlan,
polymorphicPaths,
? assertNotPromise(
withGlobalLayerPlan(
parentLayerPlan,
polymorphicPaths,
scalarPlanResolver,
null,
$step,
this.scalarPlanInfo,
),
scalarPlanResolver,
null,
$step,
this.scalarPlanInfo,
fnDescription,
)
: $step;

Expand Down

0 comments on commit 21eca19

Please sign in to comment.