grafast 0.1.1-beta.13 → 0.1.1-beta.14
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/engine/executeBucket.js +2 -2
- package/dist/operationPlan-input.js +11 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -5
|
@@ -432,7 +432,7 @@ function executeBucket(bucket, requestContext) {
|
|
|
432
432
|
}
|
|
433
433
|
// End "f2b3b1b3" block
|
|
434
434
|
}
|
|
435
|
-
else {
|
|
435
|
+
else if (forceIndexValue === undefined) {
|
|
436
436
|
const depVal = depExecutionVal.at(dataIndex);
|
|
437
437
|
let depFlags;
|
|
438
438
|
if ((bucket.flagUnion & interfaces_js_1.FLAG_ERROR) === interfaces_js_1.FLAG_ERROR &&
|
|
@@ -768,7 +768,7 @@ function executeBucket(bucket, requestContext) {
|
|
|
768
768
|
}
|
|
769
769
|
const result = needsFiltering
|
|
770
770
|
? reallyExecuteStepWithFiltering(step, dependencies, _rawForbiddenFlags, _rawOnReject, bucket.polymorphicPathList, extra)
|
|
771
|
-
: reallyExecuteStepWithoutFiltering(step._isUnary ? 1 : size, step, dependencies, extra);
|
|
771
|
+
: reallyExecuteStepWithoutFiltering(step._isUnary ? 1 : size, step, $sideEffect ? dependencies.slice(0, depCount) : dependencies, extra);
|
|
772
772
|
if ((0, utils_js_1.isPromiseLike)(result)) {
|
|
773
773
|
return result.then(null, (error) => {
|
|
774
774
|
// Don't need to do this here, it will be done where the
|
|
@@ -7,6 +7,11 @@ const constant_js_1 = require("./steps/constant.js");
|
|
|
7
7
|
const list_js_1 = require("./steps/list.js");
|
|
8
8
|
const object_js_1 = require("./steps/object.js");
|
|
9
9
|
const { getNullableType, isEnumType, isInputObjectType, isListType, isScalarType, } = graphql;
|
|
10
|
+
function assertNotRuntime(operationPlan, description) {
|
|
11
|
+
if (operationPlan.phase === "ready") {
|
|
12
|
+
throw new Error(`${description} may only be called at planning time; however you have code that has attempted to call it during execution time. Please revisit your plan resolvers to locate the issue.`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
10
15
|
function withFieldArgsForArguments(operationPlan, $parent, $all, field, applyAfterMode, callback) {
|
|
11
16
|
if (operationPlan.loc !== null)
|
|
12
17
|
operationPlan.loc.push(`withFieldArgsForArguments(${field.name})`);
|
|
@@ -20,6 +25,7 @@ function withFieldArgsForArguments(operationPlan, $parent, $all, field, applyAft
|
|
|
20
25
|
let explicitlyApplied = false;
|
|
21
26
|
const fieldArgs = {
|
|
22
27
|
getRaw(path) {
|
|
28
|
+
assertNotRuntime(operationPlan, `fieldArgs.getRaw()`);
|
|
23
29
|
if (typeof path === "string") {
|
|
24
30
|
return $all.get(path);
|
|
25
31
|
}
|
|
@@ -47,6 +53,7 @@ function withFieldArgsForArguments(operationPlan, $parent, $all, field, applyAft
|
|
|
47
53
|
}
|
|
48
54
|
},
|
|
49
55
|
get(inPath) {
|
|
56
|
+
assertNotRuntime(operationPlan, `fieldArgs.get()`);
|
|
50
57
|
const path = Array.isArray(inPath)
|
|
51
58
|
? inPath
|
|
52
59
|
: inPath
|
|
@@ -136,6 +143,7 @@ function withFieldArgsForArguments(operationPlan, $parent, $all, field, applyAft
|
|
|
136
143
|
}
|
|
137
144
|
},
|
|
138
145
|
apply(targetStepOrCallback, inPath) {
|
|
146
|
+
assertNotRuntime(operationPlan, `fieldArgs.apply()`);
|
|
139
147
|
const path = Array.isArray(inPath) ? inPath : inPath ? [inPath] : [];
|
|
140
148
|
const pathString = path.join(".");
|
|
141
149
|
const $existing = applied.get(pathString);
|
|
@@ -243,9 +251,11 @@ function withFieldArgsForArguments(operationPlan, $parent, $all, field, applyAft
|
|
|
243
251
|
const nullableEntityType = getNullableType(entityType);
|
|
244
252
|
const localFieldArgs = {
|
|
245
253
|
getRaw(subpath) {
|
|
254
|
+
assertNotRuntime(operationPlan, `fieldArgs.getRaw()`);
|
|
246
255
|
return fieldArgs.getRaw(concatPath(path, subpath));
|
|
247
256
|
},
|
|
248
257
|
get(subpath) {
|
|
258
|
+
assertNotRuntime(operationPlan, `fieldArgs.get()`);
|
|
249
259
|
if (!subpath || (Array.isArray(subpath) && subpath.length === 0)) {
|
|
250
260
|
if (isListType(nullableEntityType)) {
|
|
251
261
|
if (!("evalLength" in $input)) {
|
|
@@ -307,6 +317,7 @@ function withFieldArgsForArguments(operationPlan, $parent, $all, field, applyAft
|
|
|
307
317
|
return fieldArgs.get(concatPath(path, subpath));
|
|
308
318
|
},
|
|
309
319
|
apply(targetStepOrCallback, subpath) {
|
|
320
|
+
assertNotRuntime(operationPlan, `fieldArgs.apply()`);
|
|
310
321
|
if (mode === "apply" &&
|
|
311
322
|
(!subpath || (Array.isArray(subpath) && subpath.length === 0))) {
|
|
312
323
|
if (isInputObjectType(nullableEntityType)) {
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "0.1.1-beta.
|
|
1
|
+
export declare const version = "0.1.1-beta.14";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grafast",
|
|
3
|
-
"version": "0.1.1-beta.
|
|
3
|
+
"version": "0.1.1-beta.14",
|
|
4
4
|
"description": "Cutting edge GraphQL planning and execution engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"chalk": "^4.1.2",
|
|
60
60
|
"debug": "^4.3.4",
|
|
61
61
|
"eventemitter3": "^5.0.1",
|
|
62
|
+
"graphile-config": "^0.0.1-beta.9",
|
|
62
63
|
"graphql": "^16.1.0-experimental-stream-defer.6",
|
|
63
64
|
"iterall": "^1.3.0",
|
|
64
65
|
"tamedevil": "^0.0.0-beta.7",
|
|
@@ -66,16 +67,12 @@
|
|
|
66
67
|
},
|
|
67
68
|
"peerDependencies": {
|
|
68
69
|
"@envelop/core": "^5.0.0",
|
|
69
|
-
"graphile-config": "^0.0.1-beta.9",
|
|
70
70
|
"graphql": "^16.1.0-experimental-stream-defer.6",
|
|
71
71
|
"tamedevil": "^0.0.0-beta.7"
|
|
72
72
|
},
|
|
73
73
|
"peerDependenciesMeta": {
|
|
74
74
|
"@envelop/core": {
|
|
75
75
|
"optional": true
|
|
76
|
-
},
|
|
77
|
-
"graphile-config": {
|
|
78
|
-
"optional": true
|
|
79
76
|
}
|
|
80
77
|
},
|
|
81
78
|
"files": [
|