@gqloom/core 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.
- package/README.md +29 -0
- package/README.zh-CN.md +267 -0
- package/dist/index.cjs +1238 -0
- package/dist/index.d.cts +577 -0
- package/dist/index.d.ts +577 -0
- package/dist/index.js +1198 -0
- package/package.json +35 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
import { GraphQLOutputType, GraphQLObjectTypeConfig, GraphQLFieldConfig, GraphQLResolveInfo, GraphQLScalarType, GraphQLObjectType, GraphQLUnionType, GraphQLInterfaceType, GraphQLInputObjectType, GraphQLSchemaConfig, GraphQLFieldMap, GraphQLNamedType, GraphQLSchema, GraphQLFieldConfigArgumentMap, GraphQLType, GraphQLInputType, GraphQLInterfaceTypeConfig, GraphQLFieldExtensions, GraphQLObjectTypeExtensions } from 'graphql';
|
|
2
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
3
|
+
|
|
4
|
+
type MayPromise<T> = T | Promise<T>;
|
|
5
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
6
|
+
/**
|
|
7
|
+
* @example
|
|
8
|
+
* ```TypeScript
|
|
9
|
+
* type A = { a?: { b?: { c: string } } }
|
|
10
|
+
* type B = InferPropertyType<A, "a"> // { b?: { c: string } }
|
|
11
|
+
* type C = InferPropertyType<A, "a.b"> // { c: string }
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
type InferPropertyType<T, K extends string> = K extends `${infer K1}.${infer K2}` ? K1 extends keyof T ? InferPropertyType<NonNullable<T[K1]>, K2> : never : K extends keyof T ? T[K] : never;
|
|
15
|
+
/**
|
|
16
|
+
* @example
|
|
17
|
+
* ```TypeScript
|
|
18
|
+
* type C = { c: string }
|
|
19
|
+
* type A = WrapPropertyType<"a", C> // { a: C }
|
|
20
|
+
* type B = WrapPropertyType<"a.b", C> // { a: { b: C } }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
type WrapPropertyType<TKey extends string, TProperty> = TKey extends `${infer TFirst}.${infer TRest}` ? {
|
|
24
|
+
[K in TFirst]: WrapPropertyType<TRest, TProperty>;
|
|
25
|
+
} : {
|
|
26
|
+
[K in TKey]: TProperty;
|
|
27
|
+
};
|
|
28
|
+
type ObjectOrNever<T> = T extends object ? T : never;
|
|
29
|
+
type ValueOf<T extends object> = T[keyof T];
|
|
30
|
+
|
|
31
|
+
type InputSchema<TBaseSchema> = TBaseSchema | Record<string, TBaseSchema> | undefined;
|
|
32
|
+
type InputSchemaToSilk<TSchemaIO extends AbstractSchemaIO, TInput extends InputSchema<TSchemaIO[0]>> = TInput extends undefined ? undefined : TInput extends TSchemaIO[0] ? SchemaToSilk<TSchemaIO, TInput> : {
|
|
33
|
+
[K in keyof TInput]: TInput[K] extends TSchemaIO[0] ? SchemaToSilk<TSchemaIO, TInput[K]> : never;
|
|
34
|
+
};
|
|
35
|
+
type InferInputI<TInput extends object | undefined, TSchemaIO extends AbstractSchemaIO> = TInput extends undefined ? undefined : TInput extends TSchemaIO[0] ? ObjectOrNever<InferSchemaI<TInput, TSchemaIO>> : {
|
|
36
|
+
[K in keyof TInput]: InferSchemaI<TInput[K], TSchemaIO>;
|
|
37
|
+
};
|
|
38
|
+
type InferInputO<TInput extends object | undefined, TSchemaIO extends AbstractSchemaIO> = TInput extends undefined ? undefined : TInput extends TSchemaIO[0] ? ObjectOrNever<InferSchemaO<TInput, TSchemaIO>> : {
|
|
39
|
+
[K in keyof TInput]: InferSchemaO<TInput[K], TSchemaIO>;
|
|
40
|
+
};
|
|
41
|
+
interface CallableInputParser<TSchema extends InputSchema<GraphQLSilk>> {
|
|
42
|
+
/**
|
|
43
|
+
* input schema
|
|
44
|
+
*/
|
|
45
|
+
schema: TSchema;
|
|
46
|
+
/**
|
|
47
|
+
* Origin value to parse
|
|
48
|
+
*/
|
|
49
|
+
value: InferInputI<TSchema, GraphQLSilkIO>;
|
|
50
|
+
/**
|
|
51
|
+
* Parse the input and return the
|
|
52
|
+
*/
|
|
53
|
+
(): Promise<InferInputO<TSchema, GraphQLSilkIO>>;
|
|
54
|
+
/**
|
|
55
|
+
* Result of parsing. Set it to `undefined` then the parser will run again.
|
|
56
|
+
*/
|
|
57
|
+
result: InferInputO<TSchema, GraphQLSilkIO> | undefined;
|
|
58
|
+
}
|
|
59
|
+
declare function createInputParser<TSchema extends InputSchema<GraphQLSilk> | undefined>(schema: TSchema, value: InferInputI<TSchema, GraphQLSilkIO>): CallableInputParser<TSchema>;
|
|
60
|
+
declare function parseInputValue<TSchema extends InputSchema<GraphQLSilk> | undefined>(inputSchema: TSchema, input: any): MayPromise<InferInputO<TSchema, GraphQLSilkIO>>;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The symbol to get GraphQL type for schema
|
|
64
|
+
*/
|
|
65
|
+
declare const GET_GRAPHQL_TYPE: unique symbol;
|
|
66
|
+
/**
|
|
67
|
+
* The symbol to validate and transform input to output
|
|
68
|
+
*/
|
|
69
|
+
declare const PARSE: unique symbol;
|
|
70
|
+
/**
|
|
71
|
+
* The symbol to get and store weaver config
|
|
72
|
+
*/
|
|
73
|
+
declare const WEAVER_CONFIG: unique symbol;
|
|
74
|
+
/**
|
|
75
|
+
* The symbol to get resolver options
|
|
76
|
+
*/
|
|
77
|
+
declare const RESOLVER_OPTIONS_KEY: unique symbol;
|
|
78
|
+
/**
|
|
79
|
+
* The symbol to assign a WeakMap to an object
|
|
80
|
+
*/
|
|
81
|
+
declare const CONTEXT_MEMORY_MAP_KEY: unique symbol;
|
|
82
|
+
|
|
83
|
+
declare const symbols_CONTEXT_MEMORY_MAP_KEY: typeof CONTEXT_MEMORY_MAP_KEY;
|
|
84
|
+
declare const symbols_GET_GRAPHQL_TYPE: typeof GET_GRAPHQL_TYPE;
|
|
85
|
+
declare const symbols_PARSE: typeof PARSE;
|
|
86
|
+
declare const symbols_RESOLVER_OPTIONS_KEY: typeof RESOLVER_OPTIONS_KEY;
|
|
87
|
+
declare const symbols_WEAVER_CONFIG: typeof WEAVER_CONFIG;
|
|
88
|
+
declare namespace symbols {
|
|
89
|
+
export { symbols_CONTEXT_MEMORY_MAP_KEY as CONTEXT_MEMORY_MAP_KEY, symbols_GET_GRAPHQL_TYPE as GET_GRAPHQL_TYPE, symbols_PARSE as PARSE, symbols_RESOLVER_OPTIONS_KEY as RESOLVER_OPTIONS_KEY, symbols_WEAVER_CONFIG as WEAVER_CONFIG };
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
interface GraphQLSilk<TOutput = any, TInput = any> {
|
|
93
|
+
/**
|
|
94
|
+
* GraphQL type for schema
|
|
95
|
+
*/
|
|
96
|
+
[GET_GRAPHQL_TYPE]: () => GraphQLOutputType;
|
|
97
|
+
/**
|
|
98
|
+
* validate and transform input to output
|
|
99
|
+
*/
|
|
100
|
+
[PARSE]?: (input: TInput) => MayPromise<TOutput>;
|
|
101
|
+
/**
|
|
102
|
+
* Input and output type.
|
|
103
|
+
*
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
readonly "~types"?: {
|
|
107
|
+
readonly input: TInput;
|
|
108
|
+
readonly output: TOutput;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
type AbstractSchemaIO = [
|
|
112
|
+
baseSchema: object,
|
|
113
|
+
inputPath: string,
|
|
114
|
+
outputPath: string
|
|
115
|
+
];
|
|
116
|
+
type GraphQLSilkIO = [
|
|
117
|
+
object: GraphQLSilk,
|
|
118
|
+
input: "~types.input",
|
|
119
|
+
output: "~types.output"
|
|
120
|
+
];
|
|
121
|
+
type InferSilkI<T extends GraphQLSilk> = NonNullable<T["~types"]>["input"];
|
|
122
|
+
type InferSilkO<T extends GraphQLSilk> = NonNullable<T["~types"]>["output"];
|
|
123
|
+
type InferSchemaI<TSchema, TSchemaIO extends AbstractSchemaIO> = InferPropertyType<TSchema, TSchemaIO[1]>;
|
|
124
|
+
type InferSchemaO<TSchema, TSchemaIO extends AbstractSchemaIO> = InferPropertyType<TSchema, TSchemaIO[2]>;
|
|
125
|
+
type SchemaToSilk<TSchemaIO extends AbstractSchemaIO, TSchema extends TSchemaIO[0]> = GraphQLSilk<InferSchemaO<TSchema, TSchemaIO>, InferSchemaI<TSchema, TSchemaIO>>;
|
|
126
|
+
interface ResolverOptions<TField extends GenericFieldOrOperation = GenericFieldOrOperation> {
|
|
127
|
+
middlewares?: Middleware<TField>[];
|
|
128
|
+
}
|
|
129
|
+
interface ResolverOptionsWithExtensions<TField extends GenericFieldOrOperation = GenericFieldOrOperation> extends ResolverOptions<TField>, Pick<GraphQLObjectTypeConfig<any, any>, "extensions"> {
|
|
130
|
+
}
|
|
131
|
+
interface ResolverOptionsWithParent<TField extends GenericFieldOrOperation = GenericFieldOrOperation> extends ResolverOptionsWithExtensions<TField> {
|
|
132
|
+
parent?: TField extends FieldOrOperation<infer TParent, any, any, any> ? TParent : undefined;
|
|
133
|
+
}
|
|
134
|
+
interface ResolvingOptions extends Pick<ResolverOptions, "middlewares"> {
|
|
135
|
+
}
|
|
136
|
+
type OperationType = "query" | "mutation" | "subscription";
|
|
137
|
+
type FieldOrOperationType = "field" | OperationType;
|
|
138
|
+
interface GraphQLFieldOptions extends Pick<GraphQLFieldConfig<any, any>, "description" | "deprecationReason" | "extensions"> {
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Operation or Field for resolver.
|
|
142
|
+
*/
|
|
143
|
+
interface FieldOrOperation<TParent extends undefined | GraphQLSilk, TOutput extends GraphQLSilk, TInput extends InputSchema<GraphQLSilk> | undefined = undefined, TType extends FieldOrOperationType = FieldOrOperationType> extends GraphQLFieldOptions {
|
|
144
|
+
type: TType;
|
|
145
|
+
input: TInput;
|
|
146
|
+
output: TOutput;
|
|
147
|
+
resolve: TType extends "field" ? (parent: InferSilkO<NonNullable<TParent>>, input: InferInputI<TInput, GraphQLSilkIO>, options?: ResolvingOptions) => Promise<InferSilkO<TOutput>> : TType extends "subscription" ? (value: any, input: InferInputI<TInput, GraphQLSilkIO>) => Promise<InferSilkO<TOutput>> : (input: InferInputI<TInput, GraphQLSilkIO>, options?: ResolvingOptions) => Promise<InferSilkO<TOutput>>;
|
|
148
|
+
subscribe?: TType extends "subscription" ? (input: InferInputI<TInput, GraphQLSilkIO>, options?: ResolvingOptions) => MayPromise<AsyncIterator<any>> : undefined;
|
|
149
|
+
}
|
|
150
|
+
type GenericFieldOrOperation = FieldOrOperation<any, any, any, any>;
|
|
151
|
+
type InferFieldParent<TField extends GenericFieldOrOperation> = TField extends FieldOrOperation<infer TParent, any, any, any> ? TParent : never;
|
|
152
|
+
type InferFieldInput<TField extends GenericFieldOrOperation> = TField extends FieldOrOperation<any, any, infer TInput, any> ? TInput : never;
|
|
153
|
+
type InferFieldOutput<TField extends GenericFieldOrOperation> = TField extends FieldOrOperation<any, infer TOutput, any, any> ? TOutput : never;
|
|
154
|
+
/**
|
|
155
|
+
* Options for creating a GraphQL Query or Mutation.
|
|
156
|
+
*/
|
|
157
|
+
interface QueryMutationOptions<TSchemaIO extends AbstractSchemaIO, TOutput extends TSchemaIO[0], TInput extends InputSchema<TSchemaIO[0]> = undefined> extends ResolverOptions<FieldOrOperation<undefined, SchemaToSilk<TSchemaIO, TOutput>, InputSchemaToSilk<TSchemaIO, TInput>, "query" | "mutation">>, GraphQLFieldOptions {
|
|
158
|
+
input?: TInput;
|
|
159
|
+
resolve: (input: InferInputO<TInput, TSchemaIO>) => MayPromise<InferSchemaO<TOutput, TSchemaIO>>;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Function to create a GraphQL query or mutation.
|
|
163
|
+
*/
|
|
164
|
+
interface QueryMutationBobbin<TSchemaIO extends AbstractSchemaIO> {
|
|
165
|
+
<TOutput extends TSchemaIO[0], TInput extends InputSchema<TSchemaIO[0]> = undefined>(output: TOutput, resolveOrOptions: (() => MayPromise<InferSchemaO<TOutput, TSchemaIO>>) | QueryMutationOptions<TSchemaIO, TOutput, TInput>): FieldOrOperation<undefined, SchemaToSilk<TSchemaIO, TOutput>, InputSchemaToSilk<TSchemaIO, TInput>, "query" | "mutation">;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Options for External Filed of existing GraphQL Object.
|
|
169
|
+
*/
|
|
170
|
+
interface FieldOptions<TSchemaIO extends AbstractSchemaIO, TParent extends TSchemaIO[0], TOutput extends TSchemaIO[0], TInput extends InputSchema<TSchemaIO[0]> = undefined> extends ResolverOptions<FieldOrOperation<SchemaToSilk<TSchemaIO, TParent>, SchemaToSilk<TSchemaIO, TOutput>, InputSchemaToSilk<TSchemaIO, TInput>, "field">>, GraphQLFieldOptions {
|
|
171
|
+
input?: TInput;
|
|
172
|
+
resolve: (parent: InferSchemaO<TParent, TSchemaIO>, input: InferInputO<TInput, TSchemaIO>) => MayPromise<InferSchemaO<TOutput, TSchemaIO>>;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Function to create a GraphQL Field.
|
|
176
|
+
*/
|
|
177
|
+
interface FieldBobbin<TSchemaIO extends AbstractSchemaIO> {
|
|
178
|
+
<TParent extends TSchemaIO[0], TOutput extends TSchemaIO[0], TInput extends InputSchema<TSchemaIO[0]> = undefined>(output: TOutput, resolveOrOptions: ((parent: InferSchemaO<TParent, TSchemaIO>) => MayPromise<InferSchemaO<TOutput, TSchemaIO>>) | FieldOptions<TSchemaIO, TParent, TOutput, TInput>): FieldOrOperation<SchemaToSilk<TSchemaIO, TParent>, SchemaToSilk<TSchemaIO, TOutput>, InputSchemaToSilk<TSchemaIO, TInput>, "field">;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Options for creating a GraphQL Subscription.
|
|
182
|
+
*/
|
|
183
|
+
interface SubscriptionOptions<TSchemaIO extends AbstractSchemaIO, TOutput extends TSchemaIO[0], TInput extends InputSchema<TSchemaIO[0]> = undefined, TValue = InferSchemaO<TOutput, TSchemaIO>> extends ResolverOptions<Subscription<SchemaToSilk<TSchemaIO, TOutput>, InputSchemaToSilk<TSchemaIO, TInput>, TValue>>, GraphQLFieldOptions {
|
|
184
|
+
input?: TInput;
|
|
185
|
+
subscribe: (input: InferInputO<TInput, TSchemaIO>) => MayPromise<AsyncIterator<TValue>>;
|
|
186
|
+
resolve?: (value: TValue, input: InferInputO<TInput, TSchemaIO>) => MayPromise<InferSchemaO<TOutput, TSchemaIO>>;
|
|
187
|
+
}
|
|
188
|
+
interface Subscription<TOutput extends GraphQLSilk, TInput extends InputSchema<GraphQLSilk> = undefined, TValue = InferSilkO<TOutput>> extends FieldOrOperation<undefined, TOutput, TInput, "subscription"> {
|
|
189
|
+
resolve: (value: TValue, input: InferInputI<TInput, GraphQLSilkIO>) => Promise<InferSilkO<TOutput>>;
|
|
190
|
+
subscribe: (input: InferInputI<TInput, GraphQLSilkIO>, options?: ResolvingOptions) => MayPromise<AsyncIterator<TValue>>;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Function to create a GraphQL subscription.
|
|
194
|
+
*/
|
|
195
|
+
interface SubscriptionBobbin<TSchemaIO extends AbstractSchemaIO> {
|
|
196
|
+
<TOutput extends TSchemaIO[0], TInput extends InputSchema<TSchemaIO[0]> = undefined, TValue = InferSchemaO<TOutput, TSchemaIO>>(output: TOutput, subscribeOrOptions: (() => MayPromise<AsyncIterator<InferSchemaO<TOutput, TSchemaIO>>>) | SubscriptionOptions<TSchemaIO, TOutput, TInput, TValue>): Subscription<SchemaToSilk<TSchemaIO, TOutput>, InputSchemaToSilk<TSchemaIO, TInput>, TValue>;
|
|
197
|
+
}
|
|
198
|
+
interface ResolverBobbin<TSchemaIO extends AbstractSchemaIO> {
|
|
199
|
+
of<TParent extends TSchemaIO[0], TOperations extends Record<string, FieldOrOperation<SchemaToSilk<TSchemaIO, TParent>, any, any> | FieldOrOperation<undefined, any, any, OperationType>>>(parent: TParent, operationOrFields: TOperations, options?: ResolverOptionsWithExtensions<ValueOf<TOperations>>): TOperations;
|
|
200
|
+
<TOperations extends Record<string, FieldOrOperation<undefined, any, any, OperationType>>>(operations: TOperations, options?: ResolverOptions<ValueOf<TOperations>>): TOperations;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
declare function getOperationOptions<T extends FieldOrOperationType = OperationType>(resolveOrOptions: T extends "field" ? ((parent: any) => any) | FieldOptions<any, any, any, any> : (() => any) | QueryMutationOptions<any, any, any>): T extends "field" ? FieldOptions<any, any, any, any> : QueryMutationOptions<any, any, any>;
|
|
204
|
+
declare function getSubscriptionOptions(subscribeOrOptions: (() => any) | SubscriptionOptions<any, any, any, any>): SubscriptionOptions<any, any, any, any>;
|
|
205
|
+
declare function getFieldOptions({ description, deprecationReason, extensions, }: GraphQLFieldOptions): GraphQLFieldOptions;
|
|
206
|
+
|
|
207
|
+
interface MiddlewarePayload<TField extends GenericFieldOrOperation = FieldOrOperation<any, any, any, any>> {
|
|
208
|
+
outputSilk: InferSilkO<InferFieldOutput<TField>>;
|
|
209
|
+
parent: TField extends FieldOrOperation<infer TParent, any, any, any> ? TParent extends undefined ? undefined : InferSilkO<NonNullable<TParent>> : never;
|
|
210
|
+
parseInput: TField extends FieldOrOperation<any, any, infer TInput, any> ? CallableInputParser<TInput> : undefined;
|
|
211
|
+
type: FieldOrOperationType;
|
|
212
|
+
}
|
|
213
|
+
type Middleware<TField extends GenericFieldOrOperation = FieldOrOperation<any, any, any, any>> = (next: () => MayPromise<InferSilkO<InferFieldOutput<TField>>>, payload: MiddlewarePayload<TField>) => MayPromise<InferSilkO<InferFieldOutput<TField>>>;
|
|
214
|
+
declare function applyMiddlewares<TField extends GenericFieldOrOperation = FieldOrOperation<any, any, any, any>>(middlewares: Middleware[], resolveFunction: () => MayPromise<InferSilkO<InferFieldOutput<TField>>>, payload: MiddlewarePayload<TField>): Promise<InferSilkO<InferFieldOutput<TField>>>;
|
|
215
|
+
declare function compose<T>(...lists: (T[] | undefined)[]): T[];
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Detailed payload of the current resolver
|
|
219
|
+
*/
|
|
220
|
+
interface ResolverPayload<TContext extends object = object, TField extends FieldOrOperation<any, any, any, any> = FieldOrOperation<any, any, any, any>> {
|
|
221
|
+
/**
|
|
222
|
+
* The previous object, which for a field on the root Query type is often not used.
|
|
223
|
+
*/
|
|
224
|
+
readonly root: any;
|
|
225
|
+
/**
|
|
226
|
+
* The payload provided to the field in the GraphQL query.
|
|
227
|
+
*/
|
|
228
|
+
readonly args: Record<string, any>;
|
|
229
|
+
/**
|
|
230
|
+
* The resolved value of the field, or an error.
|
|
231
|
+
*/
|
|
232
|
+
readonly context: TContext;
|
|
233
|
+
/**
|
|
234
|
+
* The source object that contains the field in the parent type.
|
|
235
|
+
*/
|
|
236
|
+
readonly info: GraphQLResolveInfo;
|
|
237
|
+
/**
|
|
238
|
+
* The field that is being resolved.
|
|
239
|
+
*/
|
|
240
|
+
readonly field: TField;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Empty Resolver Arguments that only store the memoization
|
|
244
|
+
*/
|
|
245
|
+
interface OnlyMemoizationPayload {
|
|
246
|
+
memoization: WeakMap<WeakKey, any>;
|
|
247
|
+
isMemoization: true;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Create an empty memoization payload for the resolver
|
|
251
|
+
* @returns the empty memoization payload
|
|
252
|
+
*/
|
|
253
|
+
declare function onlyMemoization(): OnlyMemoizationPayload;
|
|
254
|
+
declare function isOnlyMemoryPayload(payload: ResolverPayload | OnlyMemoizationPayload): payload is OnlyMemoizationPayload;
|
|
255
|
+
/**
|
|
256
|
+
* the AsyncLocalStorage instance to store the resolver payload
|
|
257
|
+
*/
|
|
258
|
+
declare const resolverPayloadStorage: AsyncLocalStorage<OnlyMemoizationPayload | ResolverPayload<object, FieldOrOperation<any, any, any, any>>>;
|
|
259
|
+
/**
|
|
260
|
+
* use detailed payload of the current resolver
|
|
261
|
+
* @returns the resolver payload
|
|
262
|
+
*/
|
|
263
|
+
declare function useResolverPayload(): ResolverPayload | undefined;
|
|
264
|
+
/**
|
|
265
|
+
* use context of the current resolver
|
|
266
|
+
* @returns the context of the current resolver
|
|
267
|
+
*/
|
|
268
|
+
declare function useContext<TContextType = object>(): TContextType;
|
|
269
|
+
/**
|
|
270
|
+
* use the MemoizationMap of the current context
|
|
271
|
+
*/
|
|
272
|
+
declare function useMemoizationMap(): WeakMap<WeakKey, any> | undefined;
|
|
273
|
+
interface ContextMemoryContainer {
|
|
274
|
+
[CONTEXT_MEMORY_MAP_KEY]?: WeakMap<WeakKey, any>;
|
|
275
|
+
}
|
|
276
|
+
interface ContextMemoryOptions {
|
|
277
|
+
getMemoizationMap: () => WeakMap<WeakKey, any> | undefined;
|
|
278
|
+
key: WeakKey;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Create a memoization in context to store the result of a getter function
|
|
282
|
+
*/
|
|
283
|
+
declare class ContextMemoization<T> implements ContextMemoryOptions {
|
|
284
|
+
readonly getter: () => T;
|
|
285
|
+
constructor(getter: () => T, options?: Partial<ContextMemoryOptions>);
|
|
286
|
+
getMemoizationMap: () => WeakMap<WeakKey, any> | undefined;
|
|
287
|
+
readonly key: WeakKey;
|
|
288
|
+
/**
|
|
289
|
+
* Get the value in memoization or call the getter function
|
|
290
|
+
* @returns the value of the getter function
|
|
291
|
+
*/
|
|
292
|
+
get(): T;
|
|
293
|
+
/**
|
|
294
|
+
* Clear the memoization
|
|
295
|
+
* @returns true if the memoization is cleared, undefined if the context is not found
|
|
296
|
+
*/
|
|
297
|
+
clear(): boolean | undefined;
|
|
298
|
+
/**
|
|
299
|
+
* Check if the memoization exists
|
|
300
|
+
* @returns true if the memoization exists, undefined if the context is not found
|
|
301
|
+
*/
|
|
302
|
+
exists(): boolean | undefined;
|
|
303
|
+
/**
|
|
304
|
+
* Set a new value to the memoization
|
|
305
|
+
* @param value the new value to set
|
|
306
|
+
* @returns the memoization map or undefined if the context is not found
|
|
307
|
+
*/
|
|
308
|
+
set(value: T): WeakMap<WeakKey, any> | undefined;
|
|
309
|
+
static assignMemoizationMap(target: ContextMemoryContainer): WeakMap<WeakKey, any>;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Async Memoization with a callable function
|
|
313
|
+
*/
|
|
314
|
+
interface CallableContextMemoization<T> extends Pick<ContextMemoization<T>, "get" | "set" | "clear" | "exists" | "getter"> {
|
|
315
|
+
(): T;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Create a memoization in context to store the result of a getter function
|
|
319
|
+
*/
|
|
320
|
+
declare function createMemoization<T>(...args: ConstructorParameters<typeof ContextMemoization<T>>): CallableContextMemoization<T>;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Creates an object map with the same keys as `map` and values generated by
|
|
324
|
+
* running each value of `record` thru `fn`.
|
|
325
|
+
*/
|
|
326
|
+
declare function mapValue<T, V>(record: Record<string, T>, fn: (value: T, key: string) => V | typeof mapValue.SKIP): Record<string, V>;
|
|
327
|
+
declare namespace mapValue {
|
|
328
|
+
var SKIP: unique symbol;
|
|
329
|
+
}
|
|
330
|
+
declare function toObjMap<T>(obj: Maybe<ReadOnlyObjMapLike<T>>): ReadOnlyObjMap<T>;
|
|
331
|
+
declare function notNullish<T>(x: T | undefined | null): x is T;
|
|
332
|
+
declare function deepMerge<T extends Record<string, any>>(...objects: (T | null | undefined)[]): T;
|
|
333
|
+
type Maybe<T> = null | undefined | T;
|
|
334
|
+
type ReadOnlyObjMapLike<T> = ReadOnlyObjMap<T> | {
|
|
335
|
+
readonly [key: string]: T;
|
|
336
|
+
};
|
|
337
|
+
interface ReadOnlyObjMap<T> {
|
|
338
|
+
readonly [key: string]: T;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
declare function markErrorLocation<TError>(error: TError, ...locations: string[]): TError;
|
|
342
|
+
declare function tryIn<T>(func: () => T, ...locations: string[]): T;
|
|
343
|
+
/**
|
|
344
|
+
* mark message with location
|
|
345
|
+
* @param message origin message
|
|
346
|
+
* @param locations where error happened
|
|
347
|
+
* @returns message with location
|
|
348
|
+
* @example markLocation("error", "banana") // "[banana] hello"
|
|
349
|
+
* @example markLocation("error", fruit, banana) // "[fruit.banana] error"
|
|
350
|
+
* @example markLocation("[banana] error", "fruit") // "[fruit.banana] error"
|
|
351
|
+
* @example markLocation("[fruit.banana] error", "favorite") // "[favorite.fruit.banana] error"
|
|
352
|
+
*/
|
|
353
|
+
declare function markLocation(message: string, ...locations: string[]): string;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Create a Silk from Scalar.
|
|
357
|
+
*/
|
|
358
|
+
declare function silk<TScalar extends GraphQLScalarType>(type: TScalar, parse?: (input: InferScalarExternal<TScalar>) => MayPromise<InferScalarInternal<TScalar>>): GraphQLSilk<InferScalarInternal<TScalar> | undefined, InferScalarInternal<TScalar> | undefined>;
|
|
359
|
+
/**
|
|
360
|
+
* Create a GraphQLSilk Object.
|
|
361
|
+
*/
|
|
362
|
+
declare function silk<TOutput, TInput = TOutput>(type: GraphQLOutputType, parse?: (input: TInput) => MayPromise<TOutput>): GraphQLSilk<TOutput, TInput>;
|
|
363
|
+
declare namespace silk {
|
|
364
|
+
var parse: typeof parseSilk;
|
|
365
|
+
var getType: typeof getGraphQLType;
|
|
366
|
+
var nonNull: typeof nonNullSilk;
|
|
367
|
+
var list: typeof listSilk;
|
|
368
|
+
var nullable: typeof nullableSilk;
|
|
369
|
+
}
|
|
370
|
+
type NonNullSilk<TSilk extends GraphQLSilk<any, any>> = GraphQLSilk<NonNullable<InferSilkO<TSilk>>, NonNullable<InferSilkI<TSilk>>>;
|
|
371
|
+
/**
|
|
372
|
+
* Non-nullable Silk.
|
|
373
|
+
*/
|
|
374
|
+
declare function nonNullSilk<TSilk extends GraphQLSilk<any, any>>(origin: TSilk): NonNullSilk<TSilk>;
|
|
375
|
+
type ListSilk<TSilk extends GraphQLSilk<any, any>> = GraphQLSilk<EnsureArray<InferSilkO<TSilk>>, EnsureArray<InferSilkO<TSilk>>>;
|
|
376
|
+
/**
|
|
377
|
+
* List Silk.
|
|
378
|
+
*/
|
|
379
|
+
declare function listSilk<TSilk extends GraphQLSilk<any, any>>(origin: TSilk): ListSilk<TSilk>;
|
|
380
|
+
type NullableSilk<TSilk extends GraphQLSilk<any, any>> = GraphQLSilk<InferSilkO<TSilk> | null | undefined, InferSilkI<TSilk>>;
|
|
381
|
+
/**
|
|
382
|
+
* Nullable Silk.
|
|
383
|
+
*/
|
|
384
|
+
declare function nullableSilk<TSilk extends GraphQLSilk<any, any>>(origin: TSilk): NullableSilk<TSilk>;
|
|
385
|
+
/**
|
|
386
|
+
* Get GraphQL Output Type from Silk.
|
|
387
|
+
* @param silk GraphQL Silk
|
|
388
|
+
* @returns GraphQL Output Type
|
|
389
|
+
*/
|
|
390
|
+
declare function getGraphQLType(silk: GraphQLSilk): GraphQLOutputType;
|
|
391
|
+
/**
|
|
392
|
+
* Validate and transform input to output
|
|
393
|
+
* @param silk silk GraphQL Silk
|
|
394
|
+
* @param input
|
|
395
|
+
* @returns output
|
|
396
|
+
*/
|
|
397
|
+
declare function parseSilk<TSilk extends GraphQLSilk>(silk: TSilk, input: InferSilkI<TSilk>): MayPromise<InferSilkO<TSilk>>;
|
|
398
|
+
declare function isSilk(target: any): target is GraphQLSilk;
|
|
399
|
+
type InferScalarInternal<T extends GraphQLScalarType> = T extends GraphQLScalarType<infer TInternal> ? TInternal : never;
|
|
400
|
+
type InferScalarExternal<T extends GraphQLScalarType> = T extends GraphQLScalarType<any, infer TExternal> ? TExternal : never;
|
|
401
|
+
type EnsureArray<T> = T extends Array<infer U> ? U[] : T[];
|
|
402
|
+
|
|
403
|
+
declare const silkQuery: QueryMutationBobbin<GraphQLSilkIO>;
|
|
404
|
+
declare const silkMutation: QueryMutationBobbin<GraphQLSilkIO>;
|
|
405
|
+
declare const silkField: FieldBobbin<GraphQLSilkIO>;
|
|
406
|
+
declare const defaultSubscriptionResolve: (source: any) => any;
|
|
407
|
+
declare const silkSubscription: SubscriptionBobbin<GraphQLSilkIO>;
|
|
408
|
+
declare const ResolverOptionsMap: WeakMap<object, ResolverOptionsWithParent<GenericFieldOrOperation>>;
|
|
409
|
+
declare function baseResolver(operations: Record<string, FieldOrOperation<any, any, any>>, options: ResolverOptionsWithParent | undefined): Record<string, FieldOrOperation<any, any, any, FieldOrOperationType>>;
|
|
410
|
+
declare const silkResolver: ResolverBobbin<GraphQLSilkIO>;
|
|
411
|
+
declare const loom: {
|
|
412
|
+
query: QueryMutationBobbin<GraphQLSilkIO>;
|
|
413
|
+
resolver: ResolverBobbin<GraphQLSilkIO>;
|
|
414
|
+
field: FieldBobbin<GraphQLSilkIO>;
|
|
415
|
+
subscription: SubscriptionBobbin<GraphQLSilkIO>;
|
|
416
|
+
mutation: QueryMutationBobbin<GraphQLSilkIO>;
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
declare function createResolverBobbin<TSchemaIO extends AbstractSchemaIO>(toSilk: (schema: TSchemaIO[0]) => GraphQLSilk): ResolverBobbin<TSchemaIO>;
|
|
420
|
+
declare function createFieldBobbin<TSchemaIO extends AbstractSchemaIO>(toSilk: (schema: TSchemaIO[0]) => GraphQLSilk, isSchema: (schema: InputSchema<TSchemaIO[0]>) => boolean): FieldBobbin<TSchemaIO>;
|
|
421
|
+
declare function createQueryBobbin<TSchemaIO extends AbstractSchemaIO>(toSilk: (schema: TSchemaIO[0]) => GraphQLSilk, isSchema: (schema: InputSchema<TSchemaIO[0]>) => boolean): QueryMutationBobbin<TSchemaIO>;
|
|
422
|
+
declare function createMutationBobbin<TSchemaIO extends AbstractSchemaIO>(toSilk: (schema: TSchemaIO[0]) => GraphQLSilk, isSchema: (schema: InputSchema<TSchemaIO[0]>) => boolean): QueryMutationBobbin<TSchemaIO>;
|
|
423
|
+
declare function createSubscriptionBobbin<TSchemaIO extends AbstractSchemaIO>(toSilk: (schema: TSchemaIO[0]) => GraphQLSilk, isSchema: (schema: InputSchema<TSchemaIO[0]>) => boolean): SubscriptionBobbin<TSchemaIO>;
|
|
424
|
+
declare function createLoom<TSchemaIO extends AbstractSchemaIO>(toSilk: (schema: TSchemaIO[0]) => GraphQLSilk, isSchema: (schema: InputSchema<TSchemaIO[0]>) => boolean): {
|
|
425
|
+
query: QueryMutationBobbin<TSchemaIO>;
|
|
426
|
+
mutation: QueryMutationBobbin<TSchemaIO>;
|
|
427
|
+
field: FieldBobbin<TSchemaIO>;
|
|
428
|
+
resolver: ResolverBobbin<TSchemaIO>;
|
|
429
|
+
subscription: SubscriptionBobbin<TSchemaIO>;
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
interface WeaverContext {
|
|
433
|
+
loomObjectMap: Map<GraphQLObjectType, LoomObjectType>;
|
|
434
|
+
loomUnionMap: Map<GraphQLUnionType, GraphQLUnionType>;
|
|
435
|
+
inputMap: Map<GraphQLObjectType | GraphQLInterfaceType, GraphQLInputObjectType>;
|
|
436
|
+
interfaceMap: Map<GraphQLObjectType, GraphQLInterfaceType>;
|
|
437
|
+
configs: Map<string | symbol, WeaverConfig>;
|
|
438
|
+
getConfig: <TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]) => TConfig | undefined;
|
|
439
|
+
setConfig<TConfig extends WeaverConfig>(config: TConfig): void;
|
|
440
|
+
deleteConfig: <TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]) => void;
|
|
441
|
+
namedTypes: Map<string, GraphQLOutputType>;
|
|
442
|
+
memoNamedType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(gqlType: TGraphQLType): TGraphQLType;
|
|
443
|
+
getNamedType<T extends GraphQLOutputType>(name: string): T | undefined;
|
|
444
|
+
names: WeakMap<object, string>;
|
|
445
|
+
}
|
|
446
|
+
interface WeaverConfig {
|
|
447
|
+
[WEAVER_CONFIG]: string | symbol;
|
|
448
|
+
}
|
|
449
|
+
declare function initWeaverContext(): WeaverContext;
|
|
450
|
+
type GlobalContextRequiredKeys = "names" | "getConfig" | "setConfig" | "getNamedType" | "memoNamedType";
|
|
451
|
+
interface GlobalWeaverContext extends Partial<Omit<WeaverContext, GlobalContextRequiredKeys>>, Pick<WeaverContext, GlobalContextRequiredKeys> {
|
|
452
|
+
value?: WeaverContext;
|
|
453
|
+
useConfig<TConfig extends WeaverConfig, TCallback extends () => any>(config: TConfig, callback: TCallback): ReturnType<TCallback>;
|
|
454
|
+
GraphQLTypes: WeakMap<object, GraphQLOutputType>;
|
|
455
|
+
getGraphQLType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(origin: object): TGraphQLType | undefined;
|
|
456
|
+
memoGraphQLType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(origin: object, gqlType: TGraphQLType): TGraphQLType;
|
|
457
|
+
}
|
|
458
|
+
declare const weaverContext: GlobalWeaverContext;
|
|
459
|
+
declare function provideWeaverContext<T>(func: () => T, value: WeaverContext | undefined): T;
|
|
460
|
+
/**
|
|
461
|
+
* collect names for schemas
|
|
462
|
+
* @param namesList - names to collect
|
|
463
|
+
* @returns namesRecord
|
|
464
|
+
*/
|
|
465
|
+
declare function collectNames<TRecords extends Record<string, object>[]>(...namesList: TRecords): UnionToIntersection<TRecords[number]>;
|
|
466
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
467
|
+
|
|
468
|
+
type SilkFieldOrOperation = FieldOrOperation<any, any, any, any>;
|
|
469
|
+
interface FieldConvertOptions {
|
|
470
|
+
optionsForResolving?: ResolvingOptions;
|
|
471
|
+
}
|
|
472
|
+
type SilkResolver = Record<string, FieldOrOperation<any, any, any, any>>;
|
|
473
|
+
interface CoreSchemaWeaverConfigOptions extends GraphQLSchemaConfig {
|
|
474
|
+
getInputObjectName?: (name: string) => string;
|
|
475
|
+
weaverContext?: WeaverContext;
|
|
476
|
+
}
|
|
477
|
+
interface CoreSchemaWeaverConfig extends WeaverConfig, CoreSchemaWeaverConfigOptions {
|
|
478
|
+
[WEAVER_CONFIG]: "gqloom.core.schema";
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
declare class LoomObjectType extends GraphQLObjectType {
|
|
482
|
+
extraFields: Map<string, SilkFieldOrOperation>;
|
|
483
|
+
weaverContext: WeaverContext;
|
|
484
|
+
resolverOptions?: ResolvingOptions;
|
|
485
|
+
constructor(objectOrGetter: string | GraphQLObjectType | GraphQLObjectTypeConfig<any, any> | (() => GraphQLObjectType | GraphQLObjectTypeConfig<any, any>), options?: {
|
|
486
|
+
weaverContext?: WeaverContext;
|
|
487
|
+
resolverOptions?: ResolvingOptions;
|
|
488
|
+
});
|
|
489
|
+
addField(name: string, resolver: SilkFieldOrOperation): void;
|
|
490
|
+
mergeExtensions(extensions: GraphQLObjectTypeConfig<any, any>["extensions"]): void;
|
|
491
|
+
private extraField?;
|
|
492
|
+
getFields(): GraphQLFieldMap<any, any>;
|
|
493
|
+
protected mapToFieldConfig(map: Map<string, SilkFieldOrOperation>): Record<string, GraphQLFieldConfig<any, any>>;
|
|
494
|
+
toFieldConfig(field: SilkFieldOrOperation): GraphQLFieldConfig<any, any>;
|
|
495
|
+
protected provideForResolve(field: SilkFieldOrOperation): Pick<GraphQLFieldConfig<any, any>, "resolve"> | undefined;
|
|
496
|
+
protected provideForSubscribe(field: SilkFieldOrOperation): Pick<GraphQLFieldConfig<any, any>, "subscribe"> | undefined;
|
|
497
|
+
protected getCacheType(gqlType: GraphQLOutputType): GraphQLOutputType;
|
|
498
|
+
get options(): {
|
|
499
|
+
resolverOptions: ResolvingOptions | undefined;
|
|
500
|
+
weaverContext: WeaverContext;
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
declare function getCacheType(gqlType: GraphQLOutputType, options?: {
|
|
504
|
+
weaverContext?: WeaverContext;
|
|
505
|
+
resolverOptions?: ResolvingOptions;
|
|
506
|
+
}): GraphQLOutputType;
|
|
507
|
+
|
|
508
|
+
interface SchemaWeaverParameters extends Partial<Record<"query" | "mutation" | "subscription", LoomObjectType>>, Pick<GraphQLSchemaConfig, "types"> {
|
|
509
|
+
}
|
|
510
|
+
declare class SchemaWeaver {
|
|
511
|
+
query?: LoomObjectType;
|
|
512
|
+
mutation?: LoomObjectType;
|
|
513
|
+
subscription?: LoomObjectType;
|
|
514
|
+
types?: GraphQLNamedType[] | null;
|
|
515
|
+
context: WeaverContext;
|
|
516
|
+
resolverOptions?: ResolvingOptions;
|
|
517
|
+
/**
|
|
518
|
+
* Create a Schema Weaver config object
|
|
519
|
+
* @param config Schema Weaver config options
|
|
520
|
+
* @returns a Schema Weaver config object
|
|
521
|
+
*/
|
|
522
|
+
static config(config: CoreSchemaWeaverConfigOptions): CoreSchemaWeaverConfig;
|
|
523
|
+
constructor({ query, mutation, subscription, types }?: SchemaWeaverParameters, context?: WeaverContext);
|
|
524
|
+
use(...middlewares: Middleware[]): this;
|
|
525
|
+
add(resolver: SilkResolver): this;
|
|
526
|
+
addType(silk: GraphQLSilk): this;
|
|
527
|
+
setConfig<TConfig extends WeaverConfig>(config: TConfig): this;
|
|
528
|
+
weaveGraphQLSchema(): GraphQLSchema;
|
|
529
|
+
protected addResolver(resolver: SilkResolver): this;
|
|
530
|
+
protected getOperationObject(type: "query" | "mutation" | "subscription"): LoomObjectType;
|
|
531
|
+
protected get fieldOptions(): {
|
|
532
|
+
resolverOptions: ResolvingOptions | undefined;
|
|
533
|
+
weaverContext: WeaverContext;
|
|
534
|
+
};
|
|
535
|
+
static optionsFrom(...inputs: (SilkResolver | Middleware | WeaverConfig | GraphQLSilk)[]): {
|
|
536
|
+
context: WeaverContext | undefined;
|
|
537
|
+
configs: Set<WeaverConfig>;
|
|
538
|
+
middlewares: Set<Middleware>;
|
|
539
|
+
resolvers: Set<SilkResolver>;
|
|
540
|
+
silks: Set<GraphQLSilk<any, any>>;
|
|
541
|
+
};
|
|
542
|
+
/**
|
|
543
|
+
* Weave a GraphQL Schema from resolvers
|
|
544
|
+
* @param inputs Resolvers, Global Middlewares or WeaverConfigs
|
|
545
|
+
* @returns GraphQ LSchema
|
|
546
|
+
*/
|
|
547
|
+
static weave(...inputs: (SilkResolver | Middleware | WeaverConfig | GraphQLSilk)[]): GraphQLSchema;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Weave a GraphQL Schema from resolvers
|
|
551
|
+
* @param inputs Resolvers, Global Middlewares or WeaverConfigs
|
|
552
|
+
* @returns GraphQ LSchema
|
|
553
|
+
*/
|
|
554
|
+
declare const weave: typeof SchemaWeaver.weave;
|
|
555
|
+
|
|
556
|
+
declare function inputToArgs(input: InputSchema<GraphQLSilk>): GraphQLFieldConfigArgumentMap | undefined;
|
|
557
|
+
declare function ensureInputType(silkOrType: GraphQLType | GraphQLSilk): GraphQLInputType;
|
|
558
|
+
declare function ensureInputObjectType(object: GraphQLObjectType | GraphQLInterfaceType | GraphQLInputObjectType): GraphQLInputObjectType;
|
|
559
|
+
|
|
560
|
+
declare function ensureInterfaceType(gqlType: GraphQLOutputType, interfaceConfig?: GraphQLInterfaceTypeConfig<any, any>): GraphQLInterfaceType;
|
|
561
|
+
|
|
562
|
+
interface GQLoomExtensions {
|
|
563
|
+
defaultValue?: any;
|
|
564
|
+
gqloom?: GQLoomExtensionAttribute;
|
|
565
|
+
directives?: DirectiveItem[] | DirectiveRecord;
|
|
566
|
+
}
|
|
567
|
+
interface DirectiveItem {
|
|
568
|
+
name: string;
|
|
569
|
+
args?: Record<string, any>;
|
|
570
|
+
}
|
|
571
|
+
type DirectiveRecord = Record<string, Record<string, any>>;
|
|
572
|
+
interface GQLoomExtensionAttribute {
|
|
573
|
+
directives?: string[];
|
|
574
|
+
}
|
|
575
|
+
declare function mergeExtensions(...extensionsList: (Readonly<GraphQLFieldExtensions<any, any, any> | GraphQLObjectTypeExtensions | GQLoomExtensions> | null | undefined)[]): GraphQLFieldExtensions<any, any, any>;
|
|
576
|
+
|
|
577
|
+
export { type AbstractSchemaIO, type CallableContextMemoization, type CallableInputParser, ContextMemoization, type CoreSchemaWeaverConfig, type CoreSchemaWeaverConfigOptions, type DirectiveItem, type DirectiveRecord, type FieldBobbin, type FieldConvertOptions, type FieldOptions, type FieldOrOperation, type FieldOrOperationType, type GQLoomExtensionAttribute, type GQLoomExtensions, type GenericFieldOrOperation, type GlobalWeaverContext, type GraphQLFieldOptions, type GraphQLSilk, type GraphQLSilkIO, type InferFieldInput, type InferFieldOutput, type InferFieldParent, type InferInputI, type InferInputO, type InferPropertyType, type InferSchemaI, type InferSchemaO, type InferSilkI, type InferSilkO, type InputSchema, type InputSchemaToSilk, type IsAny, type ListSilk, LoomObjectType, type MayPromise, type Middleware, type MiddlewarePayload, type NonNullSilk, type NullableSilk, type ObjectOrNever, type OnlyMemoizationPayload, type OperationType, type QueryMutationBobbin, type QueryMutationOptions, type ResolverBobbin, type ResolverOptions, ResolverOptionsMap, type ResolverOptionsWithExtensions, type ResolverOptionsWithParent, type ResolverPayload, type ResolvingOptions, symbols as SYMBOLS, type SchemaToSilk, SchemaWeaver, type SilkFieldOrOperation, type SilkResolver, type Subscription, type SubscriptionBobbin, type SubscriptionOptions, type ValueOf, type WeaverConfig, type WeaverContext, type WrapPropertyType, applyMiddlewares, baseResolver, collectNames, compose, createFieldBobbin, createInputParser, createLoom, createMemoization, createMutationBobbin, createQueryBobbin, createResolverBobbin, createSubscriptionBobbin, deepMerge, defaultSubscriptionResolve, ensureInputObjectType, ensureInputType, ensureInterfaceType, getCacheType, getFieldOptions, getGraphQLType, getOperationOptions, getSubscriptionOptions, initWeaverContext, inputToArgs, isOnlyMemoryPayload, isSilk, listSilk, loom, mapValue, markErrorLocation, markLocation, mergeExtensions, nonNullSilk, notNullish, nullableSilk, onlyMemoization, parseInputValue, parseSilk, provideWeaverContext, resolverPayloadStorage, silk, silkField, silkMutation, silkQuery, silkResolver, silkSubscription, toObjMap, tryIn, useContext, useMemoizationMap, useResolverPayload, weave, weaverContext };
|