@graphitation/supermassive 3.9.0 → 3.10.0
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/.eslintcache +1 -1
- package/CHANGELOG.md +10 -2
- package/lib/__testUtils__/execute.js +77 -121
- package/lib/__testUtils__/execute.js.map +1 -1
- package/lib/__testUtils__/execute.mjs +77 -124
- package/lib/__testUtils__/execute.mjs.map +1 -1
- package/lib/benchmarks/index.js +41 -63
- package/lib/benchmarks/index.js.map +1 -1
- package/lib/benchmarks/index.mjs +152 -184
- package/lib/benchmarks/index.mjs.map +1 -1
- package/lib/benchmarks/nice-benchmark.js +3 -23
- package/lib/benchmarks/nice-benchmark.js.map +1 -1
- package/lib/benchmarks/nice-benchmark.mjs +3 -24
- package/lib/benchmarks/nice-benchmark.mjs.map +1 -1
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.js +78 -68
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.js.map +1 -1
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.mjs +78 -71
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.mjs.map +1 -1
- package/lib/benchmarks/swapi-schema/resolvers.js +31 -71
- package/lib/benchmarks/swapi-schema/resolvers.js.map +1 -1
- package/lib/benchmarks/swapi-schema/resolvers.mjs +31 -74
- package/lib/benchmarks/swapi-schema/resolvers.mjs.map +1 -1
- package/lib/executeWithoutSchema.js +199 -248
- package/lib/executeWithoutSchema.js.map +1 -1
- package/lib/executeWithoutSchema.mjs +199 -251
- package/lib/executeWithoutSchema.mjs.map +1 -1
- package/lib/legacyAST/addTypesToRequestDocument.js +6 -21
- package/lib/legacyAST/addTypesToRequestDocument.js.map +1 -1
- package/lib/legacyAST/addTypesToRequestDocument.mjs +6 -24
- package/lib/legacyAST/addTypesToRequestDocument.mjs.map +1 -1
- package/lib/utilities/addMinimalViableSchemaToRequestDocument.js +9 -23
- package/lib/utilities/addMinimalViableSchemaToRequestDocument.js.map +1 -1
- package/lib/utilities/addMinimalViableSchemaToRequestDocument.mjs +9 -26
- package/lib/utilities/addMinimalViableSchemaToRequestDocument.mjs.map +1 -1
- package/lib/utilities/mapAsyncIterator.js +19 -47
- package/lib/utilities/mapAsyncIterator.js.map +1 -1
- package/lib/utilities/mapAsyncIterator.mjs +19 -48
- package/lib/utilities/mapAsyncIterator.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
10
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
8
|
var __export = (target, all) => {
|
|
26
9
|
for (var name in all)
|
|
27
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -43,26 +26,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
43
26
|
mod
|
|
44
27
|
));
|
|
45
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
46
|
-
var __async = (__this, __arguments, generator) => {
|
|
47
|
-
return new Promise((resolve, reject) => {
|
|
48
|
-
var fulfilled = (value) => {
|
|
49
|
-
try {
|
|
50
|
-
step(generator.next(value));
|
|
51
|
-
} catch (e) {
|
|
52
|
-
reject(e);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
var rejected = (value) => {
|
|
56
|
-
try {
|
|
57
|
-
step(generator.throw(value));
|
|
58
|
-
} catch (e) {
|
|
59
|
-
reject(e);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
63
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
29
|
var executeWithoutSchema_exports = {};
|
|
67
30
|
__export(executeWithoutSchema_exports, {
|
|
68
31
|
assertValidExecutionArguments: () => assertValidExecutionArguments,
|
|
@@ -190,12 +153,13 @@ function buildExecutionContext(args) {
|
|
|
190
153
|
};
|
|
191
154
|
}
|
|
192
155
|
function buildPerEventExecutionContext(exeContext, payload) {
|
|
193
|
-
return
|
|
156
|
+
return {
|
|
157
|
+
...exeContext,
|
|
194
158
|
contextValue: exeContext.buildContextValue ? exeContext.buildContextValue(exeContext.contextValue) : exeContext.contextValue,
|
|
195
159
|
rootValue: payload,
|
|
196
160
|
subsequentPayloads: /* @__PURE__ */ new Set(),
|
|
197
161
|
errors: []
|
|
198
|
-
}
|
|
162
|
+
};
|
|
199
163
|
}
|
|
200
164
|
function executeOperationWithBeforeHook(exeContext) {
|
|
201
165
|
const hooks = exeContext.fieldExecutionHooks;
|
|
@@ -298,9 +262,10 @@ function buildResponse(exeContext, data) {
|
|
|
298
262
|
const initialResult = exeContext.errors.length === 0 ? { data } : { errors: exeContext.errors, data };
|
|
299
263
|
if (exeContext.subsequentPayloads.size > 0) {
|
|
300
264
|
return {
|
|
301
|
-
initialResult:
|
|
265
|
+
initialResult: {
|
|
266
|
+
...initialResult,
|
|
302
267
|
hasNext: true
|
|
303
|
-
}
|
|
268
|
+
},
|
|
304
269
|
subsequentResults: yieldSubsequentPayloads(exeContext)
|
|
305
270
|
};
|
|
306
271
|
} else {
|
|
@@ -915,36 +880,34 @@ function completeValue(exeContext, returnTypeRef, fieldGroup, info, path, result
|
|
|
915
880
|
"Cannot complete value of unexpected output type: " + (0, import_reference.inspectTypeReference)(returnTypeRef)
|
|
916
881
|
);
|
|
917
882
|
}
|
|
918
|
-
function completePromisedValue(exeContext, returnTypeRef, fieldGroup, info, path, result, incrementalDataRecord) {
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
completed = yield completed;
|
|
933
|
-
}
|
|
934
|
-
return completed;
|
|
935
|
-
} catch (rawError) {
|
|
936
|
-
handleFieldError(
|
|
937
|
-
rawError,
|
|
938
|
-
exeContext,
|
|
939
|
-
returnTypeRef,
|
|
940
|
-
fieldGroup,
|
|
941
|
-
path,
|
|
942
|
-
incrementalDataRecord
|
|
943
|
-
);
|
|
944
|
-
filterSubsequentPayloads(exeContext, path, incrementalDataRecord);
|
|
945
|
-
return null;
|
|
883
|
+
async function completePromisedValue(exeContext, returnTypeRef, fieldGroup, info, path, result, incrementalDataRecord) {
|
|
884
|
+
try {
|
|
885
|
+
const resolved = await result;
|
|
886
|
+
let completed = completeValue(
|
|
887
|
+
exeContext,
|
|
888
|
+
returnTypeRef,
|
|
889
|
+
fieldGroup,
|
|
890
|
+
info,
|
|
891
|
+
path,
|
|
892
|
+
resolved,
|
|
893
|
+
incrementalDataRecord
|
|
894
|
+
);
|
|
895
|
+
if ((0, import_isPromise.isPromise)(completed)) {
|
|
896
|
+
completed = await completed;
|
|
946
897
|
}
|
|
947
|
-
|
|
898
|
+
return completed;
|
|
899
|
+
} catch (rawError) {
|
|
900
|
+
handleFieldError(
|
|
901
|
+
rawError,
|
|
902
|
+
exeContext,
|
|
903
|
+
returnTypeRef,
|
|
904
|
+
fieldGroup,
|
|
905
|
+
path,
|
|
906
|
+
incrementalDataRecord
|
|
907
|
+
);
|
|
908
|
+
filterSubsequentPayloads(exeContext, path, incrementalDataRecord);
|
|
909
|
+
return null;
|
|
910
|
+
}
|
|
948
911
|
}
|
|
949
912
|
function completeListValue(exeContext, returnTypeRef, fieldGroup, info, path, result, incrementalDataRecord) {
|
|
950
913
|
const itemTypeRef = (0, import_reference.unwrap)(returnTypeRef);
|
|
@@ -1093,53 +1056,51 @@ function getStreamValues(exeContext, fieldGroup, path) {
|
|
|
1093
1056
|
label: typeof stream.label === "string" ? stream.label : void 0
|
|
1094
1057
|
};
|
|
1095
1058
|
}
|
|
1096
|
-
function completeAsyncIteratorValue(exeContext, itemTypeRef, fieldGroup, info, path, asyncIterator, incrementalDataRecord) {
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
asyncIterator,
|
|
1107
|
-
exeContext,
|
|
1108
|
-
fieldGroup,
|
|
1109
|
-
info,
|
|
1110
|
-
itemTypeRef,
|
|
1111
|
-
path,
|
|
1112
|
-
stream.label,
|
|
1113
|
-
incrementalDataRecord
|
|
1114
|
-
);
|
|
1115
|
-
break;
|
|
1116
|
-
}
|
|
1117
|
-
const itemPath = (0, import_Path.addPath)(path, index, void 0);
|
|
1118
|
-
let iteration;
|
|
1119
|
-
try {
|
|
1120
|
-
iteration = yield asyncIterator.next();
|
|
1121
|
-
if (iteration.done) {
|
|
1122
|
-
break;
|
|
1123
|
-
}
|
|
1124
|
-
} catch (rawError) {
|
|
1125
|
-
throw (0, import_graphql.locatedError)(rawError, fieldGroup, (0, import_Path.pathToArray)(path));
|
|
1126
|
-
}
|
|
1127
|
-
if (completeListItemValue(
|
|
1128
|
-
iteration.value,
|
|
1129
|
-
completedResults,
|
|
1059
|
+
async function completeAsyncIteratorValue(exeContext, itemTypeRef, fieldGroup, info, path, asyncIterator, incrementalDataRecord) {
|
|
1060
|
+
const stream = getStreamValues(exeContext, fieldGroup, path);
|
|
1061
|
+
let containsPromise = false;
|
|
1062
|
+
const completedResults = [];
|
|
1063
|
+
let index = 0;
|
|
1064
|
+
while (true) {
|
|
1065
|
+
if (stream && typeof stream.initialCount === "number" && index >= stream.initialCount) {
|
|
1066
|
+
executeStreamAsyncIterator(
|
|
1067
|
+
index,
|
|
1068
|
+
asyncIterator,
|
|
1130
1069
|
exeContext,
|
|
1131
|
-
itemTypeRef,
|
|
1132
1070
|
fieldGroup,
|
|
1133
1071
|
info,
|
|
1134
|
-
|
|
1072
|
+
itemTypeRef,
|
|
1073
|
+
path,
|
|
1074
|
+
stream.label,
|
|
1135
1075
|
incrementalDataRecord
|
|
1136
|
-
)
|
|
1137
|
-
|
|
1076
|
+
);
|
|
1077
|
+
break;
|
|
1078
|
+
}
|
|
1079
|
+
const itemPath = (0, import_Path.addPath)(path, index, void 0);
|
|
1080
|
+
let iteration;
|
|
1081
|
+
try {
|
|
1082
|
+
iteration = await asyncIterator.next();
|
|
1083
|
+
if (iteration.done) {
|
|
1084
|
+
break;
|
|
1138
1085
|
}
|
|
1139
|
-
|
|
1086
|
+
} catch (rawError) {
|
|
1087
|
+
throw (0, import_graphql.locatedError)(rawError, fieldGroup, (0, import_Path.pathToArray)(path));
|
|
1140
1088
|
}
|
|
1141
|
-
|
|
1142
|
-
|
|
1089
|
+
if (completeListItemValue(
|
|
1090
|
+
iteration.value,
|
|
1091
|
+
completedResults,
|
|
1092
|
+
exeContext,
|
|
1093
|
+
itemTypeRef,
|
|
1094
|
+
fieldGroup,
|
|
1095
|
+
info,
|
|
1096
|
+
itemPath,
|
|
1097
|
+
incrementalDataRecord
|
|
1098
|
+
)) {
|
|
1099
|
+
containsPromise = true;
|
|
1100
|
+
}
|
|
1101
|
+
index += 1;
|
|
1102
|
+
}
|
|
1103
|
+
return containsPromise ? Promise.all(completedResults) : completedResults;
|
|
1143
1104
|
}
|
|
1144
1105
|
function completeLeafValue(returnType, result) {
|
|
1145
1106
|
const serializedResult = returnType.serialize(result);
|
|
@@ -1749,116 +1710,112 @@ function executeStreamField(path, itemPath, item, exeContext, fieldGroup, info,
|
|
|
1749
1710
|
incrementalDataRecord.addItems([completedItem]);
|
|
1750
1711
|
return incrementalDataRecord;
|
|
1751
1712
|
}
|
|
1752
|
-
function executeStreamAsyncIteratorItem(asyncIterator, exeContext, fieldGroup, info, itemTypeRef, incrementalDataRecord, path, itemPath) {
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
return { done, value: void 0 };
|
|
1760
|
-
}
|
|
1761
|
-
item = value;
|
|
1762
|
-
} catch (rawError) {
|
|
1763
|
-
throw (0, import_graphql.locatedError)(rawError, fieldGroup, (0, import_Path.pathToArray)(path));
|
|
1713
|
+
async function executeStreamAsyncIteratorItem(asyncIterator, exeContext, fieldGroup, info, itemTypeRef, incrementalDataRecord, path, itemPath) {
|
|
1714
|
+
let item;
|
|
1715
|
+
try {
|
|
1716
|
+
const { value, done } = await asyncIterator.next();
|
|
1717
|
+
if (done) {
|
|
1718
|
+
incrementalDataRecord.setIsCompletedAsyncIterator();
|
|
1719
|
+
return { done, value: void 0 };
|
|
1764
1720
|
}
|
|
1765
|
-
|
|
1721
|
+
item = value;
|
|
1722
|
+
} catch (rawError) {
|
|
1723
|
+
throw (0, import_graphql.locatedError)(rawError, fieldGroup, (0, import_Path.pathToArray)(path));
|
|
1724
|
+
}
|
|
1725
|
+
let completedItem;
|
|
1726
|
+
try {
|
|
1727
|
+
completedItem = completeValue(
|
|
1728
|
+
exeContext,
|
|
1729
|
+
itemTypeRef,
|
|
1730
|
+
fieldGroup,
|
|
1731
|
+
info,
|
|
1732
|
+
itemPath,
|
|
1733
|
+
item,
|
|
1734
|
+
incrementalDataRecord
|
|
1735
|
+
);
|
|
1736
|
+
if ((0, import_isPromise.isPromise)(completedItem)) {
|
|
1737
|
+
completedItem = completedItem.then(void 0, (rawError) => {
|
|
1738
|
+
handleFieldError(
|
|
1739
|
+
rawError,
|
|
1740
|
+
exeContext,
|
|
1741
|
+
itemTypeRef,
|
|
1742
|
+
fieldGroup,
|
|
1743
|
+
itemPath,
|
|
1744
|
+
incrementalDataRecord
|
|
1745
|
+
);
|
|
1746
|
+
filterSubsequentPayloads(exeContext, itemPath, incrementalDataRecord);
|
|
1747
|
+
return null;
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
return { done: false, value: completedItem };
|
|
1751
|
+
} catch (rawError) {
|
|
1752
|
+
handleFieldError(
|
|
1753
|
+
rawError,
|
|
1754
|
+
exeContext,
|
|
1755
|
+
itemTypeRef,
|
|
1756
|
+
fieldGroup,
|
|
1757
|
+
itemPath,
|
|
1758
|
+
incrementalDataRecord
|
|
1759
|
+
);
|
|
1760
|
+
filterSubsequentPayloads(exeContext, itemPath, incrementalDataRecord);
|
|
1761
|
+
return { done: false, value: null };
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
async function executeStreamAsyncIterator(initialIndex, asyncIterator, exeContext, fieldGroup, info, itemTypeRef, path, label, parentContext) {
|
|
1765
|
+
let index = initialIndex;
|
|
1766
|
+
let previousIncrementalDataRecord = parentContext != null ? parentContext : void 0;
|
|
1767
|
+
while (true) {
|
|
1768
|
+
const itemPath = (0, import_Path.addPath)(path, index, void 0);
|
|
1769
|
+
const incrementalDataRecord = new StreamItemsRecord({
|
|
1770
|
+
label,
|
|
1771
|
+
path: itemPath,
|
|
1772
|
+
parentContext: previousIncrementalDataRecord,
|
|
1773
|
+
asyncIterator,
|
|
1774
|
+
exeContext
|
|
1775
|
+
});
|
|
1776
|
+
let iteration;
|
|
1766
1777
|
try {
|
|
1767
|
-
|
|
1778
|
+
iteration = await executeStreamAsyncIteratorItem(
|
|
1779
|
+
asyncIterator,
|
|
1768
1780
|
exeContext,
|
|
1769
|
-
itemTypeRef,
|
|
1770
1781
|
fieldGroup,
|
|
1771
1782
|
info,
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1783
|
+
itemTypeRef,
|
|
1784
|
+
incrementalDataRecord,
|
|
1785
|
+
path,
|
|
1786
|
+
itemPath
|
|
1775
1787
|
);
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
fieldGroup,
|
|
1783
|
-
itemPath,
|
|
1784
|
-
incrementalDataRecord
|
|
1785
|
-
);
|
|
1786
|
-
filterSubsequentPayloads(exeContext, itemPath, incrementalDataRecord);
|
|
1787
|
-
return null;
|
|
1788
|
+
} catch (error) {
|
|
1789
|
+
incrementalDataRecord.errors.push(error);
|
|
1790
|
+
filterSubsequentPayloads(exeContext, path, incrementalDataRecord);
|
|
1791
|
+
incrementalDataRecord.addItems(null);
|
|
1792
|
+
if (asyncIterator == null ? void 0 : asyncIterator.return) {
|
|
1793
|
+
asyncIterator.return().catch(() => {
|
|
1788
1794
|
});
|
|
1789
1795
|
}
|
|
1790
|
-
return
|
|
1791
|
-
} catch (rawError) {
|
|
1792
|
-
handleFieldError(
|
|
1793
|
-
rawError,
|
|
1794
|
-
exeContext,
|
|
1795
|
-
itemTypeRef,
|
|
1796
|
-
fieldGroup,
|
|
1797
|
-
itemPath,
|
|
1798
|
-
incrementalDataRecord
|
|
1799
|
-
);
|
|
1800
|
-
filterSubsequentPayloads(exeContext, itemPath, incrementalDataRecord);
|
|
1801
|
-
return { done: false, value: null };
|
|
1796
|
+
return;
|
|
1802
1797
|
}
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
label,
|
|
1813
|
-
path: itemPath,
|
|
1814
|
-
parentContext: previousIncrementalDataRecord,
|
|
1815
|
-
asyncIterator,
|
|
1816
|
-
exeContext
|
|
1817
|
-
});
|
|
1818
|
-
let iteration;
|
|
1819
|
-
try {
|
|
1820
|
-
iteration = yield executeStreamAsyncIteratorItem(
|
|
1821
|
-
asyncIterator,
|
|
1822
|
-
exeContext,
|
|
1823
|
-
fieldGroup,
|
|
1824
|
-
info,
|
|
1825
|
-
itemTypeRef,
|
|
1826
|
-
incrementalDataRecord,
|
|
1827
|
-
path,
|
|
1828
|
-
itemPath
|
|
1829
|
-
);
|
|
1830
|
-
} catch (error) {
|
|
1831
|
-
incrementalDataRecord.errors.push(error);
|
|
1832
|
-
filterSubsequentPayloads(exeContext, path, incrementalDataRecord);
|
|
1833
|
-
incrementalDataRecord.addItems(null);
|
|
1834
|
-
if (asyncIterator == null ? void 0 : asyncIterator.return) {
|
|
1835
|
-
asyncIterator.return().catch(() => {
|
|
1836
|
-
});
|
|
1798
|
+
const { done, value: completedItem } = iteration;
|
|
1799
|
+
let completedItems;
|
|
1800
|
+
if ((0, import_isPromise.isPromise)(completedItem)) {
|
|
1801
|
+
completedItems = completedItem.then(
|
|
1802
|
+
(value) => [value],
|
|
1803
|
+
(error) => {
|
|
1804
|
+
incrementalDataRecord.errors.push(error);
|
|
1805
|
+
filterSubsequentPayloads(exeContext, path, incrementalDataRecord);
|
|
1806
|
+
return null;
|
|
1837
1807
|
}
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
let completedItems;
|
|
1842
|
-
if ((0, import_isPromise.isPromise)(completedItem)) {
|
|
1843
|
-
completedItems = completedItem.then(
|
|
1844
|
-
(value) => [value],
|
|
1845
|
-
(error) => {
|
|
1846
|
-
incrementalDataRecord.errors.push(error);
|
|
1847
|
-
filterSubsequentPayloads(exeContext, path, incrementalDataRecord);
|
|
1848
|
-
return null;
|
|
1849
|
-
}
|
|
1850
|
-
);
|
|
1851
|
-
} else {
|
|
1852
|
-
completedItems = [completedItem];
|
|
1853
|
-
}
|
|
1854
|
-
incrementalDataRecord.addItems(completedItems);
|
|
1855
|
-
if (done) {
|
|
1856
|
-
break;
|
|
1857
|
-
}
|
|
1858
|
-
previousIncrementalDataRecord = incrementalDataRecord;
|
|
1859
|
-
index++;
|
|
1808
|
+
);
|
|
1809
|
+
} else {
|
|
1810
|
+
completedItems = [completedItem];
|
|
1860
1811
|
}
|
|
1861
|
-
|
|
1812
|
+
incrementalDataRecord.addItems(completedItems);
|
|
1813
|
+
if (done) {
|
|
1814
|
+
break;
|
|
1815
|
+
}
|
|
1816
|
+
previousIncrementalDataRecord = incrementalDataRecord;
|
|
1817
|
+
index++;
|
|
1818
|
+
}
|
|
1862
1819
|
}
|
|
1863
1820
|
function filterSubsequentPayloads(exeContext, nullPath, currentIncrementalDataRecord) {
|
|
1864
1821
|
const nullPathArray = (0, import_Path.pathToArray)(nullPath);
|
|
@@ -1910,36 +1867,34 @@ function getCompletedIncrementalResults(exeContext) {
|
|
|
1910
1867
|
}
|
|
1911
1868
|
function yieldSubsequentPayloads(exeContext) {
|
|
1912
1869
|
let isDone = false;
|
|
1913
|
-
function next() {
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
};
|
|
1936
|
-
});
|
|
1870
|
+
async function next() {
|
|
1871
|
+
if (isDone) {
|
|
1872
|
+
return { value: void 0, done: true };
|
|
1873
|
+
}
|
|
1874
|
+
await Promise.race(
|
|
1875
|
+
Array.from(exeContext.subsequentPayloads).map((p) => p.promise)
|
|
1876
|
+
);
|
|
1877
|
+
if (isDone) {
|
|
1878
|
+
return { value: void 0, done: true };
|
|
1879
|
+
}
|
|
1880
|
+
const incremental = getCompletedIncrementalResults(exeContext);
|
|
1881
|
+
const hasNext = exeContext.subsequentPayloads.size > 0;
|
|
1882
|
+
if (!incremental.length && hasNext) {
|
|
1883
|
+
return next();
|
|
1884
|
+
}
|
|
1885
|
+
if (!hasNext) {
|
|
1886
|
+
isDone = true;
|
|
1887
|
+
}
|
|
1888
|
+
return {
|
|
1889
|
+
value: incremental.length ? { incremental, hasNext } : { hasNext },
|
|
1890
|
+
done: false
|
|
1891
|
+
};
|
|
1937
1892
|
}
|
|
1938
1893
|
function returnStreamIterators() {
|
|
1939
1894
|
const promises = [];
|
|
1940
1895
|
exeContext.subsequentPayloads.forEach((incrementalDataRecord) => {
|
|
1941
|
-
var
|
|
1942
|
-
if (isStreamItemsRecord(incrementalDataRecord) && ((
|
|
1896
|
+
var _a;
|
|
1897
|
+
if (isStreamItemsRecord(incrementalDataRecord) && ((_a = incrementalDataRecord.asyncIterator) == null ? void 0 : _a.return)) {
|
|
1943
1898
|
promises.push(incrementalDataRecord.asyncIterator.return());
|
|
1944
1899
|
}
|
|
1945
1900
|
});
|
|
@@ -1950,19 +1905,15 @@ function yieldSubsequentPayloads(exeContext) {
|
|
|
1950
1905
|
return this;
|
|
1951
1906
|
},
|
|
1952
1907
|
next,
|
|
1953
|
-
return() {
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
return { value: void 0, done: true };
|
|
1958
|
-
});
|
|
1908
|
+
async return() {
|
|
1909
|
+
await returnStreamIterators();
|
|
1910
|
+
isDone = true;
|
|
1911
|
+
return { value: void 0, done: true };
|
|
1959
1912
|
},
|
|
1960
|
-
throw(error) {
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
return Promise.reject(error);
|
|
1965
|
-
});
|
|
1913
|
+
async throw(error) {
|
|
1914
|
+
await returnStreamIterators();
|
|
1915
|
+
isDone = true;
|
|
1916
|
+
return Promise.reject(error);
|
|
1966
1917
|
}
|
|
1967
1918
|
};
|
|
1968
1919
|
}
|