@soda-gql/core 0.0.9 → 0.2.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.
Files changed (56) hide show
  1. package/README.md +247 -0
  2. package/dist/adapter.cjs +35 -0
  3. package/dist/adapter.cjs.map +1 -0
  4. package/dist/adapter.d.cts +35 -0
  5. package/dist/adapter.d.cts.map +1 -0
  6. package/dist/adapter.d.ts +35 -0
  7. package/dist/adapter.d.ts.map +1 -0
  8. package/dist/adapter.js +34 -0
  9. package/dist/adapter.js.map +1 -0
  10. package/dist/index-B-erotAZ.d.cts +657 -0
  11. package/dist/index-B-erotAZ.d.cts.map +1 -0
  12. package/dist/index-Djr9A4KL.d.ts +657 -0
  13. package/dist/index-Djr9A4KL.d.ts.map +1 -0
  14. package/dist/index.cjs +450 -348
  15. package/dist/index.cjs.map +1 -0
  16. package/dist/index.d.cts +88 -2
  17. package/dist/index.d.cts.map +1 -0
  18. package/dist/index.d.ts +88 -2
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +420 -323
  21. package/dist/index.js.map +1 -1
  22. package/dist/runtime.cjs +85 -0
  23. package/dist/runtime.cjs.map +1 -0
  24. package/dist/runtime.d.cts +40 -0
  25. package/dist/runtime.d.cts.map +1 -0
  26. package/dist/runtime.d.ts +40 -0
  27. package/dist/runtime.d.ts.map +1 -0
  28. package/dist/runtime.js +82 -0
  29. package/dist/runtime.js.map +1 -0
  30. package/dist/schema-Bip7o0g3.cjs +128 -0
  31. package/dist/schema-Bip7o0g3.cjs.map +1 -0
  32. package/dist/schema-BygZwEX8.d.ts +494 -0
  33. package/dist/schema-BygZwEX8.d.ts.map +1 -0
  34. package/dist/schema-D9wIW5Dl.js +86 -0
  35. package/dist/schema-D9wIW5Dl.js.map +1 -0
  36. package/dist/schema-DRkKucYe.d.cts +494 -0
  37. package/dist/schema-DRkKucYe.d.cts.map +1 -0
  38. package/dist/schema-builder-8zadflz-.d.cts +40 -0
  39. package/dist/schema-builder-8zadflz-.d.cts.map +1 -0
  40. package/dist/schema-builder-vwQtCGYI.d.ts +40 -0
  41. package/dist/schema-builder-vwQtCGYI.d.ts.map +1 -0
  42. package/package.json +34 -7
  43. package/dist/index-CFNJ_Aa6.d.ts +0 -1185
  44. package/dist/index-CFNJ_Aa6.d.ts.map +0 -1
  45. package/dist/index-DHh8XRal.d.cts +0 -1185
  46. package/dist/index-DHh8XRal.d.cts.map +0 -1
  47. package/dist/runtime/index.cjs +0 -105
  48. package/dist/runtime/index.d.cts +0 -71
  49. package/dist/runtime/index.d.cts.map +0 -1
  50. package/dist/runtime/index.d.ts +0 -71
  51. package/dist/runtime/index.d.ts.map +0 -1
  52. package/dist/runtime/index.js +0 -102
  53. package/dist/runtime/index.js.map +0 -1
  54. package/dist/slice-DlVY4UJG.cjs +0 -333
  55. package/dist/slice-ua5mSfhV.js +0 -256
  56. package/dist/slice-ua5mSfhV.js.map +0 -1
@@ -1,333 +0,0 @@
1
-
2
- //#region packages/core/src/types/type-foundation/var-ref.ts
3
- var VarRef = class {
4
- constructor(inner) {
5
- this.inner = inner;
6
- }
7
- static getInner(varRef) {
8
- return varRef.inner;
9
- }
10
- };
11
- const isVarRef = (value) => {
12
- return typeof value === "object" && value !== null && value instanceof VarRef;
13
- };
14
- const createVarRefFromVariable = (name) => {
15
- return new VarRef({
16
- type: "variable",
17
- name
18
- });
19
- };
20
- const createVarRefFromConstValue = (value) => {
21
- return new VarRef({
22
- type: "const-value",
23
- value
24
- });
25
- };
26
-
27
- //#endregion
28
- //#region packages/core/src/types/runtime/projection.ts
29
- /**
30
- * Nominal type representing any slice selection regardless of schema specifics.
31
- * Encodes how individual slices map a concrete field path to a projection
32
- * function. Multiple selections allow slices to expose several derived values.
33
- */
34
- var Projection = class {
35
- constructor(paths, projector) {
36
- this.projector = projector;
37
- this.paths = paths.map((path) => createProjectionPath(path));
38
- }
39
- paths;
40
- };
41
- function createProjectionPath(path) {
42
- const segments = path.split(".");
43
- if (path === "$" || segments.length <= 1) throw new Error("Field path must not be only $ or empty");
44
- return {
45
- full: path,
46
- segments: segments.slice(1)
47
- };
48
- }
49
-
50
- //#endregion
51
- //#region packages/core/src/types/runtime/sliced-execution-result.ts
52
- /** Runtime guard interface shared by all slice result variants. */
53
- var SlicedExecutionResultGuards = class {
54
- isSuccess() {
55
- return this.type === "success";
56
- }
57
- isError() {
58
- return this.type === "error";
59
- }
60
- isEmpty() {
61
- return this.type === "empty";
62
- }
63
- constructor(type) {
64
- this.type = type;
65
- }
66
- };
67
- /** Variant representing an empty payload (no data, no error). */
68
- var SlicedExecutionResultEmpty = class extends SlicedExecutionResultGuards {
69
- constructor() {
70
- super("empty");
71
- }
72
- unwrap() {
73
- return null;
74
- }
75
- safeUnwrap() {
76
- return {
77
- data: void 0,
78
- error: void 0
79
- };
80
- }
81
- };
82
- /** Variant representing a successful payload. */
83
- var SlicedExecutionResultSuccess = class extends SlicedExecutionResultGuards {
84
- constructor(data, extensions) {
85
- super("success");
86
- this.data = data;
87
- this.extensions = extensions;
88
- }
89
- unwrap() {
90
- return this.data;
91
- }
92
- safeUnwrap(transform) {
93
- return {
94
- data: transform(this.data),
95
- error: void 0
96
- };
97
- }
98
- };
99
- /** Variant representing an error payload created by the adapter. */
100
- var SlicedExecutionResultError = class extends SlicedExecutionResultGuards {
101
- constructor(error, extensions) {
102
- super("error");
103
- this.error = error;
104
- this.extensions = extensions;
105
- }
106
- unwrap() {
107
- throw this.error;
108
- }
109
- safeUnwrap() {
110
- return {
111
- data: void 0,
112
- error: this.error
113
- };
114
- }
115
- };
116
-
117
- //#endregion
118
- //#region packages/core/src/runtime/parse-execution-result.ts
119
- function* generateErrorMapEntries(errors, projectionPathGraph) {
120
- for (const error of errors) {
121
- const errorPath = error.path ?? [];
122
- let stack = projectionPathGraph;
123
- for (let i = 0; i <= errorPath.length; i++) {
124
- const segment = errorPath[i];
125
- if (segment == null || typeof segment === "number") {
126
- yield* stack.matches.map(({ label, path }) => ({
127
- label,
128
- path,
129
- error
130
- }));
131
- break;
132
- }
133
- yield* stack.matches.filter(({ exact }) => exact).map(({ label, path }) => ({
134
- label,
135
- path,
136
- error
137
- }));
138
- const next = stack.children[segment];
139
- if (!next) break;
140
- stack = next;
141
- }
142
- }
143
- }
144
- const createErrorMaps = (errors, projectionPathGraph) => {
145
- const errorMaps = {};
146
- for (const { label, path, error } of generateErrorMapEntries(errors ?? [], projectionPathGraph)) {
147
- const mapPerLabel = errorMaps[label] || (errorMaps[label] = {});
148
- (mapPerLabel[path] || (mapPerLabel[path] = [])).push({ error });
149
- }
150
- return errorMaps;
151
- };
152
- const accessDataByPathSegments = (data, pathSegments) => {
153
- let current = data;
154
- for (const segment of pathSegments) {
155
- if (current == null) return { error: /* @__PURE__ */ new Error("No data") };
156
- if (typeof current !== "object") return { error: /* @__PURE__ */ new Error("Incorrect data type") };
157
- if (Array.isArray(current)) return { error: /* @__PURE__ */ new Error("Incorrect data type") };
158
- current = current[segment];
159
- }
160
- return { data: current };
161
- };
162
- const createExecutionResultParser = ({ fragments, projectionPathGraph }) => {
163
- const prepare = (result) => {
164
- if (result.type === "graphql") {
165
- const errorMaps = createErrorMaps(result.body.errors, projectionPathGraph);
166
- return {
167
- ...result,
168
- errorMaps
169
- };
170
- }
171
- if (result.type === "non-graphql-error") return {
172
- ...result,
173
- error: new SlicedExecutionResultError({
174
- type: "non-graphql-error",
175
- error: result.error
176
- })
177
- };
178
- if (result.type === "empty") return {
179
- ...result,
180
- error: new SlicedExecutionResultEmpty()
181
- };
182
- throw new Error("Invalid result type", { cause: result });
183
- };
184
- return (result) => {
185
- const prepared = prepare(result);
186
- const entries = Object.entries(fragments).map(([label, fragment]) => {
187
- const { projection } = fragment;
188
- if (prepared.type === "graphql") {
189
- const matchedErrors = projection.paths.flatMap(({ full: raw }) => prepared.errorMaps[label]?.[raw] ?? []);
190
- const uniqueErrors = Array.from(new Set(matchedErrors.map(({ error }) => error)).values());
191
- if (uniqueErrors.length > 0) return [label, projection.projector(new SlicedExecutionResultError({
192
- type: "graphql-error",
193
- errors: uniqueErrors
194
- }))];
195
- const dataResults = projection.paths.map(({ segments }) => prepared.body.data ? accessDataByPathSegments(prepared.body.data, segments) : { error: /* @__PURE__ */ new Error("No data") });
196
- if (dataResults.some(({ error }) => error)) {
197
- const errors = dataResults.flatMap(({ error }) => error ? [error] : []);
198
- return [label, projection.projector(new SlicedExecutionResultError({
199
- type: "parse-error",
200
- errors
201
- }))];
202
- }
203
- const dataList = dataResults.map(({ data }) => data);
204
- return [label, projection.projector(new SlicedExecutionResultSuccess(dataList))];
205
- }
206
- if (prepared.type === "non-graphql-error") return [label, projection.projector(prepared.error)];
207
- if (prepared.type === "empty") return [label, projection.projector(prepared.error)];
208
- throw new Error("Invalid result type", { cause: prepared });
209
- });
210
- return Object.fromEntries(entries);
211
- };
212
- };
213
-
214
- //#endregion
215
- //#region packages/core/src/utils/map-values.ts
216
- function mapValues(obj, fn) {
217
- return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, fn(value, key)]));
218
- }
219
-
220
- //#endregion
221
- //#region packages/core/src/composer/input.ts
222
- const mergeVarDefinitions = (definitions) => Object.assign({}, ...definitions);
223
- const createVarAssignments = (definitions, providedValues) => {
224
- return mapValues(definitions, (definition, _) => {
225
- if (!providedValues || providedValues[definition.name] === void 0) return createVarRefFromConstValue(void 0);
226
- const provided = providedValues[definition.name];
227
- if (isVarRef(provided)) return provided;
228
- return createVarRefFromConstValue(provided);
229
- });
230
- };
231
- const createVarRefs = (definitions) => mapValues(definitions, (_ref, name) => createVarRefFromVariable(name));
232
-
233
- //#endregion
234
- //#region packages/core/src/utils/hidden.ts
235
- const _dummy = () => {
236
- throw new Error("DO NOT CALL THIS FUNCTION -- we use function to safely transfer type information");
237
- };
238
- const hidden = () => _dummy;
239
-
240
- //#endregion
241
- //#region packages/core/src/runtime/slice.ts
242
- const handleProjectionBuilder = (projectionBuilder) => projectionBuilder({ select: (path, projector) => new Projection(path, projector) });
243
- const createRuntimeSlice = (input) => {
244
- const projection = handleProjectionBuilder(input.runtime.buildProjection);
245
- return {
246
- operationType: input.prebuild.operationType,
247
- embed: (variables) => ({
248
- variables,
249
- getFields: hidden(),
250
- projection
251
- })
252
- };
253
- };
254
-
255
- //#endregion
256
- Object.defineProperty(exports, 'Projection', {
257
- enumerable: true,
258
- get: function () {
259
- return Projection;
260
- }
261
- });
262
- Object.defineProperty(exports, 'SlicedExecutionResultEmpty', {
263
- enumerable: true,
264
- get: function () {
265
- return SlicedExecutionResultEmpty;
266
- }
267
- });
268
- Object.defineProperty(exports, 'SlicedExecutionResultError', {
269
- enumerable: true,
270
- get: function () {
271
- return SlicedExecutionResultError;
272
- }
273
- });
274
- Object.defineProperty(exports, 'SlicedExecutionResultSuccess', {
275
- enumerable: true,
276
- get: function () {
277
- return SlicedExecutionResultSuccess;
278
- }
279
- });
280
- Object.defineProperty(exports, 'VarRef', {
281
- enumerable: true,
282
- get: function () {
283
- return VarRef;
284
- }
285
- });
286
- Object.defineProperty(exports, 'createExecutionResultParser', {
287
- enumerable: true,
288
- get: function () {
289
- return createExecutionResultParser;
290
- }
291
- });
292
- Object.defineProperty(exports, 'createRuntimeSlice', {
293
- enumerable: true,
294
- get: function () {
295
- return createRuntimeSlice;
296
- }
297
- });
298
- Object.defineProperty(exports, 'createVarAssignments', {
299
- enumerable: true,
300
- get: function () {
301
- return createVarAssignments;
302
- }
303
- });
304
- Object.defineProperty(exports, 'createVarRefs', {
305
- enumerable: true,
306
- get: function () {
307
- return createVarRefs;
308
- }
309
- });
310
- Object.defineProperty(exports, 'handleProjectionBuilder', {
311
- enumerable: true,
312
- get: function () {
313
- return handleProjectionBuilder;
314
- }
315
- });
316
- Object.defineProperty(exports, 'hidden', {
317
- enumerable: true,
318
- get: function () {
319
- return hidden;
320
- }
321
- });
322
- Object.defineProperty(exports, 'mapValues', {
323
- enumerable: true,
324
- get: function () {
325
- return mapValues;
326
- }
327
- });
328
- Object.defineProperty(exports, 'mergeVarDefinitions', {
329
- enumerable: true,
330
- get: function () {
331
- return mergeVarDefinitions;
332
- }
333
- });
@@ -1,256 +0,0 @@
1
- //#region packages/core/src/types/type-foundation/var-ref.ts
2
- var VarRef = class {
3
- constructor(inner) {
4
- this.inner = inner;
5
- }
6
- static getInner(varRef) {
7
- return varRef.inner;
8
- }
9
- };
10
- const isVarRef = (value) => {
11
- return typeof value === "object" && value !== null && value instanceof VarRef;
12
- };
13
- const createVarRefFromVariable = (name) => {
14
- return new VarRef({
15
- type: "variable",
16
- name
17
- });
18
- };
19
- const createVarRefFromConstValue = (value) => {
20
- return new VarRef({
21
- type: "const-value",
22
- value
23
- });
24
- };
25
-
26
- //#endregion
27
- //#region packages/core/src/types/runtime/projection.ts
28
- /**
29
- * Nominal type representing any slice selection regardless of schema specifics.
30
- * Encodes how individual slices map a concrete field path to a projection
31
- * function. Multiple selections allow slices to expose several derived values.
32
- */
33
- var Projection = class {
34
- constructor(paths, projector) {
35
- this.projector = projector;
36
- this.paths = paths.map((path) => createProjectionPath(path));
37
- }
38
- paths;
39
- };
40
- function createProjectionPath(path) {
41
- const segments = path.split(".");
42
- if (path === "$" || segments.length <= 1) throw new Error("Field path must not be only $ or empty");
43
- return {
44
- full: path,
45
- segments: segments.slice(1)
46
- };
47
- }
48
-
49
- //#endregion
50
- //#region packages/core/src/types/runtime/sliced-execution-result.ts
51
- /** Runtime guard interface shared by all slice result variants. */
52
- var SlicedExecutionResultGuards = class {
53
- isSuccess() {
54
- return this.type === "success";
55
- }
56
- isError() {
57
- return this.type === "error";
58
- }
59
- isEmpty() {
60
- return this.type === "empty";
61
- }
62
- constructor(type) {
63
- this.type = type;
64
- }
65
- };
66
- /** Variant representing an empty payload (no data, no error). */
67
- var SlicedExecutionResultEmpty = class extends SlicedExecutionResultGuards {
68
- constructor() {
69
- super("empty");
70
- }
71
- unwrap() {
72
- return null;
73
- }
74
- safeUnwrap() {
75
- return {
76
- data: void 0,
77
- error: void 0
78
- };
79
- }
80
- };
81
- /** Variant representing a successful payload. */
82
- var SlicedExecutionResultSuccess = class extends SlicedExecutionResultGuards {
83
- constructor(data, extensions) {
84
- super("success");
85
- this.data = data;
86
- this.extensions = extensions;
87
- }
88
- unwrap() {
89
- return this.data;
90
- }
91
- safeUnwrap(transform) {
92
- return {
93
- data: transform(this.data),
94
- error: void 0
95
- };
96
- }
97
- };
98
- /** Variant representing an error payload created by the adapter. */
99
- var SlicedExecutionResultError = class extends SlicedExecutionResultGuards {
100
- constructor(error, extensions) {
101
- super("error");
102
- this.error = error;
103
- this.extensions = extensions;
104
- }
105
- unwrap() {
106
- throw this.error;
107
- }
108
- safeUnwrap() {
109
- return {
110
- data: void 0,
111
- error: this.error
112
- };
113
- }
114
- };
115
-
116
- //#endregion
117
- //#region packages/core/src/runtime/parse-execution-result.ts
118
- function* generateErrorMapEntries(errors, projectionPathGraph) {
119
- for (const error of errors) {
120
- const errorPath = error.path ?? [];
121
- let stack = projectionPathGraph;
122
- for (let i = 0; i <= errorPath.length; i++) {
123
- const segment = errorPath[i];
124
- if (segment == null || typeof segment === "number") {
125
- yield* stack.matches.map(({ label, path }) => ({
126
- label,
127
- path,
128
- error
129
- }));
130
- break;
131
- }
132
- yield* stack.matches.filter(({ exact }) => exact).map(({ label, path }) => ({
133
- label,
134
- path,
135
- error
136
- }));
137
- const next = stack.children[segment];
138
- if (!next) break;
139
- stack = next;
140
- }
141
- }
142
- }
143
- const createErrorMaps = (errors, projectionPathGraph) => {
144
- const errorMaps = {};
145
- for (const { label, path, error } of generateErrorMapEntries(errors ?? [], projectionPathGraph)) {
146
- const mapPerLabel = errorMaps[label] || (errorMaps[label] = {});
147
- (mapPerLabel[path] || (mapPerLabel[path] = [])).push({ error });
148
- }
149
- return errorMaps;
150
- };
151
- const accessDataByPathSegments = (data, pathSegments) => {
152
- let current = data;
153
- for (const segment of pathSegments) {
154
- if (current == null) return { error: /* @__PURE__ */ new Error("No data") };
155
- if (typeof current !== "object") return { error: /* @__PURE__ */ new Error("Incorrect data type") };
156
- if (Array.isArray(current)) return { error: /* @__PURE__ */ new Error("Incorrect data type") };
157
- current = current[segment];
158
- }
159
- return { data: current };
160
- };
161
- const createExecutionResultParser = ({ fragments, projectionPathGraph }) => {
162
- const prepare = (result) => {
163
- if (result.type === "graphql") {
164
- const errorMaps = createErrorMaps(result.body.errors, projectionPathGraph);
165
- return {
166
- ...result,
167
- errorMaps
168
- };
169
- }
170
- if (result.type === "non-graphql-error") return {
171
- ...result,
172
- error: new SlicedExecutionResultError({
173
- type: "non-graphql-error",
174
- error: result.error
175
- })
176
- };
177
- if (result.type === "empty") return {
178
- ...result,
179
- error: new SlicedExecutionResultEmpty()
180
- };
181
- throw new Error("Invalid result type", { cause: result });
182
- };
183
- return (result) => {
184
- const prepared = prepare(result);
185
- const entries = Object.entries(fragments).map(([label, fragment]) => {
186
- const { projection } = fragment;
187
- if (prepared.type === "graphql") {
188
- const matchedErrors = projection.paths.flatMap(({ full: raw }) => prepared.errorMaps[label]?.[raw] ?? []);
189
- const uniqueErrors = Array.from(new Set(matchedErrors.map(({ error }) => error)).values());
190
- if (uniqueErrors.length > 0) return [label, projection.projector(new SlicedExecutionResultError({
191
- type: "graphql-error",
192
- errors: uniqueErrors
193
- }))];
194
- const dataResults = projection.paths.map(({ segments }) => prepared.body.data ? accessDataByPathSegments(prepared.body.data, segments) : { error: /* @__PURE__ */ new Error("No data") });
195
- if (dataResults.some(({ error }) => error)) {
196
- const errors = dataResults.flatMap(({ error }) => error ? [error] : []);
197
- return [label, projection.projector(new SlicedExecutionResultError({
198
- type: "parse-error",
199
- errors
200
- }))];
201
- }
202
- const dataList = dataResults.map(({ data }) => data);
203
- return [label, projection.projector(new SlicedExecutionResultSuccess(dataList))];
204
- }
205
- if (prepared.type === "non-graphql-error") return [label, projection.projector(prepared.error)];
206
- if (prepared.type === "empty") return [label, projection.projector(prepared.error)];
207
- throw new Error("Invalid result type", { cause: prepared });
208
- });
209
- return Object.fromEntries(entries);
210
- };
211
- };
212
-
213
- //#endregion
214
- //#region packages/core/src/utils/map-values.ts
215
- function mapValues(obj, fn) {
216
- return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, fn(value, key)]));
217
- }
218
-
219
- //#endregion
220
- //#region packages/core/src/composer/input.ts
221
- const mergeVarDefinitions = (definitions) => Object.assign({}, ...definitions);
222
- const createVarAssignments = (definitions, providedValues) => {
223
- return mapValues(definitions, (definition, _) => {
224
- if (!providedValues || providedValues[definition.name] === void 0) return createVarRefFromConstValue(void 0);
225
- const provided = providedValues[definition.name];
226
- if (isVarRef(provided)) return provided;
227
- return createVarRefFromConstValue(provided);
228
- });
229
- };
230
- const createVarRefs = (definitions) => mapValues(definitions, (_ref, name) => createVarRefFromVariable(name));
231
-
232
- //#endregion
233
- //#region packages/core/src/utils/hidden.ts
234
- const _dummy = () => {
235
- throw new Error("DO NOT CALL THIS FUNCTION -- we use function to safely transfer type information");
236
- };
237
- const hidden = () => _dummy;
238
-
239
- //#endregion
240
- //#region packages/core/src/runtime/slice.ts
241
- const handleProjectionBuilder = (projectionBuilder) => projectionBuilder({ select: (path, projector) => new Projection(path, projector) });
242
- const createRuntimeSlice = (input) => {
243
- const projection = handleProjectionBuilder(input.runtime.buildProjection);
244
- return {
245
- operationType: input.prebuild.operationType,
246
- embed: (variables) => ({
247
- variables,
248
- getFields: hidden(),
249
- projection
250
- })
251
- };
252
- };
253
-
254
- //#endregion
255
- export { createVarRefs as a, createExecutionResultParser as c, SlicedExecutionResultSuccess as d, Projection as f, createVarAssignments as i, SlicedExecutionResultEmpty as l, handleProjectionBuilder as n, mergeVarDefinitions as o, VarRef as p, hidden as r, mapValues as s, createRuntimeSlice as t, SlicedExecutionResultError as u };
256
- //# sourceMappingURL=slice-ua5mSfhV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slice-ua5mSfhV.js","names":["inner: VarRefInner","projector: (result: AnySlicedExecutionResult) => TProjected","type: \"success\" | \"error\" | \"empty\"","data: TData","extensions?: unknown","error: NormalizedError<TRuntimeAdapter>","errorMaps: { [label: string]: { [path: string]: { error: GraphQLFormattedError }[] } }","current: unknown"],"sources":["../src/types/type-foundation/var-ref.ts","../src/types/runtime/projection.ts","../src/types/runtime/sliced-execution-result.ts","../src/runtime/parse-execution-result.ts","../src/utils/map-values.ts","../src/composer/input.ts","../src/utils/hidden.ts","../src/runtime/slice.ts"],"sourcesContent":["import type { ConstValue } from \"./const-value\";\nimport type { TypeProfile } from \"./type-profile\";\n\nexport interface AnyVarRefMeta {\n readonly profile: TypeProfile;\n readonly signature: unknown;\n}\n\ntype VarRefInner =\n | {\n type: \"variable\";\n name: string;\n }\n | {\n type: \"const-value\";\n value: ConstValue;\n };\n\nexport type AnyVarRef = VarRef<any>;\n\ndeclare const __VAR_REF_BRAND__: unique symbol;\nexport class VarRef<TMeta extends AnyVarRefMeta> {\n declare readonly [__VAR_REF_BRAND__]: TMeta;\n\n constructor(private readonly inner: VarRefInner) {}\n\n static getInner(varRef: AnyVarRef): VarRefInner {\n return varRef.inner;\n }\n}\n\nexport const isVarRef = (value: unknown): value is AnyVarRef => {\n return typeof value === \"object\" && value !== null && value instanceof VarRef;\n};\n\nexport const createVarRefFromVariable = <TProfile extends TypeProfile.WithMeta>(name: string) => {\n return new VarRef<TypeProfile.AssigningVarRefMeta<TProfile>>({ type: \"variable\", name });\n};\n\nexport const createVarRefFromConstValue = <TProfile extends TypeProfile.WithMeta>(value: ConstValue) => {\n return new VarRef<TypeProfile.AssigningVarRefMeta<TProfile>>({ type: \"const-value\", value });\n};\n\nexport const getVarRefInner = (varRef: AnyVarRef): VarRefInner => {\n return VarRef.getInner(varRef);\n};\n","import type { Hidden } from \"../../utils/hidden\";\nimport type { Tuple } from \"../../utils/type-utils\";\nimport type { AnySlicedExecutionResult } from \"./sliced-execution-result\";\n\n/** Shape of a single selection slice projection. */\nexport type AnyProjection = Projection<any>;\n\ndeclare const __PROJECTION_BRAND__: unique symbol;\n/**\n * Nominal type representing any slice selection regardless of schema specifics.\n * Encodes how individual slices map a concrete field path to a projection\n * function. Multiple selections allow slices to expose several derived values.\n */\nexport class Projection<TProjected> {\n declare readonly [__PROJECTION_BRAND__]: Hidden<never>;\n constructor(\n paths: Tuple<string>,\n public readonly projector: (result: AnySlicedExecutionResult) => TProjected,\n ) {\n this.paths = paths.map((path) => createProjectionPath(path));\n }\n\n public readonly paths: ProjectionPath[];\n}\n\nexport type ProjectionPath = {\n full: string;\n segments: Tuple<string>;\n};\n\nfunction createProjectionPath(path: string): ProjectionPath {\n const segments = path.split(\".\");\n if (path === \"$\" || segments.length <= 1) {\n throw new Error(\"Field path must not be only $ or empty\");\n }\n\n return {\n full: path,\n segments: segments.slice(1) as Tuple<string>,\n };\n}\n\nexport type InferExecutionResultProjection<TProjection extends AnyProjection> = ReturnType<TProjection[\"projector\"]>;\n","/** Result-like wrapper types returned from slice projections. */\n\nimport type { NormalizedError } from \"./execution-result\";\nimport type { AnyGraphqlRuntimeAdapter } from \"./runtime-adapter\";\n\nexport type AnySlicedExecutionResult = SlicedExecutionResult<any, AnyGraphqlRuntimeAdapter>;\n\n/**\n * Internal discriminated union describing the Result-like wrapper exposed to\n * slice selection callbacks. The adapter decides how raw errors are\n * materialized.\n */\nexport type AnySlicedExecutionResultRecord = {\n [path: string]: AnySlicedExecutionResult;\n};\n\nexport type SafeUnwrapResult<TTransformed, TError> =\n | {\n data?: never;\n error?: never;\n }\n | {\n data: TTransformed;\n error?: never;\n }\n | {\n data?: never;\n error: TError;\n };\n\n/** Utility signature returned by the safe unwrap helper. */\ntype SlicedExecutionResultCommon<TData, TError> = {\n safeUnwrap<TTransformed>(transform: (data: TData) => TTransformed): SafeUnwrapResult<TTransformed, TError>;\n};\n\n/** Public union used by selection callbacks to inspect data, empty, or error states. */\nexport type SlicedExecutionResult<TData, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter> =\n | SlicedExecutionResultEmpty<TData, TRuntimeAdapter>\n | SlicedExecutionResultSuccess<TData, TRuntimeAdapter>\n | SlicedExecutionResultError<TData, TRuntimeAdapter>;\n\n/** Runtime guard interface shared by all slice result variants. */\nclass SlicedExecutionResultGuards<TData, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter> {\n isSuccess(): this is SlicedExecutionResultSuccess<TData, TRuntimeAdapter> {\n return this.type === \"success\";\n }\n isError(): this is SlicedExecutionResultError<TData, TRuntimeAdapter> {\n return this.type === \"error\";\n }\n isEmpty(): this is SlicedExecutionResultEmpty<TData, TRuntimeAdapter> {\n return this.type === \"empty\";\n }\n\n constructor(private readonly type: \"success\" | \"error\" | \"empty\") {}\n}\n\n/** Variant representing an empty payload (no data, no error). */\nexport class SlicedExecutionResultEmpty<TData, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter>\n extends SlicedExecutionResultGuards<TData, TRuntimeAdapter>\n implements SlicedExecutionResultCommon<TData, NormalizedError<TRuntimeAdapter>>\n{\n constructor() {\n super(\"empty\");\n }\n\n unwrap(): null {\n return null;\n }\n\n safeUnwrap() {\n return {\n data: undefined,\n error: undefined,\n };\n }\n}\n\n/** Variant representing a successful payload. */\nexport class SlicedExecutionResultSuccess<TData, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter>\n extends SlicedExecutionResultGuards<TData, TRuntimeAdapter>\n implements SlicedExecutionResultCommon<TData, NormalizedError<TRuntimeAdapter>>\n{\n constructor(\n public readonly data: TData,\n public readonly extensions?: unknown,\n ) {\n super(\"success\");\n }\n\n unwrap(): TData {\n return this.data;\n }\n\n safeUnwrap<TTransformed>(transform: (data: TData) => TTransformed) {\n return {\n data: transform(this.data),\n error: undefined,\n };\n }\n}\n\n/** Variant representing an error payload created by the adapter. */\nexport class SlicedExecutionResultError<TData, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter>\n extends SlicedExecutionResultGuards<TData, TRuntimeAdapter>\n implements SlicedExecutionResultCommon<TData, NormalizedError<TRuntimeAdapter>>\n{\n constructor(\n public readonly error: NormalizedError<TRuntimeAdapter>,\n public readonly extensions?: unknown,\n ) {\n super(\"error\");\n }\n\n unwrap(): never {\n throw this.error;\n }\n\n safeUnwrap() {\n return {\n data: undefined,\n error: this.error,\n };\n }\n}\n","import type { GraphQLFormattedError } from \"graphql\";\nimport type { AnySlicePayloads, ProjectionPathGraphNode } from \"../types/element\";\nimport {\n type AnyGraphqlRuntimeAdapter,\n SlicedExecutionResultEmpty,\n SlicedExecutionResultError,\n SlicedExecutionResultSuccess,\n} from \"../types/runtime\";\nimport type { NormalizedExecutionResult } from \"../types/runtime/execution-result\";\n\nfunction* generateErrorMapEntries(errors: readonly GraphQLFormattedError[], projectionPathGraph: ProjectionPathGraphNode) {\n for (const error of errors) {\n const errorPath = error.path ?? [];\n let stack = projectionPathGraph;\n\n for (\n let i = 0;\n // i <= errorPath.length to handle the case where the error path is empty\n i <= errorPath.length;\n i++\n ) {\n const segment = errorPath[i];\n\n if (\n // the end of the path\n segment == null ||\n // FieldPath does not support index access. We treat it as the end of the path.\n typeof segment === \"number\"\n ) {\n yield* stack.matches.map(({ label, path }) => ({ label, path, error }));\n break;\n }\n\n yield* stack.matches.filter(({ exact }) => exact).map(({ label, path }) => ({ label, path, error }));\n\n const next = stack.children[segment];\n if (!next) {\n break;\n }\n\n stack = next;\n }\n }\n}\n\nconst createErrorMaps = (errors: readonly GraphQLFormattedError[] | undefined, projectionPathGraph: ProjectionPathGraphNode) => {\n const errorMaps: { [label: string]: { [path: string]: { error: GraphQLFormattedError }[] } } = {};\n for (const { label, path, error } of generateErrorMapEntries(errors ?? [], projectionPathGraph)) {\n const mapPerLabel = errorMaps[label] || (errorMaps[label] = {});\n const mapPerPath = mapPerLabel[path] || (mapPerLabel[path] = []);\n mapPerPath.push({ error });\n }\n return errorMaps;\n};\n\nconst accessDataByPathSegments = (data: object, pathSegments: string[]) => {\n let current: unknown = data;\n\n for (const segment of pathSegments) {\n if (current == null) {\n return { error: new Error(\"No data\") };\n }\n\n if (typeof current !== \"object\") {\n return { error: new Error(\"Incorrect data type\") };\n }\n\n if (Array.isArray(current)) {\n return { error: new Error(\"Incorrect data type\") };\n }\n\n current = (current as Record<string, unknown>)[segment];\n }\n\n return { data: current };\n};\n\nexport const createExecutionResultParser = <TRuntimeAdapter extends AnyGraphqlRuntimeAdapter>({\n fragments,\n projectionPathGraph,\n}: {\n fragments: AnySlicePayloads;\n projectionPathGraph: ProjectionPathGraphNode;\n}) => {\n const prepare = (result: NormalizedExecutionResult<TRuntimeAdapter, object, object>) => {\n if (result.type === \"graphql\") {\n const errorMaps = createErrorMaps(result.body.errors, projectionPathGraph);\n\n return { ...result, errorMaps };\n }\n\n if (result.type === \"non-graphql-error\") {\n return { ...result, error: new SlicedExecutionResultError({ type: \"non-graphql-error\", error: result.error }) };\n }\n\n if (result.type === \"empty\") {\n return { ...result, error: new SlicedExecutionResultEmpty() };\n }\n\n throw new Error(\"Invalid result type\", { cause: result satisfies never });\n };\n\n return (result: NormalizedExecutionResult<TRuntimeAdapter, object, object>) => {\n const prepared = prepare(result);\n\n const entries = Object.entries(fragments).map(([label, fragment]) => {\n const { projection } = fragment;\n\n if (prepared.type === \"graphql\") {\n const matchedErrors = projection.paths.flatMap(({ full: raw }) => prepared.errorMaps[label]?.[raw] ?? []);\n const uniqueErrors = Array.from(new Set(matchedErrors.map(({ error }) => error)).values());\n\n if (uniqueErrors.length > 0) {\n return [label, projection.projector(new SlicedExecutionResultError({ type: \"graphql-error\", errors: uniqueErrors }))];\n }\n\n const dataResults = projection.paths.map(({ segments }) =>\n prepared.body.data ? accessDataByPathSegments(prepared.body.data, segments) : { error: new Error(\"No data\") },\n );\n if (dataResults.some(({ error }) => error)) {\n const errors = dataResults.flatMap(({ error }) => (error ? [error] : []));\n return [label, projection.projector(new SlicedExecutionResultError({ type: \"parse-error\", errors }))];\n }\n\n const dataList = dataResults.map(({ data }) => data);\n return [label, projection.projector(new SlicedExecutionResultSuccess(dataList))];\n }\n\n if (prepared.type === \"non-graphql-error\") {\n return [label, projection.projector(prepared.error)];\n }\n\n if (prepared.type === \"empty\") {\n return [label, projection.projector(prepared.error)];\n }\n\n throw new Error(\"Invalid result type\", { cause: prepared satisfies never });\n });\n\n return Object.fromEntries(entries);\n };\n};\n","type ArgEntries<T extends object> = { [K in keyof T]-?: [value: T[K], key: K] }[keyof T];\ntype Entries<T extends object> = { [K in keyof T]: [key: K, value: T[K]] }[keyof T];\n\nexport function mapValues<TObject extends object, TMappedValue>(\n obj: TObject,\n fn: (...args: ArgEntries<TObject>) => TMappedValue,\n): {\n [K in keyof TObject]: TMappedValue;\n} {\n return Object.fromEntries((Object.entries(obj) as Entries<TObject>[]).map(([key, value]) => [key, fn(value, key)])) as {\n [K in keyof TObject]: TMappedValue;\n };\n}\n","import {\n type AnyAssignableInput,\n type AssigningInput,\n createVarRefFromConstValue,\n createVarRefFromVariable,\n isVarRef,\n} from \"../types/fragment\";\nimport type { AnyGraphqlSchema, InferInputProfile } from \"../types/schema\";\nimport type { AnyVarRef, ConstValue, InputTypeSpecifiers } from \"../types/type-foundation\";\nimport { mapValues } from \"../utils/map-values\";\nimport type { UnionToIntersection } from \"../utils/type-utils\";\n\nexport const mergeVarDefinitions = <TVarDefinitions extends InputTypeSpecifiers[]>(definitions: TVarDefinitions) =>\n Object.assign({}, ...definitions) as MergeVarDefinitions<TVarDefinitions>;\n\nexport type MergeVarDefinitions<TVarDefinitions extends InputTypeSpecifiers[]> = UnionToIntersection<\n TVarDefinitions[number]\n> extends infer TDefinitions\n ? {\n readonly [K in keyof TDefinitions]: TDefinitions[K];\n }\n : never;\n\nexport const createVarAssignments = <TSchema extends AnyGraphqlSchema, TVariableDefinitions extends InputTypeSpecifiers>(\n definitions: TVariableDefinitions,\n providedValues: AnyAssignableInput | void,\n): AssigningInput<TSchema, TVariableDefinitions> => {\n return mapValues(definitions, (definition, _): AnyVarRef => {\n if (!providedValues || providedValues[definition.name] === undefined) {\n return createVarRefFromConstValue<InferInputProfile<TSchema, typeof definition>>(undefined);\n }\n\n const provided = providedValues[definition.name];\n if (isVarRef(provided)) {\n return provided;\n }\n\n return createVarRefFromConstValue<InferInputProfile<TSchema, typeof definition>>(provided as ConstValue);\n }) as AssigningInput<TSchema, TVariableDefinitions>;\n};\n\nexport const createVarRefs = <TSchema extends AnyGraphqlSchema, TVarDefinitions extends InputTypeSpecifiers>(\n definitions: TVarDefinitions,\n) =>\n mapValues(definitions as InputTypeSpecifiers, (_ref, name) =>\n createVarRefFromVariable<InferInputProfile<TSchema, typeof _ref>>(name),\n ) as AssigningInput<TSchema, TVarDefinitions>;\n","const _dummy = () => {\n throw new Error(\"DO NOT CALL THIS FUNCTION -- we use function to safely transfer type information\");\n};\nexport const hidden = <T>(): (() => T) => _dummy;\nexport type Hidden<T> = () => T;\n","import type { AnyExecutionResultProjectionsBuilder, AnySliceOf } from \"../types/element\";\nimport { Projection } from \"../types/runtime\";\nimport type { OperationType } from \"../types/schema\";\nimport { hidden } from \"../utils/hidden\";\nimport type { StripFunctions, StripSymbols } from \"../utils/type-utils\";\n\nexport type RuntimeSliceInput = {\n prebuild: StripFunctions<AnySliceOf<OperationType>>;\n runtime: {\n buildProjection: AnyExecutionResultProjectionsBuilder;\n };\n};\n\nexport const handleProjectionBuilder = <TBuilder extends AnyExecutionResultProjectionsBuilder>(\n projectionBuilder: TBuilder,\n): ReturnType<TBuilder> =>\n projectionBuilder({\n select: (path, projector) => new Projection(path, projector),\n });\n\nexport const createRuntimeSlice = (input: RuntimeSliceInput) => {\n const projection = handleProjectionBuilder(input.runtime.buildProjection);\n return {\n operationType: input.prebuild.operationType,\n embed: (variables) => ({\n variables,\n getFields: hidden(),\n projection,\n }),\n } satisfies StripSymbols<AnySliceOf<OperationType>> as AnySliceOf<OperationType>;\n};\n"],"mappings":";AAqBA,IAAa,SAAb,MAAiD;CAG/C,YAAY,AAAiBA,OAAoB;EAApB;;CAE7B,OAAO,SAAS,QAAgC;AAC9C,SAAO,OAAO;;;AAIlB,MAAa,YAAY,UAAuC;AAC9D,QAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,iBAAiB;;AAGzE,MAAa,4BAAmE,SAAiB;AA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