@gqloom/core 0.12.1 → 0.13.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/dist/{chunk-CTAAG5j7.js → chunk-Bp6m_JJh.js} +1 -1
- package/dist/context.cjs +9 -9
- package/dist/context.d.cts +5 -6
- package/dist/context.d.ts +5 -6
- package/dist/context.js +1 -1
- package/dist/{index-BxqR3YsC.d.cts → index-DBqGrLn7.d.cts} +313 -297
- package/dist/{index-sGKC4BRu.d.ts → index-DWjUYc0-.d.ts} +314 -297
- package/dist/index.cjs +440 -429
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +409 -399
- package/dist/{context-BxqO4Eg9.js → parse-resolving-fields-BS_BL7I_.js} +67 -62
- package/dist/{context-DshDoxiE.cjs → parse-resolving-fields-BXQG_2Z-.cjs} +71 -60
- package/package.json +1 -1
|
@@ -1,10 +1,75 @@
|
|
|
1
|
-
import { __export } from "./chunk-
|
|
1
|
+
import { t as __export } from "./chunk-Bp6m_JJh.js";
|
|
2
2
|
import { Kind, isInterfaceType, isListType, isNonNullType, isObjectType } from "graphql";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/constants.ts
|
|
5
5
|
const DERIVED_DEPENDENCIES = "loom.derived-from-dependencies";
|
|
6
6
|
const AUTO_ALIASING = "__gqloom_auto_aliasing";
|
|
7
7
|
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/utils/symbols.ts
|
|
10
|
+
var symbols_exports = /* @__PURE__ */ __export({
|
|
11
|
+
CONTEXT_MAP_KEY: () => CONTEXT_MAP_KEY,
|
|
12
|
+
FIELD_HIDDEN: () => FIELD_HIDDEN,
|
|
13
|
+
GET_GRAPHQL_ARGUMENT_CONFIG: () => GET_GRAPHQL_ARGUMENT_CONFIG,
|
|
14
|
+
GET_GRAPHQL_TYPE: () => GET_GRAPHQL_TYPE,
|
|
15
|
+
IS_RESOLVER: () => IS_RESOLVER,
|
|
16
|
+
RESOLVER_OPTIONS_KEY: () => RESOLVER_OPTIONS_KEY,
|
|
17
|
+
WEAVER_CONFIG: () => WEAVER_CONFIG
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* The symbol to get GraphQL type for schema
|
|
21
|
+
*/
|
|
22
|
+
const GET_GRAPHQL_TYPE = Symbol.for("gqloom.get_graphql_type");
|
|
23
|
+
/**
|
|
24
|
+
* The symbol to get GraphQL argument config for schema
|
|
25
|
+
*/
|
|
26
|
+
const GET_GRAPHQL_ARGUMENT_CONFIG = Symbol.for("gqloom.get_graphql_argument_config");
|
|
27
|
+
/**
|
|
28
|
+
* The symbol to get and store weaver config
|
|
29
|
+
*/
|
|
30
|
+
const WEAVER_CONFIG = Symbol.for("gqloom.weaver_config");
|
|
31
|
+
/**
|
|
32
|
+
* The symbol to get resolver options
|
|
33
|
+
*/
|
|
34
|
+
const RESOLVER_OPTIONS_KEY = Symbol.for("gqloom.resolver-options");
|
|
35
|
+
/**
|
|
36
|
+
* The symbol to check if an object is a resolver
|
|
37
|
+
*/
|
|
38
|
+
const IS_RESOLVER = Symbol.for("gqloom.is-resolver");
|
|
39
|
+
/**
|
|
40
|
+
* The symbol to assign a WeakMap to an object
|
|
41
|
+
*/
|
|
42
|
+
const CONTEXT_MAP_KEY = Symbol.for("gqloom.context-map");
|
|
43
|
+
/**
|
|
44
|
+
* Set fields to be hidden
|
|
45
|
+
*/
|
|
46
|
+
const FIELD_HIDDEN = false;
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/utils/context.ts
|
|
50
|
+
/**
|
|
51
|
+
* Create an empty memoization payload for the resolver
|
|
52
|
+
* @returns the empty memoization payload
|
|
53
|
+
*/
|
|
54
|
+
function onlyMemoization() {
|
|
55
|
+
return {
|
|
56
|
+
memoization: /* @__PURE__ */ new WeakMap(),
|
|
57
|
+
isMemoization: true
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function isOnlyMemoryPayload(payload) {
|
|
61
|
+
return payload.isMemoization === true;
|
|
62
|
+
}
|
|
63
|
+
function getMemoizationMap(payload) {
|
|
64
|
+
if (isOnlyMemoryPayload(payload)) return payload.memoization;
|
|
65
|
+
if (typeof payload.context === "undefined") Object.defineProperty(payload, "context", { value: {} });
|
|
66
|
+
return assignContextMap(payload.context);
|
|
67
|
+
}
|
|
68
|
+
function assignContextMap(target) {
|
|
69
|
+
target[CONTEXT_MAP_KEY] ??= /* @__PURE__ */ new WeakMap();
|
|
70
|
+
return target[CONTEXT_MAP_KEY];
|
|
71
|
+
}
|
|
72
|
+
|
|
8
73
|
//#endregion
|
|
9
74
|
//#region src/utils/type.ts
|
|
10
75
|
function unwrapType(gqlType) {
|
|
@@ -239,64 +304,4 @@ var ResolvingFieldsParser = class ResolvingFieldsParser {
|
|
|
239
304
|
};
|
|
240
305
|
|
|
241
306
|
//#endregion
|
|
242
|
-
|
|
243
|
-
var symbols_exports = /* @__PURE__ */ __export({
|
|
244
|
-
CONTEXT_MAP_KEY: () => CONTEXT_MAP_KEY,
|
|
245
|
-
FIELD_HIDDEN: () => FIELD_HIDDEN,
|
|
246
|
-
GET_GRAPHQL_TYPE: () => GET_GRAPHQL_TYPE,
|
|
247
|
-
IS_RESOLVER: () => IS_RESOLVER,
|
|
248
|
-
RESOLVER_OPTIONS_KEY: () => RESOLVER_OPTIONS_KEY,
|
|
249
|
-
WEAVER_CONFIG: () => WEAVER_CONFIG
|
|
250
|
-
});
|
|
251
|
-
/**
|
|
252
|
-
* The symbol to get GraphQL type for schema
|
|
253
|
-
*/
|
|
254
|
-
const GET_GRAPHQL_TYPE = Symbol.for("gqloom.get_graphql_type");
|
|
255
|
-
/**
|
|
256
|
-
* The symbol to get and store weaver config
|
|
257
|
-
*/
|
|
258
|
-
const WEAVER_CONFIG = Symbol.for("gqloom.weaver_config");
|
|
259
|
-
/**
|
|
260
|
-
* The symbol to get resolver options
|
|
261
|
-
*/
|
|
262
|
-
const RESOLVER_OPTIONS_KEY = Symbol.for("gqloom.resolver-options");
|
|
263
|
-
/**
|
|
264
|
-
* The symbol to check if an object is a resolver
|
|
265
|
-
*/
|
|
266
|
-
const IS_RESOLVER = Symbol.for("gqloom.is-resolver");
|
|
267
|
-
/**
|
|
268
|
-
* The symbol to assign a WeakMap to an object
|
|
269
|
-
*/
|
|
270
|
-
const CONTEXT_MAP_KEY = Symbol.for("gqloom.context-map");
|
|
271
|
-
/**
|
|
272
|
-
* Set fields to be hidden
|
|
273
|
-
*/
|
|
274
|
-
const FIELD_HIDDEN = false;
|
|
275
|
-
|
|
276
|
-
//#endregion
|
|
277
|
-
//#region src/utils/context.ts
|
|
278
|
-
/**
|
|
279
|
-
* Create an empty memoization payload for the resolver
|
|
280
|
-
* @returns the empty memoization payload
|
|
281
|
-
*/
|
|
282
|
-
function onlyMemoization() {
|
|
283
|
-
return {
|
|
284
|
-
memoization: /* @__PURE__ */ new WeakMap(),
|
|
285
|
-
isMemoization: true
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
function isOnlyMemoryPayload(payload) {
|
|
289
|
-
return payload.isMemoization === true;
|
|
290
|
-
}
|
|
291
|
-
function getMemoizationMap(payload) {
|
|
292
|
-
if (isOnlyMemoryPayload(payload)) return payload.memoization;
|
|
293
|
-
if (typeof payload.context === "undefined") Object.defineProperty(payload, "context", { value: {} });
|
|
294
|
-
return assignContextMap(payload.context);
|
|
295
|
-
}
|
|
296
|
-
function assignContextMap(target) {
|
|
297
|
-
target[CONTEXT_MAP_KEY] ??= /* @__PURE__ */ new WeakMap();
|
|
298
|
-
return target[CONTEXT_MAP_KEY];
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
//#endregion
|
|
302
|
-
export { AUTO_ALIASING, DERIVED_DEPENDENCIES, FIELD_HIDDEN, GET_GRAPHQL_TYPE, IS_RESOLVER, WEAVER_CONFIG, assignContextMap, getDeepResolvingFields, getMemoizationMap, getResolvingFields, isOnlyMemoryPayload, onlyMemoization, parseResolvingFields, symbols_exports };
|
|
307
|
+
export { getMemoizationMap as a, FIELD_HIDDEN as c, IS_RESOLVER as d, WEAVER_CONFIG as f, DERIVED_DEPENDENCIES as h, assignContextMap as i, GET_GRAPHQL_ARGUMENT_CONFIG as l, AUTO_ALIASING as m, getResolvingFields as n, isOnlyMemoryPayload as o, symbols_exports as p, parseResolvingFields as r, onlyMemoization as s, getDeepResolvingFields as t, GET_GRAPHQL_TYPE as u };
|
|
@@ -36,6 +36,71 @@ graphql = __toESM(graphql);
|
|
|
36
36
|
const DERIVED_DEPENDENCIES = "loom.derived-from-dependencies";
|
|
37
37
|
const AUTO_ALIASING = "__gqloom_auto_aliasing";
|
|
38
38
|
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/utils/symbols.ts
|
|
41
|
+
var symbols_exports = /* @__PURE__ */ __export({
|
|
42
|
+
CONTEXT_MAP_KEY: () => CONTEXT_MAP_KEY,
|
|
43
|
+
FIELD_HIDDEN: () => FIELD_HIDDEN,
|
|
44
|
+
GET_GRAPHQL_ARGUMENT_CONFIG: () => GET_GRAPHQL_ARGUMENT_CONFIG,
|
|
45
|
+
GET_GRAPHQL_TYPE: () => GET_GRAPHQL_TYPE,
|
|
46
|
+
IS_RESOLVER: () => IS_RESOLVER,
|
|
47
|
+
RESOLVER_OPTIONS_KEY: () => RESOLVER_OPTIONS_KEY,
|
|
48
|
+
WEAVER_CONFIG: () => WEAVER_CONFIG
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* The symbol to get GraphQL type for schema
|
|
52
|
+
*/
|
|
53
|
+
const GET_GRAPHQL_TYPE = Symbol.for("gqloom.get_graphql_type");
|
|
54
|
+
/**
|
|
55
|
+
* The symbol to get GraphQL argument config for schema
|
|
56
|
+
*/
|
|
57
|
+
const GET_GRAPHQL_ARGUMENT_CONFIG = Symbol.for("gqloom.get_graphql_argument_config");
|
|
58
|
+
/**
|
|
59
|
+
* The symbol to get and store weaver config
|
|
60
|
+
*/
|
|
61
|
+
const WEAVER_CONFIG = Symbol.for("gqloom.weaver_config");
|
|
62
|
+
/**
|
|
63
|
+
* The symbol to get resolver options
|
|
64
|
+
*/
|
|
65
|
+
const RESOLVER_OPTIONS_KEY = Symbol.for("gqloom.resolver-options");
|
|
66
|
+
/**
|
|
67
|
+
* The symbol to check if an object is a resolver
|
|
68
|
+
*/
|
|
69
|
+
const IS_RESOLVER = Symbol.for("gqloom.is-resolver");
|
|
70
|
+
/**
|
|
71
|
+
* The symbol to assign a WeakMap to an object
|
|
72
|
+
*/
|
|
73
|
+
const CONTEXT_MAP_KEY = Symbol.for("gqloom.context-map");
|
|
74
|
+
/**
|
|
75
|
+
* Set fields to be hidden
|
|
76
|
+
*/
|
|
77
|
+
const FIELD_HIDDEN = false;
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/utils/context.ts
|
|
81
|
+
/**
|
|
82
|
+
* Create an empty memoization payload for the resolver
|
|
83
|
+
* @returns the empty memoization payload
|
|
84
|
+
*/
|
|
85
|
+
function onlyMemoization() {
|
|
86
|
+
return {
|
|
87
|
+
memoization: /* @__PURE__ */ new WeakMap(),
|
|
88
|
+
isMemoization: true
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function isOnlyMemoryPayload(payload) {
|
|
92
|
+
return payload.isMemoization === true;
|
|
93
|
+
}
|
|
94
|
+
function getMemoizationMap(payload) {
|
|
95
|
+
if (isOnlyMemoryPayload(payload)) return payload.memoization;
|
|
96
|
+
if (typeof payload.context === "undefined") Object.defineProperty(payload, "context", { value: {} });
|
|
97
|
+
return assignContextMap(payload.context);
|
|
98
|
+
}
|
|
99
|
+
function assignContextMap(target) {
|
|
100
|
+
target[CONTEXT_MAP_KEY] ??= /* @__PURE__ */ new WeakMap();
|
|
101
|
+
return target[CONTEXT_MAP_KEY];
|
|
102
|
+
}
|
|
103
|
+
|
|
39
104
|
//#endregion
|
|
40
105
|
//#region src/utils/type.ts
|
|
41
106
|
function unwrapType(gqlType) {
|
|
@@ -269,66 +334,6 @@ var ResolvingFieldsParser = class ResolvingFieldsParser {
|
|
|
269
334
|
}
|
|
270
335
|
};
|
|
271
336
|
|
|
272
|
-
//#endregion
|
|
273
|
-
//#region src/utils/symbols.ts
|
|
274
|
-
var symbols_exports = /* @__PURE__ */ __export({
|
|
275
|
-
CONTEXT_MAP_KEY: () => CONTEXT_MAP_KEY,
|
|
276
|
-
FIELD_HIDDEN: () => FIELD_HIDDEN,
|
|
277
|
-
GET_GRAPHQL_TYPE: () => GET_GRAPHQL_TYPE,
|
|
278
|
-
IS_RESOLVER: () => IS_RESOLVER,
|
|
279
|
-
RESOLVER_OPTIONS_KEY: () => RESOLVER_OPTIONS_KEY,
|
|
280
|
-
WEAVER_CONFIG: () => WEAVER_CONFIG
|
|
281
|
-
});
|
|
282
|
-
/**
|
|
283
|
-
* The symbol to get GraphQL type for schema
|
|
284
|
-
*/
|
|
285
|
-
const GET_GRAPHQL_TYPE = Symbol.for("gqloom.get_graphql_type");
|
|
286
|
-
/**
|
|
287
|
-
* The symbol to get and store weaver config
|
|
288
|
-
*/
|
|
289
|
-
const WEAVER_CONFIG = Symbol.for("gqloom.weaver_config");
|
|
290
|
-
/**
|
|
291
|
-
* The symbol to get resolver options
|
|
292
|
-
*/
|
|
293
|
-
const RESOLVER_OPTIONS_KEY = Symbol.for("gqloom.resolver-options");
|
|
294
|
-
/**
|
|
295
|
-
* The symbol to check if an object is a resolver
|
|
296
|
-
*/
|
|
297
|
-
const IS_RESOLVER = Symbol.for("gqloom.is-resolver");
|
|
298
|
-
/**
|
|
299
|
-
* The symbol to assign a WeakMap to an object
|
|
300
|
-
*/
|
|
301
|
-
const CONTEXT_MAP_KEY = Symbol.for("gqloom.context-map");
|
|
302
|
-
/**
|
|
303
|
-
* Set fields to be hidden
|
|
304
|
-
*/
|
|
305
|
-
const FIELD_HIDDEN = false;
|
|
306
|
-
|
|
307
|
-
//#endregion
|
|
308
|
-
//#region src/utils/context.ts
|
|
309
|
-
/**
|
|
310
|
-
* Create an empty memoization payload for the resolver
|
|
311
|
-
* @returns the empty memoization payload
|
|
312
|
-
*/
|
|
313
|
-
function onlyMemoization() {
|
|
314
|
-
return {
|
|
315
|
-
memoization: /* @__PURE__ */ new WeakMap(),
|
|
316
|
-
isMemoization: true
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
function isOnlyMemoryPayload(payload) {
|
|
320
|
-
return payload.isMemoization === true;
|
|
321
|
-
}
|
|
322
|
-
function getMemoizationMap(payload) {
|
|
323
|
-
if (isOnlyMemoryPayload(payload)) return payload.memoization;
|
|
324
|
-
if (typeof payload.context === "undefined") Object.defineProperty(payload, "context", { value: {} });
|
|
325
|
-
return assignContextMap(payload.context);
|
|
326
|
-
}
|
|
327
|
-
function assignContextMap(target) {
|
|
328
|
-
target[CONTEXT_MAP_KEY] ??= /* @__PURE__ */ new WeakMap();
|
|
329
|
-
return target[CONTEXT_MAP_KEY];
|
|
330
|
-
}
|
|
331
|
-
|
|
332
337
|
//#endregion
|
|
333
338
|
Object.defineProperty(exports, 'AUTO_ALIASING', {
|
|
334
339
|
enumerable: true,
|
|
@@ -348,6 +353,12 @@ Object.defineProperty(exports, 'FIELD_HIDDEN', {
|
|
|
348
353
|
return FIELD_HIDDEN;
|
|
349
354
|
}
|
|
350
355
|
});
|
|
356
|
+
Object.defineProperty(exports, 'GET_GRAPHQL_ARGUMENT_CONFIG', {
|
|
357
|
+
enumerable: true,
|
|
358
|
+
get: function () {
|
|
359
|
+
return GET_GRAPHQL_ARGUMENT_CONFIG;
|
|
360
|
+
}
|
|
361
|
+
});
|
|
351
362
|
Object.defineProperty(exports, 'GET_GRAPHQL_TYPE', {
|
|
352
363
|
enumerable: true,
|
|
353
364
|
get: function () {
|