@gqloom/core 0.11.1 → 0.12.1
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/{context-BtR7FTYT.js → context-BxqO4Eg9.js} +2 -1
- package/dist/{context-CnY_BFnk.cjs → context-DshDoxiE.cjs} +7 -0
- package/dist/context.cjs +1 -1
- package/dist/context.d.cts +1 -1
- package/dist/context.d.ts +1 -1
- package/dist/context.js +1 -1
- package/dist/{index-t3pO8DK2.d.ts → index-BxqR3YsC.d.cts} +62 -30
- package/dist/{index-DXUAbzqx.d.cts → index-sGKC4BRu.d.ts} +60 -32
- package/dist/index.cjs +191 -120
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +188 -121
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { Kind, isInterfaceType, isListType, isNonNullType, isObjectType } from "
|
|
|
3
3
|
|
|
4
4
|
//#region src/utils/constants.ts
|
|
5
5
|
const DERIVED_DEPENDENCIES = "loom.derived-from-dependencies";
|
|
6
|
+
const AUTO_ALIASING = "__gqloom_auto_aliasing";
|
|
6
7
|
|
|
7
8
|
//#endregion
|
|
8
9
|
//#region src/utils/type.ts
|
|
@@ -298,4 +299,4 @@ function assignContextMap(target) {
|
|
|
298
299
|
}
|
|
299
300
|
|
|
300
301
|
//#endregion
|
|
301
|
-
export { DERIVED_DEPENDENCIES, FIELD_HIDDEN, GET_GRAPHQL_TYPE, IS_RESOLVER, WEAVER_CONFIG, assignContextMap, getDeepResolvingFields, getMemoizationMap, getResolvingFields, isOnlyMemoryPayload, onlyMemoization, parseResolvingFields, symbols_exports };
|
|
302
|
+
export { AUTO_ALIASING, DERIVED_DEPENDENCIES, FIELD_HIDDEN, GET_GRAPHQL_TYPE, IS_RESOLVER, WEAVER_CONFIG, assignContextMap, getDeepResolvingFields, getMemoizationMap, getResolvingFields, isOnlyMemoryPayload, onlyMemoization, parseResolvingFields, symbols_exports };
|
|
@@ -34,6 +34,7 @@ graphql = __toESM(graphql);
|
|
|
34
34
|
|
|
35
35
|
//#region src/utils/constants.ts
|
|
36
36
|
const DERIVED_DEPENDENCIES = "loom.derived-from-dependencies";
|
|
37
|
+
const AUTO_ALIASING = "__gqloom_auto_aliasing";
|
|
37
38
|
|
|
38
39
|
//#endregion
|
|
39
40
|
//#region src/utils/type.ts
|
|
@@ -329,6 +330,12 @@ function assignContextMap(target) {
|
|
|
329
330
|
}
|
|
330
331
|
|
|
331
332
|
//#endregion
|
|
333
|
+
Object.defineProperty(exports, 'AUTO_ALIASING', {
|
|
334
|
+
enumerable: true,
|
|
335
|
+
get: function () {
|
|
336
|
+
return AUTO_ALIASING;
|
|
337
|
+
}
|
|
338
|
+
});
|
|
332
339
|
Object.defineProperty(exports, 'DERIVED_DEPENDENCIES', {
|
|
333
340
|
enumerable: true,
|
|
334
341
|
get: function () {
|
package/dist/context.cjs
CHANGED
package/dist/context.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseField, Middleware, OnlyMemoizationPayload, ResolverPayload, ResolvingFields } from "./index-
|
|
1
|
+
import { BaseField, Middleware, OnlyMemoizationPayload, ResolverPayload, ResolvingFields } from "./index-BxqR3YsC.cjs";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
|
|
4
4
|
//#region src/context/context.d.ts
|
package/dist/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseField, Middleware, OnlyMemoizationPayload, ResolverPayload, ResolvingFields } from "./index-
|
|
1
|
+
import { BaseField, Middleware, OnlyMemoizationPayload, ResolverPayload, ResolvingFields } from "./index-sGKC4BRu.js";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
|
|
4
4
|
//#region src/context/context.d.ts
|
package/dist/context.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getMemoizationMap, getResolvingFields, isOnlyMemoryPayload, onlyMemoization } from "./context-
|
|
1
|
+
import { getMemoizationMap, getResolvingFields, isOnlyMemoryPayload, onlyMemoization } from "./context-BxqO4Eg9.js";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
|
|
4
4
|
//#region src/context/async-iterator.ts
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, GraphQLFieldExtensions, GraphQLFieldMap, GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLInterfaceTypeConfig, GraphQLList, GraphQLNamedType, GraphQLNonNull, GraphQLNullableType, GraphQLObjectType, GraphQLObjectTypeConfig, GraphQLOutputType, GraphQLResolveInfo, GraphQLScalarType, GraphQLSchema, GraphQLSchemaConfig, GraphQLType, GraphQLUnionType } from "graphql";
|
|
2
2
|
|
|
3
|
+
//#region rolldown:runtime
|
|
4
|
+
//#endregion
|
|
3
5
|
//#region src/utils/types.d.ts
|
|
4
6
|
type MayPromise<T> = T | Promise<T>;
|
|
5
7
|
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
@@ -1059,6 +1061,10 @@ interface ContextMemoryContainer {
|
|
|
1059
1061
|
}
|
|
1060
1062
|
declare function assignContextMap(target: ContextMemoryContainer): WeakMap<WeakKey, any>;
|
|
1061
1063
|
//#endregion
|
|
1064
|
+
//#region src/utils/constants.d.ts
|
|
1065
|
+
declare const DERIVED_DEPENDENCIES = "loom.derived-from-dependencies";
|
|
1066
|
+
declare const AUTO_ALIASING = "__gqloom_auto_aliasing";
|
|
1067
|
+
//#endregion
|
|
1062
1068
|
//#region src/schema/schema-weaver.d.ts
|
|
1063
1069
|
interface SchemaWeaver {
|
|
1064
1070
|
vendor: string;
|
|
@@ -1067,43 +1073,73 @@ interface SchemaWeaver {
|
|
|
1067
1073
|
declare function isSchemaVendorWeaver(some: any): some is SchemaWeaver;
|
|
1068
1074
|
//#endregion
|
|
1069
1075
|
//#region src/schema/weaver-context.d.ts
|
|
1070
|
-
|
|
1076
|
+
declare class WeaverContext {
|
|
1077
|
+
static increasingID: number;
|
|
1078
|
+
static names: WeakMap<object, string>;
|
|
1079
|
+
static autoAliasTypes: WeakSet<GraphQLNamedType>;
|
|
1080
|
+
private static _ref;
|
|
1081
|
+
static get ref(): WeaverContext | undefined;
|
|
1071
1082
|
id: number;
|
|
1072
1083
|
loomObjectMap: Map<GraphQLObjectType, LoomObjectType>;
|
|
1073
1084
|
loomUnionMap: Map<GraphQLUnionType, GraphQLUnionType>;
|
|
1074
1085
|
inputMap: Map<GraphQLObjectType | GraphQLInterfaceType, GraphQLInputObjectType>;
|
|
1075
1086
|
interfaceMap: Map<GraphQLObjectType, GraphQLInterfaceType>;
|
|
1076
1087
|
configs: Map<string | symbol, WeaverConfig>;
|
|
1077
|
-
getConfig: <TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]) => TConfig | undefined;
|
|
1078
|
-
setConfig<TConfig extends WeaverConfig>(config: TConfig): void;
|
|
1079
|
-
deleteConfig: <TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]) => void;
|
|
1080
1088
|
namedTypes: Map<string, GraphQLOutputType>;
|
|
1081
|
-
memoNamedType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(gqlType: TGraphQLType): TGraphQLType;
|
|
1082
|
-
getNamedType<T extends GraphQLOutputType>(name: string): T | undefined;
|
|
1083
|
-
names: WeakMap<object, string>;
|
|
1084
1089
|
vendorWeavers: Map<string, SchemaWeaver>;
|
|
1090
|
+
constructor();
|
|
1091
|
+
getConfig<TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]): TConfig | undefined;
|
|
1092
|
+
setConfig<TConfig extends WeaverConfig>(config: TConfig): void;
|
|
1093
|
+
deleteConfig<TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]): void;
|
|
1094
|
+
memoNamedType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(gqlTypeValue: TGraphQLType): TGraphQLType;
|
|
1095
|
+
getNamedType<T extends GraphQLOutputType>(name: string): T | undefined;
|
|
1096
|
+
protected static readonly namedTypes: {
|
|
1097
|
+
readonly Object: "Object";
|
|
1098
|
+
readonly Union: "Union";
|
|
1099
|
+
readonly Enum: "Enum";
|
|
1100
|
+
readonly Interface: "Interface";
|
|
1101
|
+
readonly Scalar: "Scalar";
|
|
1102
|
+
};
|
|
1103
|
+
protected aliasCounters: Partial<Record<keyof typeof WeaverContext.namedTypes, number>>;
|
|
1104
|
+
setAlias(namedType: GraphQLNamedType, alias: string | undefined): string | undefined;
|
|
1105
|
+
/**
|
|
1106
|
+
* @returns -1 if a is better than b, 1 if b is better than a, 0 if they are equal
|
|
1107
|
+
*/
|
|
1108
|
+
protected static higherPriorityThan(a: string | undefined, b: string | undefined): number;
|
|
1109
|
+
static provide<T>(func: () => T, value: WeaverContext | undefined): T;
|
|
1085
1110
|
}
|
|
1111
|
+
declare const initWeaverContext: () => WeaverContext;
|
|
1112
|
+
declare const provideWeaverContext: typeof WeaverContext.provide & {
|
|
1113
|
+
inherit: <T>(func: () => T) => () => T;
|
|
1114
|
+
};
|
|
1086
1115
|
interface WeaverConfig {
|
|
1087
1116
|
[WEAVER_CONFIG]: string | symbol;
|
|
1088
1117
|
vendorWeaver?: SchemaWeaver;
|
|
1089
1118
|
}
|
|
1090
|
-
|
|
1091
|
-
declare
|
|
1092
|
-
var increasingID: number;
|
|
1093
|
-
}
|
|
1094
|
-
type GlobalContextRequiredKeys = "names" | "getConfig" | "setConfig" | "deleteConfig" | "getNamedType" | "memoNamedType";
|
|
1095
|
-
interface GlobalWeaverContext extends Partial<Omit<WeaverContext, GlobalContextRequiredKeys>>, Pick<WeaverContext, GlobalContextRequiredKeys> {
|
|
1096
|
-
value?: WeaverContext;
|
|
1097
|
-
useConfig<TConfig extends WeaverConfig, TCallback extends () => any>(config: TConfig, callback: TCallback): ReturnType<TCallback>;
|
|
1119
|
+
type GlobalContextRequiredKeys = "getConfig" | "setConfig" | "deleteConfig" | "getNamedType" | "memoNamedType";
|
|
1120
|
+
declare class GlobalWeaverContext implements Partial<Omit<WeaverContext, GlobalContextRequiredKeys>>, Pick<WeaverContext, GlobalContextRequiredKeys> {
|
|
1098
1121
|
GraphQLTypes: WeakMap<object, GraphQLOutputType>;
|
|
1122
|
+
get id(): number | undefined;
|
|
1123
|
+
get loomObjectMap(): Map<GraphQLObjectType<any, any>, LoomObjectType> | undefined;
|
|
1124
|
+
get loomUnionMap(): Map<GraphQLUnionType, GraphQLUnionType> | undefined;
|
|
1125
|
+
get inputMap(): Map<GraphQLInterfaceType | GraphQLObjectType<any, any>, GraphQLInputObjectType> | undefined;
|
|
1126
|
+
get interfaceMap(): Map<GraphQLObjectType<any, any>, GraphQLInterfaceType> | undefined;
|
|
1127
|
+
get configs(): Map<string | symbol, WeaverConfig> | undefined;
|
|
1128
|
+
get vendorWeavers(): Map<string, SchemaWeaver> | undefined;
|
|
1129
|
+
get names(): WeakMap<object, string>;
|
|
1130
|
+
get autoAliasTypes(): WeakSet<GraphQLNamedType>;
|
|
1131
|
+
get value(): WeaverContext | undefined;
|
|
1132
|
+
getConfig<TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]): TConfig | undefined;
|
|
1133
|
+
setConfig(config: WeaverConfig): void;
|
|
1134
|
+
deleteConfig(key: string | symbol): void;
|
|
1135
|
+
useConfig<TConfig extends WeaverConfig, TCallback extends () => any>(config: TConfig, callback: TCallback): ReturnType<TCallback>;
|
|
1136
|
+
getNamedType<T extends GraphQLOutputType>(name: string): T | undefined;
|
|
1137
|
+
memoNamedType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(gqlType: TGraphQLType): TGraphQLType;
|
|
1099
1138
|
getGraphQLType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(origin: object): TGraphQLType | undefined;
|
|
1100
1139
|
memoGraphQLType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(origin: object, gqlType: TGraphQLType): TGraphQLType;
|
|
1140
|
+
setAlias(namedType: GraphQLNamedType, alias: string | undefined): string | undefined;
|
|
1101
1141
|
}
|
|
1102
1142
|
declare const weaverContext: GlobalWeaverContext;
|
|
1103
|
-
declare function provideWeaverContext<T>(func: () => T, value: WeaverContext | undefined): T;
|
|
1104
|
-
declare namespace provideWeaverContext {
|
|
1105
|
-
var inherit: <T>(func: () => T) => () => T;
|
|
1106
|
-
}
|
|
1107
1143
|
/**
|
|
1108
1144
|
* collect names for schemas
|
|
1109
1145
|
* @param namesList - names to collect
|
|
@@ -1123,7 +1159,6 @@ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
|
|
|
1123
1159
|
declare class LoomObjectType extends GraphQLObjectType {
|
|
1124
1160
|
protected extraFields: Map<string, BaseField>;
|
|
1125
1161
|
protected hiddenFields: Set<string>;
|
|
1126
|
-
static AUTO_ALIASING: "__gqloom_auto_aliasing";
|
|
1127
1162
|
protected weaverContext: WeaverContext;
|
|
1128
1163
|
protected globalOptions?: ResolverOptions;
|
|
1129
1164
|
/**
|
|
@@ -1134,14 +1169,11 @@ declare class LoomObjectType extends GraphQLObjectType {
|
|
|
1134
1169
|
weaverContext?: WeaverContext;
|
|
1135
1170
|
globalOptions?: ResolverOptions;
|
|
1136
1171
|
});
|
|
1137
|
-
|
|
1138
|
-
protected _aliases: string[];
|
|
1139
|
-
get aliases(): string[];
|
|
1140
|
-
addAlias(name: string): void;
|
|
1141
|
-
protected renameByAliases(): void;
|
|
1172
|
+
addAlias(alias?: string): void;
|
|
1142
1173
|
hideField(name: string): void;
|
|
1143
1174
|
addField(name: string, field: BaseField, resolver: Resolver | undefined): void;
|
|
1144
1175
|
mergeExtensions(extensions: GraphQLObjectTypeConfig<any, any>["extensions"]): void;
|
|
1176
|
+
protected collectedFieldNames(): void;
|
|
1145
1177
|
private extraFieldMap?;
|
|
1146
1178
|
getFields(): GraphQLFieldMap<any, any>;
|
|
1147
1179
|
protected mapToFieldConfig(map: Map<string, BaseField>): Record<string, GraphQLFieldConfig<any, any>>;
|
|
@@ -1225,11 +1257,11 @@ declare const weave: typeof GraphQLSchemaLoom.weave;
|
|
|
1225
1257
|
//#endregion
|
|
1226
1258
|
//#region src/schema/input.d.ts
|
|
1227
1259
|
interface EnsureInputOptions {
|
|
1228
|
-
fieldName
|
|
1260
|
+
fieldName: string;
|
|
1229
1261
|
}
|
|
1230
|
-
declare function inputToArgs(input: GraphQLSilk | Record<string, GraphQLSilk> | undefined | void, options: EnsureInputOptions
|
|
1231
|
-
declare function ensureInputType(silkOrType: GraphQLType | GraphQLSilk, options: EnsureInputOptions
|
|
1232
|
-
declare function ensureInputObjectType(object: GraphQLObjectType | GraphQLInterfaceType | GraphQLInputObjectType, options: EnsureInputOptions
|
|
1262
|
+
declare function inputToArgs(input: GraphQLSilk | Record<string, GraphQLSilk> | undefined | void, options: EnsureInputOptions): GraphQLFieldConfigArgumentMap | undefined;
|
|
1263
|
+
declare function ensureInputType(silkOrType: GraphQLType | GraphQLSilk, options: EnsureInputOptions): GraphQLInputType;
|
|
1264
|
+
declare function ensureInputObjectType(object: GraphQLObjectType | GraphQLInterfaceType | GraphQLInputObjectType, options: EnsureInputOptions): GraphQLInputObjectType;
|
|
1233
1265
|
//#endregion
|
|
1234
1266
|
//#region src/schema/interface.d.ts
|
|
1235
1267
|
declare function ensureInterfaceType(gqlType: GraphQLOutputType, interfaceConfig?: Partial<GraphQLInterfaceTypeConfig<any, any>>): GraphQLInterfaceType;
|
|
@@ -1249,4 +1281,4 @@ interface GQLoomExtensionAttribute {
|
|
|
1249
1281
|
directives?: string[];
|
|
1250
1282
|
}
|
|
1251
1283
|
//#endregion
|
|
1252
|
-
export { BaseChainFactory, BaseField, BatchLoadFn, CallableInputParser, CallableMiddlewareOptions, ChainFactoryOptions, ChainResolver, CoreSchemaWeaverConfig, CoreSchemaWeaverConfigOptions, DirectiveItem, DirectiveRecord, EasyDataLoader, Executor, Field, FieldChainFactory, FieldFactory, FieldFactoryWithResolve, FieldFactoryWithUtils, FieldMeta, FieldOptions, FieldOrOperation, FieldOrOperationType, GQLoomExtensionAttribute, GQLoomExtensions, GlobalWeaverContext, GraphQLFieldOptions, GraphQLSchemaLoom, GraphQLSilk, IChainFactory, InferFieldInput, InferFieldOutput, InferInputI, InferInputO, IsAny, ListSilk, LoomDataLoader, LoomObjectType, MayPromise, Middleware, MiddlewareConfig, MiddlewareOperation, MiddlewareOptions, Mutation, MutationChainFactory, MutationFactory, MutationFactoryWithChain, MutationFactoryWithResolve, MutationOptions, NonNullSilk, NullableSilk, OPERATION_OBJECT_NAMES, ObjectChainResolver, OmitInUnion, OnlyMemoizationPayload, Operation, OperationType, Query, QueryChainFactory, QueryFactory, QueryFactoryWithChain, QueryFactoryWithResolve, QueryOptions, RequireKeys, ResolvableSubscription, Resolver, ResolverFactory, ResolverMeta, ResolverOptions, ResolverOptionsWithExtensions, ResolverOptionsWithParent, ResolverPayload, ResolvingFields, ResolvingOptions, SchemaWeaver, StandardSchemaV1, Subscription, SubscriptionChainFactory, SubscriptionFactory, SubscriptionFactoryWithChain, SubscriptionNeedResolve, SubscriptionOptions, ToExecutorProps, ValueOf, WeaverConfig, WeaverContext, applyMiddlewares, assignContextMap, capitalize, collectName, collectNames, createField, createInputParser, createMutation, createQuery, createSubscription, deepMerge, defaultSubscriptionResolve, ensureInputObjectType, ensureInputType, ensureInterfaceType, field, filterMiddlewares, getCacheType, getDeepResolvingFields, getFieldOptions, getGraphQLType, getMemoizationMap, getOperationOptions, getResolvingFields, getStandardValue, getSubscriptionOptions, initWeaverContext, inputToArgs, isOnlyMemoryPayload, isSchemaVendorWeaver, isSilk, listSilk, loom, mapValue, markErrorLocation, markLocation, meta, mutation$1 as mutation, nonNullSilk, notNullish, nullableSilk, onlyMemoization, parseInputValue, parseResolvingFields, parseSilk, pascalCase, provideWeaverContext, query$1 as query, resolver, screamingSnakeCase, silk, subscription$1 as subscription, symbols_d_exports, toObjMap, tryIn, types_loom_d_exports, weave, weaverContext };
|
|
1284
|
+
export { AUTO_ALIASING, BaseChainFactory, BaseField, BatchLoadFn, CallableInputParser, CallableMiddlewareOptions, ChainFactoryOptions, ChainResolver, CoreSchemaWeaverConfig, CoreSchemaWeaverConfigOptions, DERIVED_DEPENDENCIES, DirectiveItem, DirectiveRecord, EasyDataLoader, Executor, Field, FieldChainFactory, FieldFactory, FieldFactoryWithResolve, FieldFactoryWithUtils, FieldMeta, FieldOptions, FieldOrOperation, FieldOrOperationType, GQLoomExtensionAttribute, GQLoomExtensions, GlobalWeaverContext, GraphQLFieldOptions, GraphQLSchemaLoom, GraphQLSilk, IChainFactory, InferFieldInput, InferFieldOutput, InferInputI, InferInputO, IsAny, ListSilk, LoomDataLoader, LoomObjectType, MayPromise, Middleware, MiddlewareConfig, MiddlewareOperation, MiddlewareOptions, Mutation, MutationChainFactory, MutationFactory, MutationFactoryWithChain, MutationFactoryWithResolve, MutationOptions, NonNullSilk, NullableSilk, OPERATION_OBJECT_NAMES, ObjectChainResolver, OmitInUnion, OnlyMemoizationPayload, Operation, OperationType, Query, QueryChainFactory, QueryFactory, QueryFactoryWithChain, QueryFactoryWithResolve, QueryOptions, RequireKeys, ResolvableSubscription, Resolver, ResolverFactory, ResolverMeta, ResolverOptions, ResolverOptionsWithExtensions, ResolverOptionsWithParent, ResolverPayload, ResolvingFields, ResolvingOptions, SchemaWeaver, StandardSchemaV1, Subscription, SubscriptionChainFactory, SubscriptionFactory, SubscriptionFactoryWithChain, SubscriptionNeedResolve, SubscriptionOptions, ToExecutorProps, ValueOf, WeaverConfig, WeaverContext, applyMiddlewares, assignContextMap, capitalize, collectName, collectNames, createField, createInputParser, createMutation, createQuery, createSubscription, deepMerge, defaultSubscriptionResolve, ensureInputObjectType, ensureInputType, ensureInterfaceType, field, filterMiddlewares, getCacheType, getDeepResolvingFields, getFieldOptions, getGraphQLType, getMemoizationMap, getOperationOptions, getResolvingFields, getStandardValue, getSubscriptionOptions, initWeaverContext, inputToArgs, isOnlyMemoryPayload, isSchemaVendorWeaver, isSilk, listSilk, loom, mapValue, markErrorLocation, markLocation, meta, mutation$1 as mutation, nonNullSilk, notNullish, nullableSilk, onlyMemoization, parseInputValue, parseResolvingFields, parseSilk, pascalCase, provideWeaverContext, query$1 as query, resolver, screamingSnakeCase, silk, subscription$1 as subscription, symbols_d_exports, toObjMap, tryIn, types_loom_d_exports, weave, weaverContext };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, GraphQLFieldExtensions, GraphQLFieldMap, GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLInterfaceTypeConfig, GraphQLList, GraphQLNamedType, GraphQLNonNull, GraphQLNullableType, GraphQLObjectType, GraphQLObjectTypeConfig, GraphQLOutputType, GraphQLResolveInfo, GraphQLScalarType, GraphQLSchema, GraphQLSchemaConfig, GraphQLType, GraphQLUnionType } from "graphql";
|
|
2
2
|
|
|
3
|
-
//#region rolldown:runtime
|
|
4
|
-
//#endregion
|
|
5
3
|
//#region src/utils/types.d.ts
|
|
6
4
|
type MayPromise<T> = T | Promise<T>;
|
|
7
5
|
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
@@ -1061,6 +1059,10 @@ interface ContextMemoryContainer {
|
|
|
1061
1059
|
}
|
|
1062
1060
|
declare function assignContextMap(target: ContextMemoryContainer): WeakMap<WeakKey, any>;
|
|
1063
1061
|
//#endregion
|
|
1062
|
+
//#region src/utils/constants.d.ts
|
|
1063
|
+
declare const DERIVED_DEPENDENCIES = "loom.derived-from-dependencies";
|
|
1064
|
+
declare const AUTO_ALIASING = "__gqloom_auto_aliasing";
|
|
1065
|
+
//#endregion
|
|
1064
1066
|
//#region src/schema/schema-weaver.d.ts
|
|
1065
1067
|
interface SchemaWeaver {
|
|
1066
1068
|
vendor: string;
|
|
@@ -1069,43 +1071,73 @@ interface SchemaWeaver {
|
|
|
1069
1071
|
declare function isSchemaVendorWeaver(some: any): some is SchemaWeaver;
|
|
1070
1072
|
//#endregion
|
|
1071
1073
|
//#region src/schema/weaver-context.d.ts
|
|
1072
|
-
|
|
1074
|
+
declare class WeaverContext {
|
|
1075
|
+
static increasingID: number;
|
|
1076
|
+
static names: WeakMap<object, string>;
|
|
1077
|
+
static autoAliasTypes: WeakSet<GraphQLNamedType>;
|
|
1078
|
+
private static _ref;
|
|
1079
|
+
static get ref(): WeaverContext | undefined;
|
|
1073
1080
|
id: number;
|
|
1074
1081
|
loomObjectMap: Map<GraphQLObjectType, LoomObjectType>;
|
|
1075
1082
|
loomUnionMap: Map<GraphQLUnionType, GraphQLUnionType>;
|
|
1076
1083
|
inputMap: Map<GraphQLObjectType | GraphQLInterfaceType, GraphQLInputObjectType>;
|
|
1077
1084
|
interfaceMap: Map<GraphQLObjectType, GraphQLInterfaceType>;
|
|
1078
1085
|
configs: Map<string | symbol, WeaverConfig>;
|
|
1079
|
-
getConfig: <TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]) => TConfig | undefined;
|
|
1080
|
-
setConfig<TConfig extends WeaverConfig>(config: TConfig): void;
|
|
1081
|
-
deleteConfig: <TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]) => void;
|
|
1082
1086
|
namedTypes: Map<string, GraphQLOutputType>;
|
|
1083
|
-
memoNamedType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(gqlType: TGraphQLType): TGraphQLType;
|
|
1084
|
-
getNamedType<T extends GraphQLOutputType>(name: string): T | undefined;
|
|
1085
|
-
names: WeakMap<object, string>;
|
|
1086
1087
|
vendorWeavers: Map<string, SchemaWeaver>;
|
|
1088
|
+
constructor();
|
|
1089
|
+
getConfig<TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]): TConfig | undefined;
|
|
1090
|
+
setConfig<TConfig extends WeaverConfig>(config: TConfig): void;
|
|
1091
|
+
deleteConfig<TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]): void;
|
|
1092
|
+
memoNamedType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(gqlTypeValue: TGraphQLType): TGraphQLType;
|
|
1093
|
+
getNamedType<T extends GraphQLOutputType>(name: string): T | undefined;
|
|
1094
|
+
protected static readonly namedTypes: {
|
|
1095
|
+
readonly Object: "Object";
|
|
1096
|
+
readonly Union: "Union";
|
|
1097
|
+
readonly Enum: "Enum";
|
|
1098
|
+
readonly Interface: "Interface";
|
|
1099
|
+
readonly Scalar: "Scalar";
|
|
1100
|
+
};
|
|
1101
|
+
protected aliasCounters: Partial<Record<keyof typeof WeaverContext.namedTypes, number>>;
|
|
1102
|
+
setAlias(namedType: GraphQLNamedType, alias: string | undefined): string | undefined;
|
|
1103
|
+
/**
|
|
1104
|
+
* @returns -1 if a is better than b, 1 if b is better than a, 0 if they are equal
|
|
1105
|
+
*/
|
|
1106
|
+
protected static higherPriorityThan(a: string | undefined, b: string | undefined): number;
|
|
1107
|
+
static provide<T>(func: () => T, value: WeaverContext | undefined): T;
|
|
1087
1108
|
}
|
|
1109
|
+
declare const initWeaverContext: () => WeaverContext;
|
|
1110
|
+
declare const provideWeaverContext: typeof WeaverContext.provide & {
|
|
1111
|
+
inherit: <T>(func: () => T) => () => T;
|
|
1112
|
+
};
|
|
1088
1113
|
interface WeaverConfig {
|
|
1089
1114
|
[WEAVER_CONFIG]: string | symbol;
|
|
1090
1115
|
vendorWeaver?: SchemaWeaver;
|
|
1091
1116
|
}
|
|
1092
|
-
|
|
1093
|
-
declare
|
|
1094
|
-
var increasingID: number;
|
|
1095
|
-
}
|
|
1096
|
-
type GlobalContextRequiredKeys = "names" | "getConfig" | "setConfig" | "deleteConfig" | "getNamedType" | "memoNamedType";
|
|
1097
|
-
interface GlobalWeaverContext extends Partial<Omit<WeaverContext, GlobalContextRequiredKeys>>, Pick<WeaverContext, GlobalContextRequiredKeys> {
|
|
1098
|
-
value?: WeaverContext;
|
|
1099
|
-
useConfig<TConfig extends WeaverConfig, TCallback extends () => any>(config: TConfig, callback: TCallback): ReturnType<TCallback>;
|
|
1117
|
+
type GlobalContextRequiredKeys = "getConfig" | "setConfig" | "deleteConfig" | "getNamedType" | "memoNamedType";
|
|
1118
|
+
declare class GlobalWeaverContext implements Partial<Omit<WeaverContext, GlobalContextRequiredKeys>>, Pick<WeaverContext, GlobalContextRequiredKeys> {
|
|
1100
1119
|
GraphQLTypes: WeakMap<object, GraphQLOutputType>;
|
|
1120
|
+
get id(): number | undefined;
|
|
1121
|
+
get loomObjectMap(): Map<GraphQLObjectType<any, any>, LoomObjectType> | undefined;
|
|
1122
|
+
get loomUnionMap(): Map<GraphQLUnionType, GraphQLUnionType> | undefined;
|
|
1123
|
+
get inputMap(): Map<GraphQLInterfaceType | GraphQLObjectType<any, any>, GraphQLInputObjectType> | undefined;
|
|
1124
|
+
get interfaceMap(): Map<GraphQLObjectType<any, any>, GraphQLInterfaceType> | undefined;
|
|
1125
|
+
get configs(): Map<string | symbol, WeaverConfig> | undefined;
|
|
1126
|
+
get vendorWeavers(): Map<string, SchemaWeaver> | undefined;
|
|
1127
|
+
get names(): WeakMap<object, string>;
|
|
1128
|
+
get autoAliasTypes(): WeakSet<GraphQLNamedType>;
|
|
1129
|
+
get value(): WeaverContext | undefined;
|
|
1130
|
+
getConfig<TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]): TConfig | undefined;
|
|
1131
|
+
setConfig(config: WeaverConfig): void;
|
|
1132
|
+
deleteConfig(key: string | symbol): void;
|
|
1133
|
+
useConfig<TConfig extends WeaverConfig, TCallback extends () => any>(config: TConfig, callback: TCallback): ReturnType<TCallback>;
|
|
1134
|
+
getNamedType<T extends GraphQLOutputType>(name: string): T | undefined;
|
|
1135
|
+
memoNamedType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(gqlType: TGraphQLType): TGraphQLType;
|
|
1101
1136
|
getGraphQLType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(origin: object): TGraphQLType | undefined;
|
|
1102
1137
|
memoGraphQLType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(origin: object, gqlType: TGraphQLType): TGraphQLType;
|
|
1138
|
+
setAlias(namedType: GraphQLNamedType, alias: string | undefined): string | undefined;
|
|
1103
1139
|
}
|
|
1104
1140
|
declare const weaverContext: GlobalWeaverContext;
|
|
1105
|
-
declare function provideWeaverContext<T>(func: () => T, value: WeaverContext | undefined): T;
|
|
1106
|
-
declare namespace provideWeaverContext {
|
|
1107
|
-
var inherit: <T>(func: () => T) => () => T;
|
|
1108
|
-
}
|
|
1109
1141
|
/**
|
|
1110
1142
|
* collect names for schemas
|
|
1111
1143
|
* @param namesList - names to collect
|
|
@@ -1125,7 +1157,6 @@ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
|
|
|
1125
1157
|
declare class LoomObjectType extends GraphQLObjectType {
|
|
1126
1158
|
protected extraFields: Map<string, BaseField>;
|
|
1127
1159
|
protected hiddenFields: Set<string>;
|
|
1128
|
-
static AUTO_ALIASING: "__gqloom_auto_aliasing";
|
|
1129
1160
|
protected weaverContext: WeaverContext;
|
|
1130
1161
|
protected globalOptions?: ResolverOptions;
|
|
1131
1162
|
/**
|
|
@@ -1136,14 +1167,11 @@ declare class LoomObjectType extends GraphQLObjectType {
|
|
|
1136
1167
|
weaverContext?: WeaverContext;
|
|
1137
1168
|
globalOptions?: ResolverOptions;
|
|
1138
1169
|
});
|
|
1139
|
-
|
|
1140
|
-
protected _aliases: string[];
|
|
1141
|
-
get aliases(): string[];
|
|
1142
|
-
addAlias(name: string): void;
|
|
1143
|
-
protected renameByAliases(): void;
|
|
1170
|
+
addAlias(alias?: string): void;
|
|
1144
1171
|
hideField(name: string): void;
|
|
1145
1172
|
addField(name: string, field: BaseField, resolver: Resolver | undefined): void;
|
|
1146
1173
|
mergeExtensions(extensions: GraphQLObjectTypeConfig<any, any>["extensions"]): void;
|
|
1174
|
+
protected collectedFieldNames(): void;
|
|
1147
1175
|
private extraFieldMap?;
|
|
1148
1176
|
getFields(): GraphQLFieldMap<any, any>;
|
|
1149
1177
|
protected mapToFieldConfig(map: Map<string, BaseField>): Record<string, GraphQLFieldConfig<any, any>>;
|
|
@@ -1227,11 +1255,11 @@ declare const weave: typeof GraphQLSchemaLoom.weave;
|
|
|
1227
1255
|
//#endregion
|
|
1228
1256
|
//#region src/schema/input.d.ts
|
|
1229
1257
|
interface EnsureInputOptions {
|
|
1230
|
-
fieldName
|
|
1258
|
+
fieldName: string;
|
|
1231
1259
|
}
|
|
1232
|
-
declare function inputToArgs(input: GraphQLSilk | Record<string, GraphQLSilk> | undefined | void, options: EnsureInputOptions
|
|
1233
|
-
declare function ensureInputType(silkOrType: GraphQLType | GraphQLSilk, options: EnsureInputOptions
|
|
1234
|
-
declare function ensureInputObjectType(object: GraphQLObjectType | GraphQLInterfaceType | GraphQLInputObjectType, options: EnsureInputOptions
|
|
1260
|
+
declare function inputToArgs(input: GraphQLSilk | Record<string, GraphQLSilk> | undefined | void, options: EnsureInputOptions): GraphQLFieldConfigArgumentMap | undefined;
|
|
1261
|
+
declare function ensureInputType(silkOrType: GraphQLType | GraphQLSilk, options: EnsureInputOptions): GraphQLInputType;
|
|
1262
|
+
declare function ensureInputObjectType(object: GraphQLObjectType | GraphQLInterfaceType | GraphQLInputObjectType, options: EnsureInputOptions): GraphQLInputObjectType;
|
|
1235
1263
|
//#endregion
|
|
1236
1264
|
//#region src/schema/interface.d.ts
|
|
1237
1265
|
declare function ensureInterfaceType(gqlType: GraphQLOutputType, interfaceConfig?: Partial<GraphQLInterfaceTypeConfig<any, any>>): GraphQLInterfaceType;
|
|
@@ -1251,4 +1279,4 @@ interface GQLoomExtensionAttribute {
|
|
|
1251
1279
|
directives?: string[];
|
|
1252
1280
|
}
|
|
1253
1281
|
//#endregion
|
|
1254
|
-
export { BaseChainFactory, BaseField, BatchLoadFn, CallableInputParser, CallableMiddlewareOptions, ChainFactoryOptions, ChainResolver, CoreSchemaWeaverConfig, CoreSchemaWeaverConfigOptions, DirectiveItem, DirectiveRecord, EasyDataLoader, Executor, Field, FieldChainFactory, FieldFactory, FieldFactoryWithResolve, FieldFactoryWithUtils, FieldMeta, FieldOptions, FieldOrOperation, FieldOrOperationType, GQLoomExtensionAttribute, GQLoomExtensions, GlobalWeaverContext, GraphQLFieldOptions, GraphQLSchemaLoom, GraphQLSilk, IChainFactory, InferFieldInput, InferFieldOutput, InferInputI, InferInputO, IsAny, ListSilk, LoomDataLoader, LoomObjectType, MayPromise, Middleware, MiddlewareConfig, MiddlewareOperation, MiddlewareOptions, Mutation, MutationChainFactory, MutationFactory, MutationFactoryWithChain, MutationFactoryWithResolve, MutationOptions, NonNullSilk, NullableSilk, OPERATION_OBJECT_NAMES, ObjectChainResolver, OmitInUnion, OnlyMemoizationPayload, Operation, OperationType, Query, QueryChainFactory, QueryFactory, QueryFactoryWithChain, QueryFactoryWithResolve, QueryOptions, RequireKeys, ResolvableSubscription, Resolver, ResolverFactory, ResolverMeta, ResolverOptions, ResolverOptionsWithExtensions, ResolverOptionsWithParent, ResolverPayload, ResolvingFields, ResolvingOptions, SchemaWeaver, StandardSchemaV1, Subscription, SubscriptionChainFactory, SubscriptionFactory, SubscriptionFactoryWithChain, SubscriptionNeedResolve, SubscriptionOptions, ToExecutorProps, ValueOf, WeaverConfig, WeaverContext, applyMiddlewares, assignContextMap, capitalize, collectName, collectNames, createField, createInputParser, createMutation, createQuery, createSubscription, deepMerge, defaultSubscriptionResolve, ensureInputObjectType, ensureInputType, ensureInterfaceType, field, filterMiddlewares, getCacheType, getDeepResolvingFields, getFieldOptions, getGraphQLType, getMemoizationMap, getOperationOptions, getResolvingFields, getStandardValue, getSubscriptionOptions, initWeaverContext, inputToArgs, isOnlyMemoryPayload, isSchemaVendorWeaver, isSilk, listSilk, loom, mapValue, markErrorLocation, markLocation, meta, mutation$1 as mutation, nonNullSilk, notNullish, nullableSilk, onlyMemoization, parseInputValue, parseResolvingFields, parseSilk, pascalCase, provideWeaverContext, query$1 as query, resolver, screamingSnakeCase, silk, subscription$1 as subscription, symbols_d_exports, toObjMap, tryIn, types_loom_d_exports, weave, weaverContext };
|
|
1282
|
+
export { AUTO_ALIASING, BaseChainFactory, BaseField, BatchLoadFn, CallableInputParser, CallableMiddlewareOptions, ChainFactoryOptions, ChainResolver, CoreSchemaWeaverConfig, CoreSchemaWeaverConfigOptions, DERIVED_DEPENDENCIES, DirectiveItem, DirectiveRecord, EasyDataLoader, Executor, Field, FieldChainFactory, FieldFactory, FieldFactoryWithResolve, FieldFactoryWithUtils, FieldMeta, FieldOptions, FieldOrOperation, FieldOrOperationType, GQLoomExtensionAttribute, GQLoomExtensions, GlobalWeaverContext, GraphQLFieldOptions, GraphQLSchemaLoom, GraphQLSilk, IChainFactory, InferFieldInput, InferFieldOutput, InferInputI, InferInputO, IsAny, ListSilk, LoomDataLoader, LoomObjectType, MayPromise, Middleware, MiddlewareConfig, MiddlewareOperation, MiddlewareOptions, Mutation, MutationChainFactory, MutationFactory, MutationFactoryWithChain, MutationFactoryWithResolve, MutationOptions, NonNullSilk, NullableSilk, OPERATION_OBJECT_NAMES, ObjectChainResolver, OmitInUnion, OnlyMemoizationPayload, Operation, OperationType, Query, QueryChainFactory, QueryFactory, QueryFactoryWithChain, QueryFactoryWithResolve, QueryOptions, RequireKeys, ResolvableSubscription, Resolver, ResolverFactory, ResolverMeta, ResolverOptions, ResolverOptionsWithExtensions, ResolverOptionsWithParent, ResolverPayload, ResolvingFields, ResolvingOptions, SchemaWeaver, StandardSchemaV1, Subscription, SubscriptionChainFactory, SubscriptionFactory, SubscriptionFactoryWithChain, SubscriptionNeedResolve, SubscriptionOptions, ToExecutorProps, ValueOf, WeaverConfig, WeaverContext, applyMiddlewares, assignContextMap, capitalize, collectName, collectNames, createField, createInputParser, createMutation, createQuery, createSubscription, deepMerge, defaultSubscriptionResolve, ensureInputObjectType, ensureInputType, ensureInterfaceType, field, filterMiddlewares, getCacheType, getDeepResolvingFields, getFieldOptions, getGraphQLType, getMemoizationMap, getOperationOptions, getResolvingFields, getStandardValue, getSubscriptionOptions, initWeaverContext, inputToArgs, isOnlyMemoryPayload, isSchemaVendorWeaver, isSilk, listSilk, loom, mapValue, markErrorLocation, markLocation, meta, mutation$1 as mutation, nonNullSilk, notNullish, nullableSilk, onlyMemoization, parseInputValue, parseResolvingFields, parseSilk, pascalCase, provideWeaverContext, query$1 as query, resolver, screamingSnakeCase, silk, subscription$1 as subscription, symbols_d_exports, toObjMap, tryIn, types_loom_d_exports, weave, weaverContext };
|