grafast 1.0.0-rc.6 → 1.0.0-rc.8
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/LayerPlan.js +30 -3
- package/dist/engine/OperationPlan.js +4 -1
- package/dist/engine/distributor.js +3 -3
- package/dist/engine/executeBucket.js +26 -51
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -3
- package/dist/step.d.ts +2 -2
- package/dist/step.js +7 -4
- package/dist/steps/_loadCommon.js +1 -1
- package/dist/steps/graphqlResolver.js +4 -2
- package/dist/steps/listen.js +1 -1
- package/dist/steps/node.d.ts +3 -6
- package/dist/steps/node.js +4 -5
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +11 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/engine/LayerPlan.js
CHANGED
|
@@ -16,12 +16,17 @@ const executeBucket_ts_1 = require("./executeBucket.js");
|
|
|
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_ts_1.FLAG_ERROR | constants_ts_1.FLAG_STOPPED | constants_ts_1.FLAG_POLY_SKIPPED | constants_ts_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 | constants_ts_1.FLAG_NULL;
|
|
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
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
|
+
/**
|
|
26
|
+
* Used to determine if we should copy the error. Should only be copied if it's
|
|
27
|
+
* NOT polymorphic skipped; so we check the result `=== FLAG_ERROR`
|
|
28
|
+
*/
|
|
29
|
+
const ERROR_OR_POLY_SKIPPED_FLAGS = constants_ts_1.FLAG_ERROR | constants_ts_1.FLAG_POLY_SKIPPED;
|
|
25
30
|
function hasParentLayerPlan(reason) {
|
|
26
31
|
return reason.type !== "root" && reason.type !== "combined";
|
|
27
32
|
}
|
|
@@ -298,6 +303,7 @@ class LayerPlan {
|
|
|
298
303
|
const polymorphicType = this.reason.type === "polymorphic" ? [] : null;
|
|
299
304
|
const iterators = this.reason.type === "mutationField" ? parentBucket.iterators : [];
|
|
300
305
|
const map = new Map();
|
|
306
|
+
let flagUnion = parentBucket.flagUnion;
|
|
301
307
|
const $parentSideEffect = this.parentSideEffectStep;
|
|
302
308
|
let parentSideEffectValue;
|
|
303
309
|
if ($parentSideEffect) {
|
|
@@ -476,6 +482,7 @@ class LayerPlan {
|
|
|
476
482
|
flags = flags | constants_ts_1.FLAG_NULL;
|
|
477
483
|
}
|
|
478
484
|
}
|
|
485
|
+
flagUnion |= flags;
|
|
479
486
|
ev._setResult(newIndex, val, flags);
|
|
480
487
|
polymorphicPathList[newIndex] =
|
|
481
488
|
parentBucket.polymorphicPathList[originalIndex];
|
|
@@ -640,7 +647,7 @@ class LayerPlan {
|
|
|
640
647
|
size,
|
|
641
648
|
store,
|
|
642
649
|
// PERF: not necessarily, if we don't copy the errors, we don't have the errors.
|
|
643
|
-
flagUnion
|
|
650
|
+
flagUnion,
|
|
644
651
|
polymorphicPathList,
|
|
645
652
|
polymorphicType,
|
|
646
653
|
iterators,
|
|
@@ -669,6 +676,8 @@ class LayerPlan {
|
|
|
669
676
|
return null;
|
|
670
677
|
}
|
|
671
678
|
}
|
|
679
|
+
// TODO: currently we copy nulls and errors through. Ideally we wouldn't,
|
|
680
|
+
// thereby shrinking the size of the bucket.
|
|
672
681
|
newCombinedBucket(finalParentBucket) {
|
|
673
682
|
const t = this.reason.type;
|
|
674
683
|
if (t !== "combined") {
|
|
@@ -753,6 +762,7 @@ class LayerPlan {
|
|
|
753
762
|
continue;
|
|
754
763
|
for (let originalIndex = 0; originalIndex < parentBucket.size; originalIndex++) {
|
|
755
764
|
const newIndex = originalIndex + offset;
|
|
765
|
+
let fallbackErrorSource = null;
|
|
756
766
|
if (sourceStepsByLayerPlanId[plp.id]) {
|
|
757
767
|
for (const stepId of sourceStepsByLayerPlanId[plp.id]) {
|
|
758
768
|
const sourceStore = parentBucket.store.get(stepId);
|
|
@@ -760,12 +770,29 @@ class LayerPlan {
|
|
|
760
770
|
const step = this.operationPlan.stepTracker.getStepById(stepId);
|
|
761
771
|
throw new Error(`GrafastInternalError<a48ca88c-e4b9-4a4f-9a38-846fa067f143>: missing source store for ${step} (${stepId}) in ${this}`);
|
|
762
772
|
}
|
|
763
|
-
|
|
773
|
+
const sourceFlags = sourceStore._flagsAt(originalIndex);
|
|
774
|
+
if ((sourceFlags & SKIP_FLAGS) === 0) {
|
|
764
775
|
ev._copyResult(newIndex, sourceStore, originalIndex);
|
|
776
|
+
fallbackErrorSource = null;
|
|
765
777
|
break;
|
|
766
778
|
}
|
|
779
|
+
else if (fallbackErrorSource === null &&
|
|
780
|
+
(sourceFlags & ERROR_OR_POLY_SKIPPED_FLAGS) === constants_ts_1.FLAG_ERROR) {
|
|
781
|
+
fallbackErrorSource = sourceStore;
|
|
782
|
+
} // If no matches, it retains `FLAG_NULL | FLAG_STOPPED` from above
|
|
767
783
|
}
|
|
768
784
|
}
|
|
785
|
+
if (fallbackErrorSource !== null) {
|
|
786
|
+
// No non-skipped source existed for this index; preserve the first
|
|
787
|
+
// available error instead of silently converting to stopped/null.
|
|
788
|
+
//
|
|
789
|
+
// Normally we'd do:
|
|
790
|
+
//
|
|
791
|
+
// ev._copyResult(newIndex, fallbackErrorSource, originalIndex);
|
|
792
|
+
//
|
|
793
|
+
// However, we want to add FLAG_STOPPED, so we do this manually:
|
|
794
|
+
ev._setResult(newIndex, fallbackErrorSource.at(originalIndex), fallbackErrorSource._flagsAt(originalIndex) | constants_ts_1.FLAG_STOPPED);
|
|
795
|
+
}
|
|
769
796
|
iterators[newIndex] = parentBucket.iterators[originalIndex];
|
|
770
797
|
}
|
|
771
798
|
offset += parentBucket.size;
|
|
@@ -1220,6 +1220,9 @@ class OperationPlan {
|
|
|
1220
1220
|
: (0, step_ts_1.stepHasToRecord)($original)
|
|
1221
1221
|
? (0, withGlobalLayerPlan_ts_1.withGlobalLayerPlan)(commonLayerPlan, polymorphicPaths, planningPath, null, $original.toRecord, $original)
|
|
1222
1222
|
: $original;
|
|
1223
|
+
// Combo layer plan filters nulls for us; since we're skipping that
|
|
1224
|
+
// we need to explicitly inhibit nulls
|
|
1225
|
+
commonStep = (0, withGlobalLayerPlan_ts_1.withGlobalLayerPlan)(commonLayerPlan, polymorphicPaths, planningPath, null, index_ts_1.inhibitOnNull, null, commonStep);
|
|
1223
1226
|
for (const detailsRecord of detailsRecordList) {
|
|
1224
1227
|
detailsRecord.layerPlan = commonLayerPlan;
|
|
1225
1228
|
const polymorphicPaths = detailsRecord.polymorphicPaths;
|
|
@@ -1947,7 +1950,7 @@ class OperationPlan {
|
|
|
1947
1950
|
(0, withGlobalLayerPlan_ts_1.withGlobalLayerPlan)(layerPlan, polymorphicPaths, planningPath, null, constant_ts_1.constant, null, null);
|
|
1948
1951
|
haltTree = true;
|
|
1949
1952
|
}
|
|
1950
|
-
(0, step_ts_1.
|
|
1953
|
+
(0, step_ts_1.assertStep)(step);
|
|
1951
1954
|
// `undefined` for non-lists (?)
|
|
1952
1955
|
if (stepStreamOptions !== undefined) {
|
|
1953
1956
|
// `null` is fine! `undefined` is not.
|
|
@@ -147,7 +147,7 @@ function distributor(sourceIterable, dependentSteps, abortSignal, distributorOpt
|
|
|
147
147
|
let advanced = false;
|
|
148
148
|
while (smallest >= lowWaterMark) {
|
|
149
149
|
advanced = true;
|
|
150
|
-
buffer.shift();
|
|
150
|
+
void buffer.shift();
|
|
151
151
|
lowWaterMark++;
|
|
152
152
|
}
|
|
153
153
|
// Announce that the lowWaterMark advanced
|
|
@@ -342,14 +342,14 @@ function distributor(sourceIterable, dependentSteps, abortSignal, distributorOpt
|
|
|
342
342
|
const stepIndex = getStepIndex(stepId);
|
|
343
343
|
if (!hasIterator[stepIndex]) {
|
|
344
344
|
hasIterator[stepIndex] = true;
|
|
345
|
-
stop(stepIndex);
|
|
345
|
+
void stop(stepIndex);
|
|
346
346
|
}
|
|
347
347
|
},
|
|
348
348
|
};
|
|
349
349
|
abortSignal.addEventListener("abort", () => {
|
|
350
350
|
for (let stepIndex = 0, l = dependentSteps.length; stepIndex < l; stepIndex++) {
|
|
351
351
|
hasIterator[stepIndex] = true;
|
|
352
|
-
stop(stepIndex, undefined, false);
|
|
352
|
+
void stop(stepIndex, undefined, false);
|
|
353
353
|
}
|
|
354
354
|
maybeAdvanceLowWaterMark();
|
|
355
355
|
});
|
|
@@ -181,9 +181,7 @@ function executeBucket(bucket, requestContext) {
|
|
|
181
181
|
// **DO NOT THROW, DO NOT ALLOW AN ERROR TO BE RAISED!**
|
|
182
182
|
// **USE DEFENSIVE PROGRAMMING HERE!**
|
|
183
183
|
/** PROMISES ADDED HERE MUST NOT REJECT */
|
|
184
|
-
let promises;
|
|
185
|
-
let pendingPromises;
|
|
186
|
-
let pendingPromiseIndexes;
|
|
184
|
+
let promises = undefined;
|
|
187
185
|
// TODO: it seems that if this throws an error it results in a permanent
|
|
188
186
|
// hang of defers? In the mean time... Don't throw any errors here!
|
|
189
187
|
const success = (finishedStep, bucket, resultIndex, rawValue, flags) => {
|
|
@@ -234,8 +232,9 @@ function executeBucket(bucket, requestContext) {
|
|
|
234
232
|
}
|
|
235
233
|
replacement[i] = null;
|
|
236
234
|
const index = i;
|
|
235
|
+
// Must not reject
|
|
237
236
|
const promise = item.then((v) => void (replacement[index] = v), (e) => void (replacement[index] = (0, error_ts_1.flagError)(e)));
|
|
238
|
-
if (
|
|
237
|
+
if (promises === undefined) {
|
|
239
238
|
promises = [promise];
|
|
240
239
|
}
|
|
241
240
|
else {
|
|
@@ -343,7 +342,7 @@ function executeBucket(bucket, requestContext) {
|
|
|
343
342
|
bucket.setResult(finishedStep, resultIndex, e, flags | constants_ts_1.FLAG_ERROR);
|
|
344
343
|
}
|
|
345
344
|
})();
|
|
346
|
-
if (
|
|
345
|
+
if (promises === undefined) {
|
|
347
346
|
promises = [promise];
|
|
348
347
|
}
|
|
349
348
|
else {
|
|
@@ -365,56 +364,26 @@ function executeBucket(bucket, requestContext) {
|
|
|
365
364
|
const count = step._isUnary ? 1 : size;
|
|
366
365
|
for (let dataIndex = 0; dataIndex < count; dataIndex++) {
|
|
367
366
|
const val = results[dataIndex];
|
|
367
|
+
const valFlags = flags[dataIndex];
|
|
368
|
+
if (valFlags == null) {
|
|
369
|
+
throw new Error(`GraphileInternalError<75df71bb-0f76-4a98-9664-9167d502296a>: result for ${step} has no flag at index ${dataIndex} (value = ${(0, inspect_ts_1.inspect)(val)})`);
|
|
370
|
+
}
|
|
368
371
|
if (step.isSyncAndSafe || !(0, utils_ts_1.isPromiseLike)(val)) {
|
|
369
|
-
|
|
370
|
-
throw new Error(`GraphileInternalError<75df71bb-0f76-4a98-9664-9167d502296a>: result for ${step} has no flag at index ${dataIndex} (value = ${(0, inspect_ts_1.inspect)(val)})`);
|
|
371
|
-
}
|
|
372
|
-
success(step, bucket, dataIndex, val, flags[dataIndex]);
|
|
372
|
+
success(step, bucket, dataIndex, val, valFlags);
|
|
373
373
|
}
|
|
374
374
|
else {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
375
|
+
// Must not reject!
|
|
376
|
+
const valSuccess = val.then((val) => success(step, bucket, dataIndex, val, valFlags), (error) => bucket.setResult(step, dataIndex, error, constants_ts_1.FLAG_ERROR));
|
|
377
|
+
if (promises === undefined) {
|
|
378
|
+
promises = [valSuccess];
|
|
378
379
|
}
|
|
379
380
|
else {
|
|
380
|
-
|
|
381
|
-
pendingPromiseIndexes.push({ s: allStepsIndex, i: dataIndex });
|
|
381
|
+
promises.push(valSuccess);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
|
|
387
|
-
return Promise.allSettled(pendingPromises)
|
|
388
|
-
.then((resultSettledResult) => {
|
|
389
|
-
for (let i = 0, pendingPromisesLength = resultSettledResult.length; i < pendingPromisesLength; i++) {
|
|
390
|
-
const settledResult = resultSettledResult[i];
|
|
391
|
-
const { s: allStepsIndex, i: dataIndex } = pendingPromiseIndexes[i];
|
|
392
|
-
const finishedStep = _allSteps[allStepsIndex];
|
|
393
|
-
if (settledResult.status === "fulfilled") {
|
|
394
|
-
success(finishedStep, bucket, dataIndex, settledResult.value, constants_ts_1.NO_FLAGS);
|
|
395
|
-
}
|
|
396
|
-
else {
|
|
397
|
-
const error = settledResult.reason;
|
|
398
|
-
bucket.setResult(finishedStep, dataIndex, error, constants_ts_1.FLAG_ERROR);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
return promises ? Promise.all(promises) : undefined;
|
|
402
|
-
})
|
|
403
|
-
.then(null, (e) => {
|
|
404
|
-
// THIS SHOULD NEVER HAPPEN!
|
|
405
|
-
console.error(`GrafastInternalError<1e9731b4-005e-4b0e-bc61-43baa62e6444>: this error should never occur! Please file an issue against grafast. Details: ${e}`);
|
|
406
|
-
bucket.flagUnion |= constants_ts_1.FLAG_ERROR;
|
|
407
|
-
for (let i = 0, pendingPromisesLength = pendingPromises.length; i < pendingPromisesLength; i++) {
|
|
408
|
-
const { s: allStepsIndex, i: dataIndex } = pendingPromiseIndexes[i];
|
|
409
|
-
const finishedStep = _allSteps[allStepsIndex];
|
|
410
|
-
const error = new Error(`GrafastInternalError<1e9731b4-005e-4b0e-bc61-43baa62e6444>: error occurred whilst performing completedStep(${finishedStep.id})`);
|
|
411
|
-
bucket.setResult(finishedStep, dataIndex, error, constants_ts_1.FLAG_ERROR);
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
else {
|
|
416
|
-
return promises ? Promise.all(promises) : undefined;
|
|
417
|
-
}
|
|
386
|
+
return promises === undefined ? undefined : Promise.all(promises);
|
|
418
387
|
};
|
|
419
388
|
const runSyncSteps = () => {
|
|
420
389
|
const executedLength = resultList.length;
|
|
@@ -1046,14 +1015,22 @@ function markLayerPlanAsDone(requestContext, sharedState, layerPlan, bucket) {
|
|
|
1046
1015
|
if (!allParentLayerPlansAreReady) {
|
|
1047
1016
|
// The last parent layer plan to complete will handle it.
|
|
1048
1017
|
// Make sure we're retained so it can use our data!
|
|
1049
|
-
//
|
|
1018
|
+
// Released below.
|
|
1050
1019
|
if (bucket != null) {
|
|
1051
1020
|
bucket.sharedState.retain(bucket);
|
|
1052
1021
|
}
|
|
1053
|
-
// TODO: MAKE SURE CANCELLED BUCKETS ARE HANDLED!
|
|
1054
1022
|
continue loop;
|
|
1055
1023
|
}
|
|
1056
1024
|
const childBucket = childLayerPlan.newCombinedBucket({ sharedState });
|
|
1025
|
+
// Every parent except the final parent was retained while waiting for all
|
|
1026
|
+
// parents to complete; release those temporary retains now.
|
|
1027
|
+
for (const plp of childLayerPlan.reason.parentLayerPlans) {
|
|
1028
|
+
if (plp === layerPlan)
|
|
1029
|
+
continue; // Was never retained
|
|
1030
|
+
const otherBucket = sharedState._retainedBuckets.get(plp.id);
|
|
1031
|
+
if (otherBucket !== undefined)
|
|
1032
|
+
sharedState.release(otherBucket);
|
|
1033
|
+
}
|
|
1057
1034
|
if (childBucket !== null) {
|
|
1058
1035
|
// Execute
|
|
1059
1036
|
const result = executeBucket(childBucket, requestContext);
|
|
@@ -1174,9 +1151,7 @@ function newBucket(parent, spec) {
|
|
|
1174
1151
|
if (index >= size) {
|
|
1175
1152
|
throw new Error(`GrafastInternalError<9465db89-cc9d-415c-97e7-57bb19ddebe0>: attempt to write to out of bounds index ${index} for bucket of size ${size} for step ${step}`);
|
|
1176
1153
|
}
|
|
1177
|
-
|
|
1178
|
-
this.flagUnion |= flags;
|
|
1179
|
-
}
|
|
1154
|
+
this.flagUnion |= flags;
|
|
1180
1155
|
if (step._isUnary) {
|
|
1181
1156
|
if (dev_ts_1.isDev && store.has(stepId)) {
|
|
1182
1157
|
const ev = store.get(stepId);
|
package/dist/index.d.ts
CHANGED
|
@@ -34,11 +34,11 @@ import { stringifyPayload } from "./stringifyPayload.ts";
|
|
|
34
34
|
import { stripAnsi } from "./stripAnsi.ts";
|
|
35
35
|
import { subscribe } from "./subscribe.ts";
|
|
36
36
|
import type { GrafastInputFieldConfigMap, GrafastInputObjectType, GrafastObjectType, InputObjectTypeSpec, ObjectTypeFields, ObjectTypeSpec } from "./utils.ts";
|
|
37
|
-
import { arrayOfLength, arraysMatch, asyncIteratorWithCleanup, getEnumValueConfig, getEnumValueConfigs, GraphQLSpecifiedErrorBehaviors, inputObjectFieldSpec, isPromiseLike, mapsMatch, maybeArraysMatch, newGrafastFieldConfigBuilder, newInputObjectTypeBuilder, newObjectTypeBuilder, objectFieldSpec, objectSpec, recordsMatch, setsMatch, stepADependsOnStepB, stepAMayDependOnStepB, stepAShouldTryAndInlineIntoStepB, stepsAreInSamePhase } from "./utils.ts";
|
|
37
|
+
import { arrayOfLength, arraysMatch, asyncIteratorWithCleanup, getEnumValueConfig, getEnumValueConfigs, GraphQLSpecifiedErrorBehaviors, inputObjectFieldSpec, isPromiseLike, mapsMatch, markSyncAndSafe, maybeArraysMatch, newGrafastFieldConfigBuilder, newInputObjectTypeBuilder, newObjectTypeBuilder, objectFieldSpec, objectSpec, recordsMatch, setsMatch, stepADependsOnStepB, stepAMayDependOnStepB, stepAShouldTryAndInlineIntoStepB, stepsAreInSamePhase } from "./utils.ts";
|
|
38
38
|
export { GraphQLDeferDirective, graphqlHasStreamDefer, GraphQLStreamDirective, } from "./incremental.ts";
|
|
39
39
|
export { isAsyncIterable } from "iterall";
|
|
40
40
|
export type { __InputObjectStepWithDollars, __TrackedValueStepWithDollars, AbstractTypePlan, AbstractTypePlanner, ActualKeyByDesiredKey, BaseEventMap, BaseGraphQLArguments, BaseGraphQLRootValue, BaseGraphQLVariables, BatchExecutionValue, ConnectionHandlingResult, ConnectionHandlingStep, ConnectionOptimizedStep, DataFromObjectSteps, DataFromStep, DeprecatedInputObjectPlan, DeprecatedObjectPlan, EnumPlan, EnumValueConfig, EnumValueInput, ErrorBehavior, EventCallback, EventMapKey, ExecutionDetails, ExecutionDetailsStream, ExecutionEventEmitter, ExecutionEventMap, ExecutionExtra, ExecutionResults, ExecutionResultValue, ExecutionValue, FieldArg, FieldArgs, FieldInfo, FieldPlan, FieldPlanResolver, FilterPlanMemo, GrafastArgumentConfig, GrafastExecutionArgs, GrafastFieldConfig, GrafastFieldConfigArgumentMap, GrafastInputFieldConfig, GrafastInputFieldConfigMap, GrafastInputObjectType, GrafastObjectType, GrafastPlanJSON, GrafastResultsList, GrafastResultStreamList, GrafastSchemaConfig, GrafastSubscriber, GrafastValuesList, GroupByPlanMemo, InputFieldPlan, InputObjectFieldApplyResolver, InputObjectFieldConfig, InputObjectPlan, InputObjectTypeBakedInfo, InputObjectTypeBakedResolver, InputObjectTypeSpec, InterfacePlan, JSONArray, JSONObject, JSONValue, ListCapableStep, ListLikeStep, ListTransformItemPlanCallback, ListTransformOptions, ListTransformReduce, LoadManyCallback, LoadManyInfo, LoadManyLoader, LoadOneCallback, LoadOneInfo, LoadOneLoader, Maybe, Multistep, NodeIdCodec, NodeIdHandler, ObjectFieldConfig, ObjectLikeStep, ObjectPlan, ObjectPlanMeta, ObjectTypeFields, ObjectTypeSpec, PaginationFeatures, PaginationParams, PlanTypeInfo, PromiseOrDirect, ScalarPlan, ScalarPlanResolver, SetterCapable, StepOptimizeOptions, StepRepresentingList, StepStreamOptions, Thunk, TypedEventEmitter, UnaryExecutionValue, UnbatchedExecutionExtra, UnionPlan, UnwrapMultistep, };
|
|
41
|
-
export { __FlagStep, __InputListStep, __InputObjectStep, __InputStaticLeafStep, __ItemStep, __ListTransformStep, __TrackedValueStep, __ValueStep, $$bypassGraphQL, $$eventEmitter, $$extensions, $$idempotent, $$inhibit, $$verbatim, access, AccessStep, applyInput, ApplyInputStep, applyTransforms, ApplyTransformsStep, arrayOfLength, arraysMatch, assertExecutableStep, assertListCapableStep, assertModifier, assertNotNull, assertStep, asyncIteratorWithCleanup, bakedInput, bakedInputRuntime, BakedInputStep, coalesce, CoalesceStep, condition, ConditionStep, connection, ConnectionStep, constant, ConstantStep, context, createObjectAndApplyChildren, currentFieldStreamDetails, debugPlans, DEFAULT_ACCEPT_FLAGS, defaultPlanResolver, each, EdgeStep, error, ErrorStep, Step as ExecutableStep, execute, exportAs, exportAsMany, filter, first, FirstStep, flagError, get, getEnumValueConfig, getEnumValueConfigs, getGrafastMiddleware, getNullableInputTypeAtPath, grafast, grafast as grafastGraphql, grafastSync as grafastGraphqlSync, grafastPrint, grafastSync, graphqlResolver, GraphQLResolverStep, GraphQLSpecifiedErrorBehaviors, groupBy, inhibitOnNull, inputObjectFieldSpec, inspect, isDev, isExecutableStep, isListCapableStep, isListLikeStep, isModifier, isObjectLikeStep, isPromiseLike, isSafeError, isStep, isUnaryStep, lambda, LambdaStep, last, LastStep, list, listen, ListenStep, ListStep, listTransform, LoadedRecordStep, loadMany, loadManyCallback, loadManyLoader, LoadManyStep, loadOne, loadOneCallback, loadOneLoader, LoadOneStep, makeDecodeNodeId, makeDecodeNodeIdRuntime, makeGrafastSchema, mapsMatch, maybeArraysMatch, Modifier, multistep, newGrafastFieldConfigBuilder, newInputObjectTypeBuilder, newObjectTypeBuilder, nodeIdFromNode, noop, object, objectFieldSpec, objectSpec, ObjectStep, OperationPlan, operationPlan, partitionByIndex, promiseWithResolve, proxy, ProxyStep, recordsMatch, remapKeys, RemapKeysStep, reverse, reverseArray, ReverseStep, rootValue, SafeError, setsMatch, Setter, setter, sideEffect, SideEffectStep, specFromNodeId, Step, stepADependsOnStepB, stepAMayDependOnStepB, stepAShouldTryAndInlineIntoStepB, stepsAreInSamePhase, stringifyPayload, stripAnsi, subscribe, trap, TRAP_ERROR, TRAP_ERROR_OR_INHIBITED, TRAP_INHIBITED, UnbatchedStep as UnbatchedExecutableStep, UnbatchedStep, };
|
|
41
|
+
export { __FlagStep, __InputListStep, __InputObjectStep, __InputStaticLeafStep, __ItemStep, __ListTransformStep, __TrackedValueStep, __ValueStep, $$bypassGraphQL, $$eventEmitter, $$extensions, $$idempotent, $$inhibit, $$verbatim, access, AccessStep, applyInput, ApplyInputStep, applyTransforms, ApplyTransformsStep, arrayOfLength, arraysMatch, assertExecutableStep, assertListCapableStep, assertModifier, assertNotNull, assertStep, asyncIteratorWithCleanup, bakedInput, bakedInputRuntime, BakedInputStep, coalesce, CoalesceStep, condition, ConditionStep, connection, ConnectionStep, constant, ConstantStep, context, createObjectAndApplyChildren, currentFieldStreamDetails, debugPlans, DEFAULT_ACCEPT_FLAGS, defaultPlanResolver, each, EdgeStep, error, ErrorStep, Step as ExecutableStep, execute, exportAs, exportAsMany, filter, first, FirstStep, flagError, get, getEnumValueConfig, getEnumValueConfigs, getGrafastMiddleware, getNullableInputTypeAtPath, grafast, grafast as grafastGraphql, grafastSync as grafastGraphqlSync, grafastPrint, grafastSync, graphqlResolver, GraphQLResolverStep, GraphQLSpecifiedErrorBehaviors, groupBy, inhibitOnNull, inputObjectFieldSpec, inspect, isDev, isExecutableStep, isListCapableStep, isListLikeStep, isModifier, isObjectLikeStep, isPromiseLike, isSafeError, isStep, isUnaryStep, lambda, LambdaStep, last, LastStep, list, listen, ListenStep, ListStep, listTransform, LoadedRecordStep, loadMany, loadManyCallback, loadManyLoader, LoadManyStep, loadOne, loadOneCallback, loadOneLoader, LoadOneStep, makeDecodeNodeId, makeDecodeNodeIdRuntime, makeGrafastSchema, mapsMatch, markSyncAndSafe, maybeArraysMatch, Modifier, multistep, newGrafastFieldConfigBuilder, newInputObjectTypeBuilder, newObjectTypeBuilder, nodeIdFromNode, noop, object, objectFieldSpec, objectSpec, ObjectStep, OperationPlan, operationPlan, partitionByIndex, promiseWithResolve, proxy, ProxyStep, recordsMatch, remapKeys, RemapKeysStep, reverse, reverseArray, ReverseStep, rootValue, SafeError, setsMatch, Setter, setter, sideEffect, SideEffectStep, specFromNodeId, Step, stepADependsOnStepB, stepAMayDependOnStepB, stepAShouldTryAndInlineIntoStepB, stepsAreInSamePhase, stringifyPayload, stripAnsi, subscribe, trap, TRAP_ERROR, TRAP_ERROR_OR_INHIBITED, TRAP_INHIBITED, UnbatchedStep as UnbatchedExecutableStep, UnbatchedStep, };
|
|
42
42
|
export type { PromiseWithResolve } from "./promiseWithResolve.ts";
|
|
43
43
|
export { hookArgs } from "./args.ts";
|
|
44
44
|
export { version } from "./version.ts";
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.each = exports.defaultPlanResolver = exports.DEFAULT_ACCEPT_FLAGS = exports.debugPlans = exports.currentFieldStreamDetails = exports.createObjectAndApplyChildren = exports.context = exports.ConstantStep = exports.constant = exports.ConnectionStep = exports.connection = exports.ConditionStep = exports.condition = exports.CoalesceStep = exports.coalesce = exports.BakedInputStep = exports.bakedInputRuntime = exports.bakedInput = exports.asyncIteratorWithCleanup = exports.assertStep = exports.assertNotNull = exports.assertModifier = exports.assertListCapableStep = exports.assertExecutableStep = exports.arraysMatch = exports.arrayOfLength = exports.ApplyTransformsStep = exports.applyTransforms = exports.ApplyInputStep = exports.applyInput = exports.AccessStep = exports.access = exports.$$verbatim = exports.$$inhibit = exports.$$idempotent = exports.$$extensions = exports.$$eventEmitter = exports.$$bypassGraphQL = exports.__ValueStep = exports.__TrackedValueStep = exports.__ListTransformStep = exports.__ItemStep = exports.__InputStaticLeafStep = exports.__InputObjectStep = exports.__InputListStep = exports.__FlagStep = exports.isAsyncIterable = exports.GraphQLStreamDirective = exports.graphqlHasStreamDefer = exports.GraphQLDeferDirective = void 0;
|
|
4
4
|
exports.loadManyCallback = exports.loadMany = exports.LoadedRecordStep = exports.listTransform = exports.ListStep = exports.ListenStep = exports.listen = exports.list = exports.LastStep = exports.last = exports.LambdaStep = exports.lambda = exports.isUnaryStep = exports.isStep = exports.isSafeError = exports.isPromiseLike = exports.isObjectLikeStep = exports.isModifier = exports.isListLikeStep = exports.isListCapableStep = exports.isExecutableStep = exports.isDev = exports.inspect = exports.inputObjectFieldSpec = exports.inhibitOnNull = exports.groupBy = exports.GraphQLSpecifiedErrorBehaviors = exports.GraphQLResolverStep = exports.graphqlResolver = exports.grafastSync = exports.grafastPrint = exports.grafastGraphqlSync = exports.grafastGraphql = exports.grafast = exports.getNullableInputTypeAtPath = exports.getGrafastMiddleware = exports.getEnumValueConfigs = exports.getEnumValueConfig = exports.get = exports.flagError = exports.FirstStep = exports.first = exports.filter = exports.exportAsMany = exports.exportAs = exports.execute = exports.ExecutableStep = exports.ErrorStep = exports.error = exports.EdgeStep = void 0;
|
|
5
|
-
exports.
|
|
6
|
-
exports.version = exports.hookArgs = exports.UnbatchedStep = exports.UnbatchedExecutableStep = exports.TRAP_INHIBITED = exports.TRAP_ERROR_OR_INHIBITED = exports.TRAP_ERROR = exports.trap = void 0;
|
|
5
|
+
exports.stripAnsi = exports.stringifyPayload = exports.stepsAreInSamePhase = exports.stepAShouldTryAndInlineIntoStepB = exports.stepAMayDependOnStepB = exports.stepADependsOnStepB = exports.Step = exports.specFromNodeId = exports.SideEffectStep = exports.sideEffect = exports.setter = exports.Setter = exports.setsMatch = exports.SafeError = exports.rootValue = exports.ReverseStep = exports.reverseArray = exports.reverse = exports.RemapKeysStep = exports.remapKeys = exports.recordsMatch = exports.ProxyStep = exports.proxy = exports.promiseWithResolve = exports.partitionByIndex = exports.operationPlan = exports.OperationPlan = exports.ObjectStep = exports.objectSpec = exports.objectFieldSpec = exports.object = exports.noop = exports.nodeIdFromNode = exports.newObjectTypeBuilder = exports.newInputObjectTypeBuilder = exports.newGrafastFieldConfigBuilder = exports.multistep = exports.Modifier = exports.maybeArraysMatch = exports.markSyncAndSafe = exports.mapsMatch = exports.makeGrafastSchema = exports.makeDecodeNodeIdRuntime = exports.makeDecodeNodeId = exports.LoadOneStep = exports.loadOneLoader = exports.loadOneCallback = exports.loadOne = exports.LoadManyStep = exports.loadManyLoader = void 0;
|
|
6
|
+
exports.version = exports.hookArgs = exports.UnbatchedStep = exports.UnbatchedExecutableStep = exports.TRAP_INHIBITED = exports.TRAP_ERROR_OR_INHIBITED = exports.TRAP_ERROR = exports.trap = exports.subscribe = void 0;
|
|
7
7
|
const tslib_1 = require("tslib");
|
|
8
8
|
require("./thereCanBeOnlyOne.js");
|
|
9
9
|
const debug_1 = tslib_1.__importDefault(require("debug"));
|
|
@@ -173,6 +173,7 @@ Object.defineProperty(exports, "GraphQLSpecifiedErrorBehaviors", { enumerable: t
|
|
|
173
173
|
Object.defineProperty(exports, "inputObjectFieldSpec", { enumerable: true, get: function () { return utils_ts_1.inputObjectFieldSpec; } });
|
|
174
174
|
Object.defineProperty(exports, "isPromiseLike", { enumerable: true, get: function () { return utils_ts_1.isPromiseLike; } });
|
|
175
175
|
Object.defineProperty(exports, "mapsMatch", { enumerable: true, get: function () { return utils_ts_1.mapsMatch; } });
|
|
176
|
+
Object.defineProperty(exports, "markSyncAndSafe", { enumerable: true, get: function () { return utils_ts_1.markSyncAndSafe; } });
|
|
176
177
|
Object.defineProperty(exports, "maybeArraysMatch", { enumerable: true, get: function () { return utils_ts_1.maybeArraysMatch; } });
|
|
177
178
|
Object.defineProperty(exports, "newGrafastFieldConfigBuilder", { enumerable: true, get: function () { return utils_ts_1.newGrafastFieldConfigBuilder; } });
|
|
178
179
|
Object.defineProperty(exports, "newInputObjectTypeBuilder", { enumerable: true, get: function () { return utils_ts_1.newInputObjectTypeBuilder; } });
|
|
@@ -208,7 +209,6 @@ Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: funct
|
|
|
208
209
|
stringifyPayload: stringifyPayload_ts_1.stringifyPayload,
|
|
209
210
|
__InputObjectStep: index_ts_1.__InputObjectStep,
|
|
210
211
|
__InputStaticLeafStep: index_ts_1.__InputStaticLeafStep,
|
|
211
|
-
assertExecutableStep: step_ts_1.assertExecutableStep,
|
|
212
212
|
assertStep: step_ts_1.assertStep,
|
|
213
213
|
assertListCapableStep: step_ts_1.assertListCapableStep,
|
|
214
214
|
assertModifier: index_ts_1.assertModifier,
|
|
@@ -305,6 +305,7 @@ Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: funct
|
|
|
305
305
|
stepADependsOnStepB: utils_ts_1.stepADependsOnStepB,
|
|
306
306
|
stepAMayDependOnStepB: utils_ts_1.stepAMayDependOnStepB,
|
|
307
307
|
stepsAreInSamePhase: utils_ts_1.stepsAreInSamePhase,
|
|
308
|
+
markSyncAndSafe: utils_ts_1.markSyncAndSafe,
|
|
308
309
|
asyncIteratorWithCleanup: utils_ts_1.asyncIteratorWithCleanup,
|
|
309
310
|
stepAShouldTryAndInlineIntoStepB: utils_ts_1.stepAShouldTryAndInlineIntoStepB,
|
|
310
311
|
isPromiseLike: utils_ts_1.isPromiseLike,
|
package/dist/step.d.ts
CHANGED
|
@@ -293,7 +293,7 @@ Step as ExecutableStep,
|
|
|
293
293
|
/** @deprecated Use UnbatchedStep instead */
|
|
294
294
|
UnbatchedStep as UnbatchedExecutableStep, };
|
|
295
295
|
/** @deprecated Use isStep instead */
|
|
296
|
-
export declare
|
|
297
|
-
/** @deprecated Use
|
|
296
|
+
export declare function isExecutableStep<TData = any>(step: unknown): step is Step<TData>;
|
|
297
|
+
/** @deprecated Use assertStep instead */
|
|
298
298
|
export declare function assertExecutableStep<TData>(step: unknown): asserts step is Step<TData>;
|
|
299
299
|
//# sourceMappingURL=step.d.ts.map
|
package/dist/step.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a, _b;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.UnbatchedExecutableStep = exports.ExecutableStep = exports.UnbatchedStep = exports.Step = exports.assertFinalized = exports.$$noExec = void 0;
|
|
5
5
|
exports.isStep = isStep;
|
|
6
6
|
exports.assertStep = assertStep;
|
|
7
7
|
exports.isUnbatchedStep = isUnbatchedStep;
|
|
@@ -11,6 +11,7 @@ exports.isListCapableStep = isListCapableStep;
|
|
|
11
11
|
exports.assertListCapableStep = assertListCapableStep;
|
|
12
12
|
exports.stepHasToSpecifier = stepHasToSpecifier;
|
|
13
13
|
exports.stepHasToRecord = stepHasToRecord;
|
|
14
|
+
exports.isExecutableStep = isExecutableStep;
|
|
14
15
|
exports.assertExecutableStep = assertExecutableStep;
|
|
15
16
|
const tslib_1 = require("tslib");
|
|
16
17
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
@@ -547,9 +548,11 @@ function stepHasToRecord($step) {
|
|
|
547
548
|
return typeof $step.toRecord === "function";
|
|
548
549
|
}
|
|
549
550
|
/** @deprecated Use isStep instead */
|
|
550
|
-
|
|
551
|
-
|
|
551
|
+
function isExecutableStep(step) {
|
|
552
|
+
return isStep(step);
|
|
553
|
+
}
|
|
554
|
+
/** @deprecated Use assertStep instead */
|
|
552
555
|
function assertExecutableStep(step) {
|
|
553
|
-
|
|
556
|
+
assertStep(step);
|
|
554
557
|
}
|
|
555
558
|
//# sourceMappingURL=step.js.map
|
|
@@ -171,7 +171,7 @@ function executeLoad(details, sharedDepId, paramDepIdByKey, baseLoadInfo, load)
|
|
|
171
171
|
(0, exports.nextTick)(() => {
|
|
172
172
|
// Don't allow adding anything else to the batch
|
|
173
173
|
meta.loadBatchesByLoad.delete(load);
|
|
174
|
-
executeBatches(loadBatches, loadInfo, load);
|
|
174
|
+
void executeBatches(loadBatches, loadInfo, load);
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
return (async () => {
|
|
@@ -66,10 +66,10 @@ class GraphQLResolverStep extends step_ts_1.UnbatchedStep {
|
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
68
|
if (this.isNotRoot) {
|
|
69
|
-
return
|
|
69
|
+
return (0, index_ts_1.flagError)(new Error(`Invalid non-root subscribe`));
|
|
70
70
|
}
|
|
71
71
|
if (this.subscriber == null) {
|
|
72
|
-
return
|
|
72
|
+
return (0, index_ts_1.flagError)(new Error(`Cannot subscribe to field`));
|
|
73
73
|
}
|
|
74
74
|
const resolveInfo = Object.assign(Object.create(this.resolveInfoBase), {
|
|
75
75
|
// ENHANCE: add support for path
|
|
@@ -119,6 +119,8 @@ class GraphQLResolveTypeStep extends step_ts_1.Step {
|
|
|
119
119
|
* resolution part.
|
|
120
120
|
*/
|
|
121
121
|
figureOutTheTypeOf(data, context, resolveInfo) {
|
|
122
|
+
if (data == null)
|
|
123
|
+
return data;
|
|
122
124
|
const abstractType = this.abstractType;
|
|
123
125
|
if (abstractType.resolveType != null) {
|
|
124
126
|
return abstractType.resolveType(data, context, resolveInfo, abstractType);
|
package/dist/steps/listen.js
CHANGED
|
@@ -22,7 +22,7 @@ class ListenStep extends step_ts_1.Step {
|
|
|
22
22
|
this.initialEventDep = null;
|
|
23
23
|
this.itemPlan = itemPlan;
|
|
24
24
|
const $topic = typeof topicOrPlan === "string" ? (0, constant_ts_1.constant)(topicOrPlan) : topicOrPlan;
|
|
25
|
-
const $pubsub = (0, step_ts_1.
|
|
25
|
+
const $pubsub = (0, step_ts_1.isStep)(pubsubOrPlan)
|
|
26
26
|
? pubsubOrPlan
|
|
27
27
|
: (0, constant_ts_1.constant)(pubsubOrPlan, false);
|
|
28
28
|
this.pubsubDep = this.addDependency($pubsub);
|
package/dist/steps/node.d.ts
CHANGED
|
@@ -14,12 +14,9 @@ import type { Step } from "../step.ts";
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function specFromNodeId<THandler extends NodeIdHandler<any> = NodeIdHandler<any>>(handler: THandler, $id: Step<Maybe<string>>): ReturnType<THandler["getSpec"]>;
|
|
16
16
|
export declare function nodeIdFromNode(handler: NodeIdHandler<any>, $node: Step): import("./lambda.ts").LambdaStep<any, string | null>;
|
|
17
|
-
export declare function makeDecodeNodeIdRuntime(handlers: readonly NodeIdHandler[]): {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} | null;
|
|
21
|
-
isSyncAndSafe: boolean;
|
|
22
|
-
};
|
|
17
|
+
export declare function makeDecodeNodeIdRuntime(handlers: readonly NodeIdHandler[]): (raw: string | null | undefined) => {
|
|
18
|
+
[codecName: string]: any;
|
|
19
|
+
} | null;
|
|
23
20
|
export declare function makeDecodeNodeId(handlers: readonly NodeIdHandler[]): ($id: Step<string | null | undefined>) => import("./lambda.ts").LambdaStep<string | null | undefined, {
|
|
24
21
|
[codecName: string]: any;
|
|
25
22
|
} | null>;
|
package/dist/steps/node.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.specFromNodeId = specFromNodeId;
|
|
|
4
4
|
exports.nodeIdFromNode = nodeIdFromNode;
|
|
5
5
|
exports.makeDecodeNodeIdRuntime = makeDecodeNodeIdRuntime;
|
|
6
6
|
exports.makeDecodeNodeId = makeDecodeNodeId;
|
|
7
|
+
const utils_ts_1 = require("../utils.js");
|
|
7
8
|
const constant_ts_1 = require("./constant.js");
|
|
8
9
|
const lambda_ts_1 = require("./lambda.js");
|
|
9
10
|
/**
|
|
@@ -37,14 +38,14 @@ function decodeNodeIdWithHandler(details) {
|
|
|
37
38
|
return null;
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
decodeNodeIdWithHandler
|
|
41
|
+
(0, utils_ts_1.markSyncAndSafe)(decodeNodeIdWithHandler);
|
|
41
42
|
function nodeIdFromNode(handler, $node) {
|
|
42
43
|
const specifier = handler.plan($node);
|
|
43
44
|
return (0, lambda_ts_1.lambda)(specifier, handler.codec.encode);
|
|
44
45
|
}
|
|
45
46
|
function makeDecodeNodeIdRuntime(handlers) {
|
|
46
47
|
const codecs = [...new Set(handlers.map((h) => h.codec))];
|
|
47
|
-
function decodeNodeIdWithCodecs(raw) {
|
|
48
|
+
return (0, utils_ts_1.markSyncAndSafe)(function decodeNodeIdWithCodecs(raw) {
|
|
48
49
|
if (raw == null)
|
|
49
50
|
return null;
|
|
50
51
|
return codecs.reduce((memo, codec) => {
|
|
@@ -56,9 +57,7 @@ function makeDecodeNodeIdRuntime(handlers) {
|
|
|
56
57
|
}
|
|
57
58
|
return memo;
|
|
58
59
|
}, { raw });
|
|
59
|
-
}
|
|
60
|
-
decodeNodeIdWithCodecs.isSyncAndSafe = true; // Optimization
|
|
61
|
-
return decodeNodeIdWithCodecs;
|
|
60
|
+
});
|
|
62
61
|
}
|
|
63
62
|
function makeDecodeNodeId(handlers) {
|
|
64
63
|
const decodeNodeIdWithCodecs = makeDecodeNodeIdRuntime(handlers);
|
package/dist/utils.d.ts
CHANGED
|
@@ -203,5 +203,8 @@ export declare const sleep: (ms: number) => Promise<unknown>;
|
|
|
203
203
|
export declare function asyncIteratorWithCleanup<T>(iterable: AsyncIterable<T, void, never>, callback: (error?: unknown) => void): AsyncGenerator<T, void, never> & AsyncIteratorObject<T, void, never>;
|
|
204
204
|
export declare function terminateIterable(iterable: readonly any[] | Iterable<any> | AsyncIterable<any>): void;
|
|
205
205
|
export declare const GraphQLSpecifiedErrorBehaviors: readonly ["PROPAGATE", "NULL", "HALT"];
|
|
206
|
+
export declare function markSyncAndSafe<T extends ((...args: any) => any) & {
|
|
207
|
+
displayName?: string;
|
|
208
|
+
}>(fn: T, displayName?: string): T;
|
|
206
209
|
export {};
|
|
207
210
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.js
CHANGED
|
@@ -44,6 +44,7 @@ exports.stableStringSort = stableStringSort;
|
|
|
44
44
|
exports.stableStringSortFirstTupleEntry = stableStringSortFirstTupleEntry;
|
|
45
45
|
exports.asyncIteratorWithCleanup = asyncIteratorWithCleanup;
|
|
46
46
|
exports.terminateIterable = terminateIterable;
|
|
47
|
+
exports.markSyncAndSafe = markSyncAndSafe;
|
|
47
48
|
const tslib_1 = require("tslib");
|
|
48
49
|
const graphql = tslib_1.__importStar(require("graphql"));
|
|
49
50
|
const assert = tslib_1.__importStar(require("./assert.js"));
|
|
@@ -1147,4 +1148,14 @@ exports.GraphQLSpecifiedErrorBehaviors = Object.freeze([
|
|
|
1147
1148
|
"NULL",
|
|
1148
1149
|
"HALT",
|
|
1149
1150
|
]);
|
|
1151
|
+
const IS_SYNC_AND_SAFE = Object.freeze({
|
|
1152
|
+
isSyncAndSafe: true,
|
|
1153
|
+
});
|
|
1154
|
+
function markSyncAndSafe(fn, displayName) {
|
|
1155
|
+
Object.assign(fn, IS_SYNC_AND_SAFE);
|
|
1156
|
+
if (displayName) {
|
|
1157
|
+
fn.displayName = displayName;
|
|
1158
|
+
}
|
|
1159
|
+
return fn;
|
|
1160
|
+
}
|
|
1150
1161
|
//# sourceMappingURL=utils.js.map
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.0.0-rc.
|
|
1
|
+
export declare const version = "1.0.0-rc.8";
|
|
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": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.8",
|
|
4
4
|
"description": "Cutting edge GraphQL planning and execution engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"chalk": "^4.1.2",
|
|
60
60
|
"debug": "^4.4.3",
|
|
61
61
|
"eventemitter3": "^5.0.1",
|
|
62
|
-
"graphile-config": "^1.0.0-rc.
|
|
62
|
+
"graphile-config": "^1.0.0-rc.5",
|
|
63
63
|
"graphql": "^16.9.0",
|
|
64
64
|
"iterall": "^1.3.0",
|
|
65
65
|
"tslib": "^2.8.1"
|