@gqloom/core 0.10.1 → 0.11.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.
@@ -0,0 +1,1253 @@
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
+
3
+ //#region src/utils/types.d.ts
4
+ type MayPromise<T> = T | Promise<T>;
5
+ type IsAny<T> = 0 extends 1 & T ? true : false;
6
+ type ValueOf<T extends object> = T[keyof T];
7
+ type OmitInUnion<TUnion, TOmit> = TUnion extends infer T ? T extends TOmit ? never : T : never;
8
+ type RequireKeys<T, TKey extends string | number | symbol> = { [P in keyof T as P extends TKey ? P : never]-?: T[P] } & { [P in keyof T as P extends TKey ? never : P]: T[P] };
9
+ //#endregion
10
+ //#region ../../node_modules/.pnpm/@standard-schema+spec@1.0.0/node_modules/@standard-schema/spec/dist/index.d.ts
11
+ /** The Standard Schema interface. */
12
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
13
+ /** The Standard Schema properties. */
14
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
15
+ }
16
+ declare namespace StandardSchemaV1 {
17
+ /** The Standard Schema properties interface. */
18
+ export interface Props<Input = unknown, Output = Input> {
19
+ /** The version number of the standard. */
20
+ readonly version: 1;
21
+ /** The vendor name of the schema library. */
22
+ readonly vendor: string;
23
+ /** Validates unknown input values. */
24
+ readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
25
+ /** Inferred types associated with the schema. */
26
+ readonly types?: Types<Input, Output> | undefined;
27
+ }
28
+ /** The result interface of the validate function. */
29
+ export type Result<Output> = SuccessResult<Output> | FailureResult;
30
+ /** The result interface if validation succeeds. */
31
+ export interface SuccessResult<Output> {
32
+ /** The typed output value. */
33
+ readonly value: Output;
34
+ /** The non-existent issues. */
35
+ readonly issues?: undefined;
36
+ }
37
+ /** The result interface if validation fails. */
38
+ export interface FailureResult {
39
+ /** The issues of failed validation. */
40
+ readonly issues: ReadonlyArray<Issue>;
41
+ }
42
+ /** The issue interface of the failure output. */
43
+ export interface Issue {
44
+ /** The error message of the issue. */
45
+ readonly message: string;
46
+ /** The path of the issue, if any. */
47
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
48
+ }
49
+ /** The path segment interface of the issue. */
50
+ export interface PathSegment {
51
+ /** The key representing a path segment. */
52
+ readonly key: PropertyKey;
53
+ }
54
+ /** The Standard Schema types interface. */
55
+ export interface Types<Input = unknown, Output = Input> {
56
+ /** The input type of the schema. */
57
+ readonly input: Input;
58
+ /** The output type of the schema. */
59
+ readonly output: Output;
60
+ }
61
+ /** Infers the input type of a Standard Schema. */
62
+ export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
63
+ /** Infers the output type of a Standard Schema. */
64
+ export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
65
+ export {};
66
+ }
67
+ declare namespace symbols_d_exports {
68
+ export { CONTEXT_MAP_KEY, FIELD_HIDDEN, GET_GRAPHQL_TYPE, IS_RESOLVER, RESOLVER_OPTIONS_KEY, WEAVER_CONFIG };
69
+ }
70
+ /**
71
+ * The symbol to get GraphQL type for schema
72
+ */
73
+ declare const GET_GRAPHQL_TYPE: unique symbol;
74
+ /**
75
+ * The symbol to get and store weaver config
76
+ */
77
+ declare const WEAVER_CONFIG: unique symbol;
78
+ /**
79
+ * The symbol to get resolver options
80
+ */
81
+ declare const RESOLVER_OPTIONS_KEY: unique symbol;
82
+ /**
83
+ * The symbol to check if an object is a resolver
84
+ */
85
+ declare const IS_RESOLVER: unique symbol;
86
+ /**
87
+ * The symbol to assign a WeakMap to an object
88
+ */
89
+ declare const CONTEXT_MAP_KEY: unique symbol;
90
+ /**
91
+ * Set fields to be hidden
92
+ */
93
+ declare const FIELD_HIDDEN = false;
94
+ //#endregion
95
+ //#region src/resolver/input.d.ts
96
+ type InferInputI<TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void> = TInput extends void ? void : TInput extends GraphQLSilk ? StandardSchemaV1.InferInput<TInput> : TInput extends Record<string, GraphQLSilk> ? { [K in keyof TInput]: StandardSchemaV1.InferInput<TInput[K]> } : void;
97
+ type InferInputO<TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void> = TInput extends void ? void : TInput extends GraphQLSilk ? StandardSchemaV1.InferOutput<TInput> : TInput extends Record<string, GraphQLSilk> ? { [K in keyof TInput]: StandardSchemaV1.InferOutput<TInput[K]> } : never;
98
+ interface CallableInputParser<TSchema extends GraphQLSilk | Record<string, GraphQLSilk> | void> {
99
+ /**
100
+ * input schema
101
+ */
102
+ schema: TSchema;
103
+ /**
104
+ * Origin value to parse
105
+ */
106
+ value: InferInputI<TSchema>;
107
+ /**
108
+ * Parse the input and return the standard result
109
+ */
110
+ (): Promise<StandardSchemaV1.Result<InferInputO<TSchema>>>;
111
+ /**
112
+ * Result of parsing. Set it to `undefined` then the parser will run again.
113
+ */
114
+ result: StandardSchemaV1.Result<InferInputO<TSchema>> | undefined;
115
+ /**
116
+ * Parse the input and return the result
117
+ */
118
+ getResult(): Promise<InferInputO<TSchema>>;
119
+ /**
120
+ * Set the result's value of parsing
121
+ */
122
+ setResult(value: InferInputO<TSchema>): void;
123
+ /**
124
+ * Clear the result of parsing, the parser will run again to get the result.
125
+ */
126
+ clearResult(): void;
127
+ }
128
+ declare function createInputParser<TSchema extends GraphQLSilk | Record<string, GraphQLSilk> | void>(schema: TSchema, value: InferInputI<TSchema>): CallableInputParser<TSchema>;
129
+ declare function parseInputValue<TSchema extends GraphQLSilk | Record<string, GraphQLSilk> | void>(inputSchema: TSchema, input: any): MayPromise<StandardSchemaV1.Result<InferInputO<TSchema>>>;
130
+ declare function getStandardValue<T>(result: StandardSchemaV1.Result<T>): T;
131
+ declare function getStandardValue<T>(result?: StandardSchemaV1.Result<T>): T | undefined;
132
+ declare function getStandardValue<T>(result: StandardSchemaV1.Result<T> | null): T | null;
133
+ //#endregion
134
+ //#region src/resolver/resolver-chain-factory.d.ts
135
+ /**
136
+ * Interface for chain factory that provides methods to configure GraphQL field options
137
+ * @template TOutput - The output type of the GraphQL field
138
+ * @template TInput - The input type of the GraphQL field, can be a single type or a record of types
139
+ */
140
+ interface IChainFactory<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> {
141
+ /**
142
+ * Sets the description for the GraphQL field
143
+ * @param description - The description text for the field
144
+ */
145
+ description(description: GraphQLFieldOptions["description"]): this;
146
+ /**
147
+ * Sets the deprecation reason for the GraphQL field
148
+ * @param deprecationReason - The reason why this field is deprecated
149
+ */
150
+ deprecationReason(deprecationReason: GraphQLFieldOptions["deprecationReason"]): this;
151
+ /**
152
+ * Sets custom extensions for the GraphQL field
153
+ * @param extensions - Custom extensions to be added to the field
154
+ */
155
+ extensions(extensions: GraphQLFieldOptions["extensions"]): this;
156
+ /**
157
+ * Sets the output type for the GraphQL field
158
+ * @template TOutputNew - The new output type
159
+ * @param output - The output type definition
160
+ */
161
+ output<TOutputNew extends GraphQLSilk>(output: TOutputNew): IChainFactory<TOutputNew, TInput>;
162
+ /**
163
+ * Sets the input type for the GraphQL field
164
+ * @template TInputNew - The new input type
165
+ * @param input - The input type definition
166
+ */
167
+ input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): IChainFactory<TOutput, TInputNew>;
168
+ }
169
+ /**
170
+ * Options for configuring a chain factory
171
+ */
172
+ interface ChainFactoryOptions extends FieldMeta {
173
+ /** Middleware functions to be applied to the field */
174
+ middlewares?: Middleware[];
175
+ }
176
+ /**
177
+ * Base class for all chain factories
178
+ * @template TField - The type of field being created
179
+ */
180
+ declare abstract class BaseChainFactory<TField extends BaseField = any> {
181
+ protected readonly options?: Partial<ChainFactoryOptions> | undefined;
182
+ /**
183
+ * Returns the available methods for the chain factory
184
+ */
185
+ static methods(): {
186
+ description: (description: GraphQLFieldOptions["description"]) => BaseChainFactory<any>;
187
+ deprecationReason: (deprecationReason: GraphQLFieldOptions["deprecationReason"]) => BaseChainFactory<any>;
188
+ extensions: (extensions: GraphQLFieldOptions["extensions"]) => BaseChainFactory<any>;
189
+ };
190
+ /**
191
+ * Creates a new instance of the chain factory
192
+ * @param options - Configuration options for the factory
193
+ */
194
+ constructor(options?: Partial<ChainFactoryOptions> | undefined);
195
+ /**
196
+ * Creates a clone of the current factory with new options
197
+ * @param options - New options to apply to the clone
198
+ */
199
+ protected abstract clone(options?: Partial<ChainFactoryOptions>): this;
200
+ /**
201
+ * Sets the description for the field
202
+ * @param description - The description text
203
+ */
204
+ description(description: GraphQLFieldOptions["description"]): this;
205
+ /**
206
+ * Sets the deprecation reason for the field
207
+ * @param deprecationReason - The reason for deprecation
208
+ */
209
+ deprecationReason(deprecationReason: GraphQLFieldOptions["deprecationReason"]): this;
210
+ /**
211
+ * Sets custom extensions for the field
212
+ * @param extensions - Custom extensions to add
213
+ */
214
+ extensions(extensions: GraphQLFieldOptions["extensions"]): this;
215
+ /**
216
+ * Adds middleware functions to the field
217
+ * @param middlewares - Middleware functions to add
218
+ */
219
+ use(...middlewares: Middleware<TField>[]): this;
220
+ }
221
+ /**
222
+ * Factory for creating field resolvers with chainable configuration
223
+ * @template TOutput - The output type of the field
224
+ * @template TInput - The input type of the field
225
+ * @template TDependencies - The dependencies of the field
226
+ */
227
+ declare class FieldChainFactory<TOutput extends GraphQLSilk = never, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TDependencies extends string[] | undefined = undefined> extends BaseChainFactory<Field<any, TOutput, TInput, TDependencies>> implements IChainFactory<TOutput, TInput> {
228
+ /**
229
+ * Returns the available methods for the field chain factory
230
+ */
231
+ static methods(): FieldChainFactory<never, undefined>;
232
+ /**
233
+ * Creates a clone of the current factory with new options
234
+ * @param options - New options to apply to the clone
235
+ */
236
+ protected clone(options?: Partial<ChainFactoryOptions>): this;
237
+ /**
238
+ * Sets the output type for the field
239
+ * @template TOutputNew - The new output type
240
+ * @param output - The output type definition
241
+ */
242
+ output<TOutputNew extends GraphQLSilk>(output: TOutputNew): FieldChainFactory<TOutputNew, TInput, TDependencies>;
243
+ /**
244
+ * Sets the input type for the field
245
+ * @template TInputNew - The new input type
246
+ * @param input - The input type definition
247
+ */
248
+ input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): FieldChainFactory<TOutput, TInputNew, TDependencies>;
249
+ /**
250
+ * Specifies the dependencies for the field
251
+ * @template TDependencies - The dependencies type
252
+ * @param dependencies - The dependencies to add
253
+ */
254
+ derivedFrom<const TDependencies extends string[]>(...dependencies: TDependencies): FieldChainFactory<TOutput, TInput, TDependencies>;
255
+ /**
256
+ * Sets the resolve function for the field
257
+ * @template TParent - The parent type
258
+ * @param resolve - The resolve function
259
+ */
260
+ resolve<TParent extends GraphQLSilk>(resolve: (parent: TDependencies extends string[] ? RequireKeys<NonNullable<StandardSchemaV1.InferOutput<TParent>>, TDependencies[number]> : NonNullable<StandardSchemaV1.InferOutput<TParent>>, input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Field<TParent, TOutput, TInput, TDependencies>;
261
+ /**
262
+ * Creates a field resolver that uses DataLoader for batch loading data.
263
+ * This method is particularly useful for optimizing performance when dealing with multiple data requests
264
+ * by batching them together and handling caching automatically.
265
+ *
266
+ * @template TParent - The parent type that extends GraphQLSilk
267
+ * @param resolve - A function that handles batch loading of data.
268
+ * @returns A GraphQL field resolver that implements batch loading
269
+ */
270
+ load<TParent extends GraphQLSilk>(resolve: (parents: InferParent<TParent, TDependencies>[], input: InferInputO<TInput>, payloads: (ResolverPayload | undefined)[]) => MayPromise<StandardSchemaV1.InferOutput<TOutput>[]>): Field<TParent, TOutput, TInput, TDependencies>;
271
+ }
272
+ type InferParent<TParent extends GraphQLSilk, TDependencies extends string[] | undefined = undefined> = TDependencies extends string[] ? RequireKeys<NonNullable<StandardSchemaV1.InferOutput<TParent>>, TDependencies[number]> : NonNullable<StandardSchemaV1.InferOutput<TParent>>;
273
+ /**
274
+ * Factory for creating query resolvers with chainable configuration
275
+ * @template TOutput - The output type of the query
276
+ * @template TInput - The input type of the query
277
+ */
278
+ declare class QueryChainFactory<TOutput extends GraphQLSilk = never, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseChainFactory<Query<TOutput, TInput>> implements IChainFactory<TOutput, TInput> {
279
+ /**
280
+ * Returns the available methods for the query chain factory
281
+ * @returns An object containing all available methods
282
+ */
283
+ static methods(): QueryChainFactory<never, void>;
284
+ /**
285
+ * Creates a clone of the current factory with new options
286
+ * @param options - New options to apply to the clone
287
+ * @returns A new instance of QueryChainFactory with the updated options
288
+ */
289
+ protected clone(options?: Partial<ChainFactoryOptions>): this;
290
+ /**
291
+ * Sets the output type for the query
292
+ * @template TOutputNew - The new output type
293
+ * @param output - The output type definition
294
+ * @returns A new QueryChainFactory instance with the updated output type
295
+ */
296
+ output<TOutputNew extends GraphQLSilk>(output: TOutputNew): QueryChainFactory<TOutputNew, TInput>;
297
+ /**
298
+ * Sets the input type for the query
299
+ * @template TInputNew - The new input type
300
+ * @param input - The input type definition
301
+ * @returns A new QueryChainFactory instance with the updated input type
302
+ */
303
+ input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): QueryChainFactory<TOutput, TInputNew>;
304
+ /**
305
+ * Sets the resolve function for the query
306
+ * @param resolve - The resolve function that processes the input and returns the output
307
+ * @returns A GraphQL query resolver
308
+ * @throws {Error} If output type is not set
309
+ */
310
+ resolve(resolve: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Query<TOutput, TInput>;
311
+ }
312
+ /**
313
+ * Factory for creating mutation resolvers with chainable configuration
314
+ * @template TOutput - The output type of the mutation
315
+ * @template TInput - The input type of the mutation
316
+ */
317
+ declare class MutationChainFactory<TOutput extends GraphQLSilk = never, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined> extends BaseChainFactory<Mutation<TOutput, TInput>> implements IChainFactory<TOutput, TInput> {
318
+ /**
319
+ * Returns the available methods for the mutation chain factory
320
+ * @returns An object containing all available methods
321
+ */
322
+ static methods(): MutationChainFactory<never, undefined>;
323
+ /**
324
+ * Creates a clone of the current factory with new options
325
+ * @param options - New options to apply to the clone
326
+ * @returns A new instance of MutationChainFactory with the updated options
327
+ */
328
+ protected clone(options?: Partial<ChainFactoryOptions>): this;
329
+ /**
330
+ * Sets the output type for the mutation
331
+ * @template TOutputNew - The new output type
332
+ * @param output - The output type definition
333
+ * @returns A new MutationChainFactory instance with the updated output type
334
+ */
335
+ output<TOutputNew extends GraphQLSilk>(output: TOutputNew): MutationChainFactory<TOutputNew, TInput>;
336
+ /**
337
+ * Sets the input type for the mutation
338
+ * @template TInputNew - The new input type
339
+ * @param input - The input type definition
340
+ * @returns A new MutationChainFactory instance with the updated input type
341
+ */
342
+ input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): MutationChainFactory<TOutput, TInputNew>;
343
+ /**
344
+ * Sets the resolve function for the mutation
345
+ * @param resolve - The resolve function that processes the input and returns the output
346
+ * @returns A GraphQL mutation resolver
347
+ * @throws {Error} If output type is not set
348
+ */
349
+ resolve(resolve: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Mutation<TOutput, TInput>;
350
+ }
351
+ /**
352
+ * Factory for creating subscription resolvers with chainable configuration
353
+ * @template TOutput - The output type of the subscription
354
+ * @template TInput - The input type of the subscription
355
+ */
356
+ declare class SubscriptionChainFactory<TOutput extends GraphQLSilk = never, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined> extends BaseChainFactory<Subscription<TOutput, TInput, any>> implements IChainFactory<TOutput, TInput> {
357
+ /**
358
+ * Returns the available methods for the subscription chain factory
359
+ * @returns An object containing all available methods
360
+ */
361
+ static methods(): SubscriptionChainFactory<never, undefined>;
362
+ /**
363
+ * Creates a clone of the current factory with new options
364
+ * @param options - New options to apply to the clone
365
+ * @returns A new instance of SubscriptionChainFactory with the updated options
366
+ */
367
+ protected clone(options?: Partial<ChainFactoryOptions>): this;
368
+ /**
369
+ * Sets the output type for the subscription
370
+ * @template TOutputNew - The new output type
371
+ * @param output - The output type definition
372
+ * @returns A new SubscriptionChainFactory instance with the updated output type
373
+ */
374
+ output<TOutputNew extends GraphQLSilk>(output: TOutputNew): SubscriptionChainFactory<TOutputNew, TInput>;
375
+ /**
376
+ * Sets the input type for the subscription
377
+ * @template TInputNew - The new input type
378
+ * @param input - The input type definition
379
+ * @returns A new SubscriptionChainFactory instance with the updated input type
380
+ */
381
+ input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): SubscriptionChainFactory<TOutput, TInputNew>;
382
+ /**
383
+ * Sets the subscribe function for the subscription
384
+ * @template TValue - The value type of the subscription
385
+ * @param subscribe - The subscribe function that returns an AsyncIterator
386
+ * @returns A subscription resolver that can be further configured with a resolve function
387
+ * @throws {Error} If output type is not set
388
+ */
389
+ subscribe<TValue = StandardSchemaV1.InferOutput<TOutput>>(subscribe: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<AsyncIterator<TValue>>): TValue extends StandardSchemaV1.InferOutput<TOutput> ? ResolvableSubscription<TOutput, TInput, TValue> : SubscriptionNeedResolve<TOutput, TInput, TValue>;
390
+ }
391
+ /**
392
+ * Interface for a subscription that can be resolved
393
+ * @template TOutput - The output type of the subscription
394
+ * @template TInput - The input type of the subscription
395
+ * @template TValue - The value type of the subscription
396
+ */
397
+ interface ResolvableSubscription<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput>> extends Subscription<TOutput, TInput, TValue> {
398
+ /**
399
+ * Sets the resolve function for the subscription
400
+ * @param resolve - The resolve function
401
+ */
402
+ resolve(resolve: (value: TValue, input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Subscription<TOutput, TInput, TValue>;
403
+ }
404
+ /**
405
+ * A subscription that can not be resolved yet, still needs to be resolved.
406
+ * Interface for a subscription that needs to be resolved
407
+ * @template TOutput - The output type of the subscription
408
+ * @template TInput - The input type of the subscription
409
+ * @template TValue - The value type of the subscription
410
+ */
411
+ interface SubscriptionNeedResolve<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput>> {
412
+ /**
413
+ * Sets the resolve function for the subscription
414
+ * @param resolve - The resolve function
415
+ */
416
+ resolve(resolve: (value: TValue, input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Subscription<TOutput, TInput, TValue>;
417
+ }
418
+ declare class QueryFactoryWithResolve<TInputO, TOutput extends GraphQLSilk, TInput extends GraphQLSilk<TInputO>> extends BaseChainFactory<Query<TOutput, TInput>> implements Query<TOutput, TInput> {
419
+ protected outputSilk: TOutput;
420
+ protected readonly options: QueryOptions<TOutput, TInput>;
421
+ get "~meta"(): Query<TOutput, TInput>["~meta"];
422
+ constructor(outputSilk: TOutput, options: QueryOptions<TOutput, TInput>);
423
+ protected clone(options?: Partial<QueryOptions<TOutput, TInput>> | undefined): this;
424
+ input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): QueryFactoryWithResolve<TInputO, TOutput, TInputNew>;
425
+ output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): QueryFactoryWithResolve<TInputO, TOutputNew, TInput>;
426
+ }
427
+ declare class MutationFactoryWithResolve<TInputO, TOutput extends GraphQLSilk, TInput extends GraphQLSilk<TInputO>> extends BaseChainFactory<Query<TOutput, TInput>> implements Mutation<TOutput, TInput> {
428
+ protected outputSilk: TOutput;
429
+ protected readonly options: MutationOptions<TOutput, TInput>;
430
+ get "~meta"(): Mutation<TOutput, TInput>["~meta"];
431
+ constructor(outputSilk: TOutput, options: MutationOptions<TOutput, TInput>);
432
+ protected clone(options?: Partial<MutationOptions<TOutput, TInput>> | undefined): this;
433
+ input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): MutationFactoryWithResolve<TInputO, TOutput, TInputNew>;
434
+ output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): MutationFactoryWithResolve<TInputO, TOutputNew, TInput>;
435
+ }
436
+ declare class FieldFactoryWithResolve<TParent extends GraphQLSilk, TOutput extends GraphQLSilk, TInputO = never, TInput extends GraphQLSilk<TInputO> | void = void> extends BaseChainFactory<Field<TParent, TOutput, TInput, string[] | undefined>> {
437
+ protected outputSilk: TOutput;
438
+ protected readonly options: FieldOptions<TParent, TOutput, TInput, string[] | undefined>;
439
+ get "~meta"(): Field<TParent, TOutput, TInput, string[] | undefined>["~meta"];
440
+ constructor(outputSilk: TOutput, options: FieldOptions<TParent, TOutput, TInput, string[] | undefined>);
441
+ protected clone(options?: Partial<FieldOptions<TParent, TOutput, TInput, string[] | undefined>> | undefined): this;
442
+ input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): FieldFactoryWithResolve<TParent, TOutput, TInputO, TInputNew>;
443
+ output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): FieldFactoryWithResolve<TParent, TOutputNew, TInputO, TInput>;
444
+ }
445
+ declare namespace types_loom_d_exports {
446
+ export { BaseField, Field, FieldMeta, FieldOrOperation, Mutation, Operation, Query, Resolver, Subscription };
447
+ }
448
+ interface FieldMeta extends GraphQLFieldOptions {
449
+ operation: "field" | "query" | "mutation" | "subscription";
450
+ output: GraphQLSilk;
451
+ input: GraphQLSilk | Record<string, GraphQLSilk> | void;
452
+ middlewares?: Middleware[];
453
+ dependencies?: string[];
454
+ resolve: (...args: any) => MayPromise<any>;
455
+ }
456
+ interface BaseField {
457
+ readonly "~meta": FieldMeta;
458
+ }
459
+ interface Field<TParent extends GraphQLSilk, TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void, TDependencies extends string[] | undefined = undefined> extends BaseField {
460
+ "~meta": {
461
+ operation: "field";
462
+ output: TOutput;
463
+ input: TInput;
464
+ middlewares?: Middleware[];
465
+ dependencies?: TDependencies;
466
+ types?: {
467
+ parent: ReSilk<TParent>;
468
+ };
469
+ resolve: (parent: StandardSchemaV1.InferOutput<NonNullable<TParent>>, input: InferInputO<TInput>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput>>;
470
+ } & GraphQLFieldOptions;
471
+ }
472
+ interface Query<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseField {
473
+ "~meta": {
474
+ operation: "query";
475
+ parent?: undefined;
476
+ output: TOutput;
477
+ input: TInput;
478
+ middlewares?: Middleware[];
479
+ resolve: (input: InferInputO<TInput>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput>>;
480
+ } & GraphQLFieldOptions;
481
+ }
482
+ interface Mutation<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseField {
483
+ "~meta": {
484
+ operation: "mutation";
485
+ parent?: undefined;
486
+ output: TOutput;
487
+ input: TInput;
488
+ middlewares?: Middleware[];
489
+ resolve: (input: InferInputO<TInput>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput>>;
490
+ } & GraphQLFieldOptions;
491
+ }
492
+ interface Subscription<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void, TValue = StandardSchemaV1.InferOutput<TOutput>> extends BaseField {
493
+ "~meta": {
494
+ operation: "subscription";
495
+ parent?: undefined;
496
+ output: TOutput;
497
+ input: TInput;
498
+ middlewares?: Middleware[];
499
+ types?: {
500
+ value: TValue;
501
+ } & GraphQLFieldOptions;
502
+ resolve: (value: TValue, input: InferInputO<TInput>, payload: ResolverPayload | void) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>;
503
+ subscribe: (input: InferInputO<TInput>, payload: ResolverPayload | void) => MayPromise<AsyncIterator<TValue>>;
504
+ } & GraphQLFieldOptions;
505
+ }
506
+ interface Resolver {
507
+ readonly "~meta": {
508
+ [IS_RESOLVER]: true;
509
+ fields: Record<string, BaseField | typeof FIELD_HIDDEN>;
510
+ options?: ResolverOptionsWithExtensions<any>;
511
+ parent?: GraphQLSilk;
512
+ };
513
+ }
514
+ type Operation = Query<GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void> | Mutation<GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void> | Subscription<GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void, any>;
515
+ type FieldOrOperation = Field<GraphQLSilk, GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void, string[] | undefined> | Operation;
516
+ type ReSilk<T extends GraphQLSilk> = GraphQLSilk<NonNullable<T["~standard"]["types"]>["output"], NonNullable<T["~standard"]["types"]>["input"]>;
517
+ //#endregion
518
+ //#region src/resolver/types.d.ts
519
+ interface GraphQLSilk<TOutput = any, TInput = any> extends StandardSchemaV1<TInput, TOutput> {
520
+ /**
521
+ * GraphQL type for schema
522
+ */
523
+ [GET_GRAPHQL_TYPE]?: () => GraphQLOutputType;
524
+ }
525
+ interface ResolverOptions<TField extends FieldOrOperation = FieldOrOperation> {
526
+ middlewares?: Middleware<TField>[];
527
+ }
528
+ interface ResolverOptionsWithExtensions<TField extends FieldOrOperation = FieldOrOperation> extends ResolverOptions<TField>, Pick<GraphQLObjectTypeConfig<any, any>, "extensions"> {}
529
+ interface ResolverOptionsWithParent<TField extends FieldOrOperation = FieldOrOperation> extends ResolverOptionsWithExtensions<TField> {
530
+ parent?: TField extends Field<infer TParent, any, any, any> ? TParent : undefined;
531
+ }
532
+ interface ResolvingOptions extends Pick<ResolverOptions, "middlewares"> {
533
+ payload: ResolverPayload | undefined;
534
+ }
535
+ type OperationType = "query" | "mutation" | "subscription";
536
+ type FieldOrOperationType = "field" | OperationType;
537
+ interface GraphQLFieldOptions extends Pick<GraphQLFieldConfig<any, any>, "description" | "deprecationReason" | "extensions"> {}
538
+ type InferFieldInput<TField extends BaseField> = TField["~meta"]["input"];
539
+ type InferFieldOutput<TField extends BaseField> = TField["~meta"]["output"];
540
+ /**
541
+ * Options for creating a GraphQL Query.
542
+ */
543
+ interface QueryOptions<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends ResolverOptions<Query<TOutput, TInput>>, GraphQLFieldOptions {
544
+ input?: TInput;
545
+ resolve: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>;
546
+ }
547
+ /**
548
+ * Options for creating a GraphQL Mutation.
549
+ */
550
+ interface MutationOptions<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined> extends ResolverOptions<Mutation<TOutput, TInput>>, GraphQLFieldOptions {
551
+ input?: TInput;
552
+ resolve: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>;
553
+ }
554
+ /**
555
+ * Function to create a GraphQL query.
556
+ */
557
+ interface QueryFactory {
558
+ <TOutput extends GraphQLSilk>(output: TOutput, resolve: (input: void, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Query<TOutput, void>;
559
+ <TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void>(output: TOutput, options: QueryOptions<TOutput, TInput>): Query<TOutput, TInput>;
560
+ <TOutput extends GraphQLSilk>(output: TOutput): QueryChainFactory<TOutput, void>;
561
+ }
562
+ interface QueryFactoryWithChain extends QueryFactory, QueryChainFactory<never, void> {}
563
+ /**
564
+ * Function to create a GraphQL mutation.
565
+ */
566
+ interface MutationFactory {
567
+ <TOutput extends GraphQLSilk>(output: TOutput, resolve: (input: void, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Mutation<TOutput, undefined>;
568
+ <TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined>(output: TOutput, options: MutationOptions<TOutput, TInput>): Mutation<TOutput, TInput>;
569
+ <TOutput extends GraphQLSilk>(output: TOutput): MutationChainFactory<TOutput, undefined>;
570
+ }
571
+ /**
572
+ * Function to create a GraphQL mutation.
573
+ */
574
+ interface MutationFactoryWithChain extends MutationFactory, MutationChainFactory<never, undefined> {}
575
+ /**
576
+ * Options for External Filed of existing GraphQL Object.
577
+ */
578
+ interface FieldOptions<TParent extends GraphQLSilk, TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void, TDependencies extends string[] | undefined = undefined> extends ResolverOptions<Field<TParent, TOutput, TInput, TDependencies>>, GraphQLFieldOptions {
579
+ input?: TInput;
580
+ dependencies?: TDependencies;
581
+ resolve: (parent: TDependencies extends string[] ? RequireKeys<NonNullable<StandardSchemaV1.InferOutput<TParent>>, TDependencies[number]> : NonNullable<StandardSchemaV1.InferOutput<TParent>>, input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>;
582
+ }
583
+ /**
584
+ * Function to create a GraphQL Field.
585
+ */
586
+ interface FieldFactory {
587
+ <TParent extends GraphQLSilk, TOutput extends GraphQLSilk>(output: TOutput, resolve: (parent: StandardSchemaV1.InferOutput<TParent>, input: void, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Field<TParent, TOutput, undefined, undefined>;
588
+ <TParent extends GraphQLSilk, TOutput extends GraphQLSilk>(output: TOutput, options: FieldOptions<TParent, TOutput, undefined, undefined>): Field<TParent, TOutput, undefined, undefined>;
589
+ <TParent extends GraphQLSilk, TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined>(output: TOutput, options: FieldOptions<TParent, TOutput, TInput, undefined> & {
590
+ input: TInput;
591
+ }): Field<TParent, TOutput, TInput, undefined>;
592
+ <TParent extends GraphQLSilk, TOutput extends GraphQLSilk, const TDependencies extends string[] | undefined>(output: TOutput, options: FieldOptions<TParent, TOutput, undefined, TDependencies> & {
593
+ dependencies: TDependencies;
594
+ }): Field<TParent, TOutput, undefined, TDependencies>;
595
+ <TParent extends GraphQLSilk, TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined, TDependencies extends string[] | undefined>(output: TOutput, options: FieldOptions<TParent, TOutput, TInput, TDependencies> & {
596
+ input: TInput;
597
+ dependencies: TDependencies;
598
+ }): Field<TParent, TOutput, TInput, TDependencies>;
599
+ <TOutput extends GraphQLSilk>(output: TOutput): FieldChainFactory<TOutput, undefined, undefined>;
600
+ }
601
+ interface FieldFactoryWithUtils extends FieldFactory, FieldChainFactory<never, undefined, undefined> {
602
+ /** Set fields to be hidden in GraphQL Schema */
603
+ hidden: typeof FIELD_HIDDEN;
604
+ }
605
+ /**
606
+ * Options for creating a GraphQL Subscription.
607
+ */
608
+ interface SubscriptionOptions<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput>> extends ResolverOptions<Subscription<TOutput, TInput, TValue>>, GraphQLFieldOptions {
609
+ input?: TInput;
610
+ subscribe: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<AsyncIterator<TValue>>;
611
+ resolve?: (value: TValue, input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>;
612
+ }
613
+ /**
614
+ * Function to create a GraphQL subscription.
615
+ */
616
+ interface SubscriptionFactory {
617
+ <TOutput extends GraphQLSilk, TValue = StandardSchemaV1.InferOutput<TOutput>>(output: TOutput, subscribe: (payload: ResolverPayload | undefined) => MayPromise<AsyncIterator<StandardSchemaV1.InferOutput<TOutput>>>): Subscription<TOutput, undefined, TValue>;
618
+ <TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput>>(output: TOutput, options: SubscriptionOptions<TOutput, TInput, TValue>): Subscription<TOutput, TInput, TValue>;
619
+ <TOutput extends GraphQLSilk>(output: TOutput): SubscriptionChainFactory<TOutput, undefined>;
620
+ }
621
+ interface SubscriptionFactoryWithChain extends SubscriptionFactory, SubscriptionChainFactory<never, undefined> {}
622
+ /**
623
+ * Detailed payload of the current resolver
624
+ */
625
+ interface ResolverPayload<TContext extends object = object, TField extends BaseField = BaseField> {
626
+ /**
627
+ * The previous object, which for a field on the root Query type is often not used.
628
+ */
629
+ readonly root: any;
630
+ /**
631
+ * The arguments provided to the field in the GraphQL query.
632
+ */
633
+ readonly args: Record<string, any>;
634
+ /**
635
+ * The resolved value of the field, or an error.
636
+ */
637
+ readonly context: TContext;
638
+ /**
639
+ * A custom object each resolver can read from/write to.
640
+ */
641
+ readonly info: GraphQLResolveInfo;
642
+ /**
643
+ * The field that is being resolved.
644
+ */
645
+ readonly field: TField;
646
+ }
647
+ //#endregion
648
+ //#region src/utils/args.d.ts
649
+ declare function getOperationOptions(resolveOrOptions: ((...args: any) => any) | FieldOptions<any, any, any, any> | QueryOptions<any, any> | MutationOptions<any, any>): any;
650
+ declare function getSubscriptionOptions(subscribeOrOptions: ((payload: ResolverPayload | undefined) => any) | SubscriptionOptions<any, any, any>): SubscriptionOptions<any, any, any>;
651
+ declare function getFieldOptions({
652
+ description,
653
+ deprecationReason,
654
+ extensions
655
+ }: GraphQLFieldOptions, extraExtensions?: GraphQLFieldExtensions<any, any, any>): GraphQLFieldOptions;
656
+ //#endregion
657
+ //#region src/resolver/silk.d.ts
658
+ /**
659
+ * Create a Silk from Scalar.
660
+ */
661
+ declare function silk<TScalar extends GraphQLVariants<GraphQLScalarType>>(type: TScalar | (() => TScalar), validate?: (value: InferScalarExternalByVariants<TScalar>) => StandardSchemaV1.Result<InferScalarExternalByVariants<TScalar>> | Promise<StandardSchemaV1.Result<InferScalarInternalByVariants<TScalar>>>): GraphQLSilk<InferScalarInternalByVariants<TScalar>, InferScalarInternalByVariants<TScalar>>;
662
+ /**
663
+ * Create a GraphQLSilk Object.
664
+ */
665
+ declare function silk<TObject extends GraphQLVariants<GraphQLObjectType>>(type: TObject | (() => TObject), validate?: (value: InferObjectSourceByVariants<TObject>) => StandardSchemaV1.Result<InferObjectSourceByVariants<TObject>> | Promise<StandardSchemaV1.Result<InferObjectSourceByVariants<TObject>>>): GraphQLSilk<InferObjectSourceByVariants<TObject>, InferObjectSourceByVariants<TObject>>;
666
+ /**
667
+ * Create a GraphQLSilk Object.
668
+ */
669
+ declare function silk<TOutput, TInput = TOutput>(type: GraphQLOutputType | (() => GraphQLOutputType), validate?: (value: TInput) => StandardSchemaV1.Result<TOutput> | Promise<StandardSchemaV1.Result<TOutput>>): GraphQLSilk<TOutput, TInput>;
670
+ declare namespace silk {
671
+ var parse: typeof parseSilk;
672
+ var getType: typeof getGraphQLType;
673
+ var nonNull: typeof nonNullSilk;
674
+ var list: typeof listSilk;
675
+ var nullable: typeof nullableSilk;
676
+ }
677
+ type NonNullSilk<TSilk extends GraphQLSilk<any, any>> = GraphQLSilk<NonNullable<StandardSchemaV1.InferOutput<TSilk>>, NonNullable<StandardSchemaV1.InferInput<TSilk>>>;
678
+ /**
679
+ * Non-nullable Silk.
680
+ */
681
+ declare function nonNullSilk<TSilk extends GraphQLSilk<any, any>>(origin: TSilk): NonNullSilk<TSilk>;
682
+ type ListSilk<TSilk extends GraphQLSilk<any, any>> = GraphQLSilk<EnsureArray<StandardSchemaV1.InferOutput<TSilk>>, EnsureArray<StandardSchemaV1.InferOutput<TSilk>>>;
683
+ /**
684
+ * List Silk.
685
+ */
686
+ declare function listSilk<TSilk extends GraphQLSilk<any, any>>(origin: TSilk): ListSilk<TSilk>;
687
+ type NullableSilk<TSilk extends GraphQLSilk<any, any>> = GraphQLSilk<StandardSchemaV1.InferOutput<TSilk> | null | undefined, StandardSchemaV1.InferInput<TSilk>>;
688
+ /**
689
+ * Nullable Silk.
690
+ */
691
+ declare function nullableSilk<TSilk extends GraphQLSilk<any, any>>(origin: TSilk): NullableSilk<TSilk>;
692
+ /**
693
+ * Get GraphQL Output Type from Silk.
694
+ * @param silk GraphQL Silk
695
+ * @returns GraphQL Output Type
696
+ */
697
+ declare function getGraphQLType(silk: GraphQLSilk): GraphQLOutputType;
698
+ /**
699
+ * Validate and transform input to output
700
+ * @param silk silk GraphQL Silk
701
+ * @param input
702
+ * @returns output
703
+ */
704
+ declare function parseSilk<TSilk extends GraphQLSilk>(silk: TSilk, input: StandardSchemaV1.InferInput<TSilk>): MayPromise<StandardSchemaV1.Result<StandardSchemaV1.InferOutput<TSilk>>>;
705
+ declare function isSilk(target: any): target is GraphQLSilk;
706
+ type GraphQLVariants<TSource extends GraphQLNullableType> = TSource | GraphQLList<TSource> | GraphQLList<GraphQLNonNull<TSource>> | GraphQLNonNull<TSource> | GraphQLNonNull<GraphQLList<TSource>> | GraphQLNonNull<GraphQLList<GraphQLNonNull<TSource>>>;
707
+ type InferScalarInternalByVariants<T extends GraphQLVariants<GraphQLScalarType>> = T extends GraphQLNonNull<infer U> ? U extends GraphQLVariants<GraphQLScalarType> ? NonNullable<InferScalarInternalByVariants<U>> : never : T extends GraphQLList<infer U> ? U extends GraphQLVariants<GraphQLScalarType> ? InferScalarInternalByVariants<U>[] : never : T extends GraphQLScalarType<infer TInternal, any> ? TInternal | null | undefined : never;
708
+ type InferScalarExternalByVariants<T extends GraphQLVariants<GraphQLScalarType>> = T extends GraphQLNonNull<infer U> ? U extends GraphQLVariants<GraphQLScalarType> ? NonNullable<InferScalarExternalByVariants<U>> : never : T extends GraphQLList<infer U> ? U extends GraphQLVariants<GraphQLScalarType> ? InferScalarExternalByVariants<U>[] : never : T extends GraphQLScalarType<any, infer TExternal> ? TExternal | null | undefined : never;
709
+ type InferObjectSourceByVariants<T extends GraphQLVariants<GraphQLObjectType>> = T extends GraphQLNonNull<infer U> ? U extends GraphQLVariants<GraphQLObjectType> ? NonNullable<InferObjectSourceByVariants<U>> : never : T extends GraphQLList<infer U> ? U extends GraphQLVariants<GraphQLObjectType> ? InferObjectSourceByVariants<U>[] : never : T extends GraphQLObjectType<infer TSource> ? TSource | null | undefined : never;
710
+ type EnsureArray<T> = T extends Array<infer U> ? U[] : T[];
711
+ //#endregion
712
+ //#region src/resolver/resolver.d.ts
713
+ /**
714
+ * Creates a GraphQL query resolver
715
+ * @param output - The output type definition for the query
716
+ * @param resolveOrOptions - Either a resolve function or options object
717
+ * @returns A GraphQL query resolver
718
+ */
719
+ declare const createQuery: (output: GraphQLSilk<any, any>, resolveOrOptions?: ((...args: any) => MayPromise<unknown>) | QueryOptions<any, any>) => Query<any, any> | QueryChainFactory<never, void>;
720
+ /**
721
+ * Factory function for creating GraphQL queries with chainable configuration
722
+ */
723
+ declare const query$1: QueryFactoryWithChain;
724
+ /**
725
+ * Creates a GraphQL mutation resolver
726
+ * @param output - The output type definition for the mutation
727
+ * @param resolveOrOptions - Either a resolve function or options object
728
+ * @returns A GraphQL mutation resolver
729
+ */
730
+ declare const createMutation: (output: GraphQLSilk<any, any>, resolveOrOptions?: (() => MayPromise<unknown>) | MutationOptions<any, any>) => Mutation<any, any> | MutationChainFactory<never, undefined>;
731
+ /**
732
+ * Factory function for creating GraphQL mutations with chainable configuration
733
+ */
734
+ declare const mutation$1: MutationFactoryWithChain;
735
+ /**
736
+ * Creates a GraphQL field resolver
737
+ * @param output - The output type definition for the field
738
+ * @param resolveOrOptions - Either a resolve function or options object
739
+ * @returns A GraphQL field resolver
740
+ */
741
+ declare const createField: (output: GraphQLSilk<any, any>, resolveOrOptions?: (() => unknown) | FieldOptions<GraphQLSilk, GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void, string[] | undefined>) => FieldChainFactory<never, undefined, undefined> | Field<any, any, any, any>;
742
+ /**
743
+ * Factory function for creating GraphQL fields with chainable configuration
744
+ */
745
+ declare const field: FieldFactoryWithUtils;
746
+ /**
747
+ * Default subscription resolver that returns the source value
748
+ * @param source - The source value to resolve
749
+ */
750
+ declare const defaultSubscriptionResolve: (source: any) => any;
751
+ /**
752
+ * Creates a GraphQL subscription resolver
753
+ * @param output - The output type definition for the subscription
754
+ * @returns A subscription chain factory
755
+ */
756
+ declare function createSubscription(output: GraphQLSilk<any, any>): SubscriptionChainFactory;
757
+ /**
758
+ * Creates a GraphQL subscription resolver with subscribe function
759
+ * @param output - The output type definition for the subscription
760
+ * @param subscribeOrOptions - Either a subscribe function or options object
761
+ * @returns A GraphQL subscription resolver
762
+ */
763
+ declare function createSubscription(output: GraphQLSilk<any, any>, subscribeOrOptions: (() => MayPromise<AsyncIterator<unknown>>) | SubscriptionOptions<any, any, any>): Subscription<any, any, any>;
764
+ /**
765
+ * Factory function for creating GraphQL subscriptions with chainable configuration
766
+ */
767
+ declare const subscription$1: SubscriptionFactoryWithChain;
768
+ declare const resolver: ResolverFactory;
769
+ /**
770
+ * Collection of factory functions for creating GraphQL operations
771
+ */
772
+ declare const loom: {
773
+ query: QueryFactoryWithChain;
774
+ resolver: ResolverFactory;
775
+ field: FieldFactoryWithUtils;
776
+ subscription: SubscriptionFactoryWithChain;
777
+ mutation: MutationFactoryWithChain;
778
+ };
779
+ /**
780
+ * Properties for creating an executor
781
+ */
782
+ interface ToExecutorProps {
783
+ /** WeakMap for memoization */
784
+ memoization?: WeakMap<WeakKey, any>;
785
+ }
786
+ /**
787
+ * Factory interface for creating GraphQL resolvers
788
+ */
789
+ interface ResolverFactory {
790
+ /**
791
+ * Creates a resolver for an object type
792
+ * @template TParent - The parent type
793
+ * @template TFields - The fields of the object type
794
+ * @param parent - The parent type definition
795
+ * @param fields - The fields to resolve
796
+ * @param options - Optional resolver options
797
+ */
798
+ of<TParent extends GraphQLSilk, TFields extends Record<string, Field<TParent, any, any, any> | Operation | typeof FIELD_HIDDEN>>(parent: TParent, fields: TFields, options?: ResolverOptionsWithExtensions<OmitInUnion<ValueOf<TFields>, typeof FIELD_HIDDEN>>): ObjectChainResolver<TParent, TFields>;
799
+ /**
800
+ * Creates a resolver for operations
801
+ * @template TFields - The operations to resolve
802
+ * @param operations - The operations to resolve
803
+ * @param options - Optional resolver options
804
+ */
805
+ <TFields extends Record<string, Operation>>(operations: TFields, options?: ResolverOptions<ValueOf<TFields>>): ChainResolver<TFields>;
806
+ }
807
+ interface ResolverMeta<TFields extends Record<string, FieldOrOperation | typeof FIELD_HIDDEN>> {
808
+ [IS_RESOLVER]: true;
809
+ fields: TFields;
810
+ options?: ResolverOptionsWithExtensions;
811
+ }
812
+ /**
813
+ * Base class for chain resolvers
814
+ * @template TFields - The fields or operations to resolve
815
+ */
816
+ declare class ChainResolver<TFields extends Record<string, FieldOrOperation | typeof FIELD_HIDDEN>> implements Resolver {
817
+ protected meta: ResolverMeta<TFields>;
818
+ /**
819
+ * Creates a new chain resolver
820
+ * @param fields - The fields or operations to resolve
821
+ * @param options - Optional resolver options
822
+ */
823
+ constructor(fields: TFields, options?: ResolverOptionsWithExtensions<any>);
824
+ /**
825
+ * Gets the metadata for the resolver
826
+ */
827
+ get "~meta"(): ResolverMeta<TFields>;
828
+ /**
829
+ * Adds middleware functions to the resolver
830
+ * @param middlewares - The middleware functions to add
831
+ */
832
+ use(...middlewares: Middleware<OmitInUnion<ValueOf<TFields>, typeof FIELD_HIDDEN>>[]): this;
833
+ toExecutor(...middlewares: Middleware[]): Executor<TFields>;
834
+ protected toExecutorOperation(field: FieldOrOperation | typeof FIELD_HIDDEN, executorMiddlewares: Middleware[]): ((...args: any) => any) | undefined;
835
+ }
836
+ /**
837
+ * Class for resolving object types
838
+ * @template TParent - The parent type
839
+ * @template TFields - The fields to resolve
840
+ */
841
+ declare class ObjectChainResolver<TParent extends GraphQLSilk, TFields extends Record<string, FieldOrOperation | typeof FIELD_HIDDEN>> extends ChainResolver<TFields> {
842
+ protected meta: ResolverMeta<TFields> & {
843
+ parent: TParent;
844
+ };
845
+ /**
846
+ * Creates a new object chain resolver
847
+ * @param parent - The parent type definition
848
+ * @param fields - The fields to resolve
849
+ * @param options - Optional resolver options
850
+ */
851
+ constructor(parent: TParent, fields: TFields, options?: ResolverOptionsWithExtensions<any>);
852
+ /**
853
+ * Gets the metadata for the resolver
854
+ */
855
+ get "~meta"(): ResolverMeta<TFields> & {
856
+ parent: TParent;
857
+ };
858
+ /**
859
+ * Sets custom extensions for the resolver
860
+ * @param extensions - The extensions to add
861
+ */
862
+ extensions(extensions: Pick<GraphQLObjectTypeConfig<any, any>, "extensions">["extensions"]): this;
863
+ }
864
+ /**
865
+ * Type for the executor of a resolver
866
+ * @template TFields - The fields or operations to resolve
867
+ */
868
+ type Executor<TFields extends Record<string, FieldOrOperation | typeof FIELD_HIDDEN>> = { [K in keyof TFields]: TFields[K] extends Field<infer TParent, infer TOutput, infer TInput, string[] | undefined> ? (parent: StandardSchemaV1.InferOutput<TParent>, args: InferInputI<TInput>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput>> : TFields[K] extends Query<infer TOutput, infer TInput> ? (args: InferInputI<TInput>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput>> : TFields[K] extends Mutation<infer TOutput, infer TInput> ? (args: InferInputI<TInput>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput>> : never };
869
+ //#endregion
870
+ //#region src/utils/middleware.d.ts
871
+ /**
872
+ * The operation of the field:
873
+ * - `field`
874
+ * - `query`
875
+ * - `mutation`
876
+ * - `subscription.resolve`
877
+ * - `subscription.subscribe`
878
+ * - `resolveReference`
879
+ */
880
+ type MiddlewareOperation = "field" | "query" | "mutation" | "subscription.resolve" | "subscription.subscribe" | "resolveReference";
881
+ interface MiddlewareOptions<TField extends BaseField = BaseField> {
882
+ /** The Output Silk */
883
+ outputSilk: StandardSchemaV1.InferOutput<InferFieldOutput<TField>>;
884
+ /** The previous object. */
885
+ parent: InferFieldParent<TField>;
886
+ /** A function to parse the input */
887
+ parseInput: CallableInputParser<TField["~meta"]["input"]>;
888
+ /** The executing operation */
889
+ operation: MiddlewareOperation;
890
+ /** The payload of the resolver */
891
+ payload: ResolverPayload | undefined;
892
+ }
893
+ type InferFieldParent<TField extends BaseField> = TField extends Field<infer TParent, any, any, infer TDependencies> ? TDependencies extends string[] ? RequireKeys<NonNullable<StandardSchemaV1.InferOutput<TParent>>, TDependencies[number]> : NonNullable<StandardSchemaV1.InferOutput<TParent>> : undefined;
894
+ interface CallableMiddlewareOptions<TField extends BaseField = BaseField> extends MiddlewareOptions<TField> {
895
+ /** The function to call next in the middleware chain. */
896
+ next: () => MayPromise<StandardSchemaV1.InferOutput<InferFieldOutput<TField>>>;
897
+ /** The function to call next in the middleware chain. */
898
+ (): MayPromise<StandardSchemaV1.InferOutput<InferFieldOutput<TField>>>;
899
+ }
900
+ interface MiddlewareConfig {
901
+ /** The operations to apply the middleware to. */
902
+ operations?: MiddlewareOperation[];
903
+ }
904
+ interface Middleware<TField extends BaseField = any> extends Partial<MiddlewareConfig> {
905
+ (options: CallableMiddlewareOptions<TField>): MayPromise<StandardSchemaV1.InferOutput<InferFieldOutput<TField>>>;
906
+ }
907
+ declare function applyMiddlewares<TField extends BaseField = BaseField>(options: MiddlewareOptions<TField>, resolveFunction: () => MayPromise<StandardSchemaV1.InferOutput<InferFieldOutput<TField>>>, middlewares: Middleware[]): Promise<StandardSchemaV1.InferOutput<InferFieldOutput<TField>>>;
908
+ declare function filterMiddlewares(operation: MiddlewareOperation, ...middlewareList: (Middleware | Iterable<Middleware> | undefined | null)[]): Middleware[];
909
+ //#endregion
910
+ //#region src/utils/object.d.ts
911
+ /**
912
+ * Creates an object map with the same keys as `map` and values generated by
913
+ * running each value of `record` thru `fn`.
914
+ */
915
+ declare function mapValue<T, V>(record: Record<string, T>, fn: (value: T, key: string) => V | typeof mapValue.SKIP): Record<string, V>;
916
+ declare namespace mapValue {
917
+ var SKIP: unique symbol;
918
+ }
919
+ declare function toObjMap<T>(obj: Maybe<ReadOnlyObjMapLike<T>>): ReadOnlyObjMap<T>;
920
+ declare function notNullish<T>(x: T | undefined | null): x is T;
921
+ declare function deepMerge<T extends Record<string, any>>(...objects: (T | null | undefined)[]): T;
922
+ /**
923
+ * Wraps the provided data in an object with a single key `"~meta"`.
924
+ *
925
+ * @template T - The type of the data to be wrapped.
926
+ * @param {T} data - The data to be wrapped.
927
+ * @returns {{ "~meta": T }} - An object with a single key `"~meta"` containing the provided data.
928
+ * @example
929
+ * const originalData = { key: "value" };
930
+ * const metaData = meta(originalData);
931
+ * console.log(metaData); // Output: { "~meta": { key: "value" } }
932
+ */
933
+ declare function meta<T>(data: T): {
934
+ "~meta": T;
935
+ };
936
+ type Maybe<T> = null | undefined | T;
937
+ type ReadOnlyObjMapLike<T> = ReadOnlyObjMap<T> | {
938
+ readonly [key: string]: T;
939
+ };
940
+ interface ReadOnlyObjMap<T> {
941
+ readonly [key: string]: T;
942
+ }
943
+ //#endregion
944
+ //#region src/utils/parse-resolving-fields.d.ts
945
+ /**
946
+ * Represents the state of field resolution in a GraphQL query.
947
+ */
948
+ interface ResolvingFields {
949
+ /**
950
+ * Fields explicitly requested in the GraphQL query
951
+ */
952
+ requestedFields: ReadonlySet<string>;
953
+ /**
954
+ * Fields that are derived from other fields (computed fields)
955
+ */
956
+ derivedFields: ReadonlySet<string>;
957
+ /**
958
+ * Fields that derived fields depend on
959
+ */
960
+ derivedDependencies: ReadonlySet<string>;
961
+ /**
962
+ * Final set of fields that need to be resolved, after processing derived fields
963
+ */
964
+ selectedFields: ReadonlySet<string>;
965
+ }
966
+ /**
967
+ * Analyzes and processes field resolution in a GraphQL query deeply.
968
+ *
969
+ * @param payload - The resolver payload containing the current field resolution context
970
+ * @param [maxDepth=Infinity] - Maximum depth of nested fields to parse
971
+ * @returns A map of field paths to their resolving fields
972
+ */
973
+ declare function getDeepResolvingFields(payload: Pick<ResolverPayload, "info">, maxDepth?: number): Map<string, ResolvingFields>;
974
+ /**
975
+ * Analyzes and processes field resolution in a GraphQL query.
976
+ *
977
+ * @param payload - The resolver payload containing the current field resolution context
978
+ * @returns An object containing sets of different field types
979
+ */
980
+ declare function getResolvingFields(payload: Pick<ResolverPayload, "info">): ResolvingFields;
981
+ /**
982
+ * Parses the GraphQL resolve info to extract all requested fields.
983
+ * Returns a Set of field paths where nested fields are represented as 'parent.field'.
984
+ * Supports @include, @skip directives, fragments, and variables.
985
+ *
986
+ * @param info - The GraphQL resolve info object containing the query information
987
+ * @param maxDepth - Maximum depth of nested fields to parse (default: 1)
988
+ * @returns A Set of field paths
989
+ */
990
+ declare function parseResolvingFields(info: GraphQLResolveInfo, maxDepth?: number): Set<string>;
991
+ //#endregion
992
+ //#region src/utils/string.d.ts
993
+ declare function pascalCase(str: string): string;
994
+ declare function capitalize<T extends string>(str: T): Capitalize<T>;
995
+ declare function screamingSnakeCase(str: string): string;
996
+ //#endregion
997
+ //#region src/utils/error.d.ts
998
+ declare function markErrorLocation<TError>(error: TError, ...locations: string[]): TError;
999
+ declare function tryIn<T>(func: () => T, ...locations: string[]): T;
1000
+ /**
1001
+ * mark message with location
1002
+ * @param message origin message
1003
+ * @param locations where error happened
1004
+ * @returns message with location
1005
+ * @example markLocation("error", "banana") // "[banana] hello"
1006
+ * @example markLocation("error", fruit, banana) // "[fruit.banana] error"
1007
+ * @example markLocation("[banana] error", "fruit") // "[fruit.banana] error"
1008
+ * @example markLocation("[fruit.banana] error", "favorite") // "[favorite.fruit.banana] error"
1009
+ */
1010
+ declare function markLocation(message: string, ...locations: string[]): string;
1011
+ //#endregion
1012
+ //#region src/utils/loader.d.ts
1013
+ type BatchLoadFn<TKey, TData> = (keys: TKey[]) => Promise<(TData | Error)[]>;
1014
+ /**
1015
+ * GraphQL Loom built-in data loader.
1016
+ */
1017
+ declare abstract class LoomDataLoader<TKey, TData> {
1018
+ protected abstract batchLoad(keys: TKey[]): Promise<(TData | Error)[]>;
1019
+ protected results: Map<TKey, Promise<TData>>;
1020
+ protected resolvers: Map<TKey, [resolve: (value: TData | PromiseLike<TData>) => void, reject: (reason?: any) => void]>;
1021
+ constructor();
1022
+ /**
1023
+ * Load data for a given key.
1024
+ * @param key - The key to load data for.
1025
+ * @returns A promise that resolves to the loaded data.
1026
+ */
1027
+ load(key: TKey): Promise<TData>;
1028
+ /**
1029
+ * Clear the cache and reset the loader.
1030
+ */
1031
+ clear(): void;
1032
+ protected executeBatchLoad(): Promise<void>;
1033
+ protected nextTickPromise?: Promise<void>;
1034
+ protected nextTickBatchLoad(): Promise<void>;
1035
+ static nextTick(): Promise<void>;
1036
+ }
1037
+ declare class EasyDataLoader<TKey, TData> extends LoomDataLoader<TKey, TData> {
1038
+ protected readonly batchLoadFn: BatchLoadFn<TKey, TData>;
1039
+ protected batchLoad(keys: TKey[]): Promise<(TData | Error)[]>;
1040
+ constructor(batchLoadFn: BatchLoadFn<TKey, TData>);
1041
+ }
1042
+ //#endregion
1043
+ //#region src/utils/context.d.ts
1044
+ /**
1045
+ * Empty Resolver Arguments that only store the memoization
1046
+ */
1047
+ interface OnlyMemoizationPayload {
1048
+ memoization: WeakMap<WeakKey, any>;
1049
+ isMemoization: true;
1050
+ }
1051
+ /**
1052
+ * Create an empty memoization payload for the resolver
1053
+ * @returns the empty memoization payload
1054
+ */
1055
+ declare function onlyMemoization(): OnlyMemoizationPayload;
1056
+ declare function isOnlyMemoryPayload(payload: OnlyMemoizationPayload | Pick<ResolverPayload, "context">): payload is OnlyMemoizationPayload;
1057
+ declare function getMemoizationMap(payload: OnlyMemoizationPayload | Pick<ResolverPayload, "context">): WeakMap<WeakKey, any>;
1058
+ interface ContextMemoryContainer {
1059
+ [CONTEXT_MAP_KEY]?: WeakMap<WeakKey, any>;
1060
+ }
1061
+ declare function assignContextMap(target: ContextMemoryContainer): WeakMap<WeakKey, any>;
1062
+ //#endregion
1063
+ //#region src/schema/schema-weaver.d.ts
1064
+ interface SchemaWeaver {
1065
+ vendor: string;
1066
+ getGraphQLType: (schema: any) => GraphQLOutputType;
1067
+ }
1068
+ declare function isSchemaVendorWeaver(some: any): some is SchemaWeaver;
1069
+ //#endregion
1070
+ //#region src/schema/weaver-context.d.ts
1071
+ interface WeaverContext {
1072
+ id: number;
1073
+ loomObjectMap: Map<GraphQLObjectType, LoomObjectType>;
1074
+ loomUnionMap: Map<GraphQLUnionType, GraphQLUnionType>;
1075
+ inputMap: Map<GraphQLObjectType | GraphQLInterfaceType, GraphQLInputObjectType>;
1076
+ interfaceMap: Map<GraphQLObjectType, GraphQLInterfaceType>;
1077
+ configs: Map<string | symbol, WeaverConfig>;
1078
+ getConfig: <TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]) => TConfig | undefined;
1079
+ setConfig<TConfig extends WeaverConfig>(config: TConfig): void;
1080
+ deleteConfig: <TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]) => void;
1081
+ namedTypes: Map<string, GraphQLOutputType>;
1082
+ memoNamedType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(gqlType: TGraphQLType): TGraphQLType;
1083
+ getNamedType<T extends GraphQLOutputType>(name: string): T | undefined;
1084
+ names: WeakMap<object, string>;
1085
+ vendorWeavers: Map<string, SchemaWeaver>;
1086
+ }
1087
+ interface WeaverConfig {
1088
+ [WEAVER_CONFIG]: string | symbol;
1089
+ vendorWeaver?: SchemaWeaver;
1090
+ }
1091
+ declare function initWeaverContext(): WeaverContext;
1092
+ declare namespace initWeaverContext {
1093
+ var increasingID: number;
1094
+ }
1095
+ type GlobalContextRequiredKeys = "names" | "getConfig" | "setConfig" | "deleteConfig" | "getNamedType" | "memoNamedType";
1096
+ interface GlobalWeaverContext extends Partial<Omit<WeaverContext, GlobalContextRequiredKeys>>, Pick<WeaverContext, GlobalContextRequiredKeys> {
1097
+ value?: WeaverContext;
1098
+ useConfig<TConfig extends WeaverConfig, TCallback extends () => any>(config: TConfig, callback: TCallback): ReturnType<TCallback>;
1099
+ GraphQLTypes: WeakMap<object, GraphQLOutputType>;
1100
+ getGraphQLType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(origin: object): TGraphQLType | undefined;
1101
+ memoGraphQLType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(origin: object, gqlType: TGraphQLType): TGraphQLType;
1102
+ }
1103
+ declare const weaverContext: GlobalWeaverContext;
1104
+ declare function provideWeaverContext<T>(func: () => T, value: WeaverContext | undefined): T;
1105
+ declare namespace provideWeaverContext {
1106
+ var inherit: <T>(func: () => T) => () => T;
1107
+ }
1108
+ /**
1109
+ * collect names for schemas
1110
+ * @param namesList - names to collect
1111
+ * @returns namesRecord
1112
+ */
1113
+ declare function collectNames<TRecords extends Record<string, object>[]>(...namesList: TRecords): UnionToIntersection<TRecords[number]>;
1114
+ /**
1115
+ * collect name for schema
1116
+ * @param name - name for
1117
+ * @param schema - schema to be named
1118
+ * @returns schema
1119
+ */
1120
+ declare function collectName<TSchema extends object>(name: string, schema: TSchema): TSchema;
1121
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
1122
+ //#endregion
1123
+ //#region src/schema/object.d.ts
1124
+ declare class LoomObjectType extends GraphQLObjectType {
1125
+ protected extraFields: Map<string, BaseField>;
1126
+ protected hiddenFields: Set<string>;
1127
+ static AUTO_ALIASING: "__gqloom_auto_aliasing";
1128
+ protected weaverContext: WeaverContext;
1129
+ protected globalOptions?: ResolverOptions;
1130
+ /**
1131
+ * field name -> resolver
1132
+ */
1133
+ protected resolvers: Map<string, Resolver>;
1134
+ constructor(objectOrGetter: string | GraphQLObjectType | GraphQLObjectTypeConfig<any, any> | (() => GraphQLObjectType | GraphQLObjectTypeConfig<any, any>), options?: {
1135
+ weaverContext?: WeaverContext;
1136
+ globalOptions?: ResolverOptions;
1137
+ });
1138
+ protected hasExplicitName?: boolean;
1139
+ protected _aliases: string[];
1140
+ get aliases(): string[];
1141
+ addAlias(name: string): void;
1142
+ protected renameByAliases(): void;
1143
+ hideField(name: string): void;
1144
+ addField(name: string, field: BaseField, resolver: Resolver | undefined): void;
1145
+ mergeExtensions(extensions: GraphQLObjectTypeConfig<any, any>["extensions"]): void;
1146
+ private extraFieldMap?;
1147
+ getFields(): GraphQLFieldMap<any, any>;
1148
+ protected mapToFieldConfig(map: Map<string, BaseField>): Record<string, GraphQLFieldConfig<any, any>>;
1149
+ toFieldConfig(field: BaseField, fieldName: string): GraphQLFieldConfig<any, any>;
1150
+ protected provideForResolve(field: BaseField, fieldName: string): GraphQLFieldConfig<any, any>["resolve"];
1151
+ protected provideForSubscribe(field: BaseField | Subscription<any, any, any>, fieldName: string): GraphQLFieldConfig<any, any>["subscribe"] | undefined;
1152
+ protected getCacheType(gqlType: GraphQLOutputType, fieldName?: string): GraphQLOutputType;
1153
+ get options(): {
1154
+ resolverOptions: ResolverOptions<FieldOrOperation> | undefined;
1155
+ weaverContext: WeaverContext;
1156
+ };
1157
+ }
1158
+ declare const OPERATION_OBJECT_NAMES: Set<string>;
1159
+ declare function getCacheType(gqlType: GraphQLOutputType, options?: {
1160
+ weaverContext?: WeaverContext;
1161
+ resolverOptions?: ResolverOptions;
1162
+ fieldName?: string;
1163
+ parent?: LoomObjectType;
1164
+ }): GraphQLOutputType;
1165
+ //#endregion
1166
+ //#region src/schema/types.d.ts
1167
+ interface CoreSchemaWeaverConfigOptions extends GraphQLSchemaConfig {
1168
+ getInputObjectName?: (name: string) => string;
1169
+ weaverContext?: WeaverContext;
1170
+ }
1171
+ interface CoreSchemaWeaverConfig extends WeaverConfig, CoreSchemaWeaverConfigOptions {
1172
+ [WEAVER_CONFIG]: "gqloom.core.schema";
1173
+ }
1174
+ //#endregion
1175
+ //#region src/schema/schema-loom.d.ts
1176
+ interface SchemaWeaverParameters extends Partial<Record<"query" | "mutation" | "subscription", LoomObjectType>>, Pick<GraphQLSchemaConfig, "types"> {}
1177
+ declare class GraphQLSchemaLoom {
1178
+ query?: LoomObjectType;
1179
+ mutation?: LoomObjectType;
1180
+ subscription?: LoomObjectType;
1181
+ types: Set<GraphQLNamedType>;
1182
+ context: WeaverContext;
1183
+ resolverOptions?: ResolverOptions;
1184
+ /**
1185
+ * Create a Schema Weaver config object
1186
+ * @param config Schema Weaver config options
1187
+ * @returns a Schema Weaver config object
1188
+ */
1189
+ static config(config: CoreSchemaWeaverConfigOptions): CoreSchemaWeaverConfig;
1190
+ constructor({
1191
+ query,
1192
+ mutation,
1193
+ subscription,
1194
+ types
1195
+ }?: SchemaWeaverParameters, context?: WeaverContext);
1196
+ use(...middlewares: Middleware[]): this;
1197
+ add(resolver: Resolver, modifyParent?: (parent: LoomObjectType) => LoomObjectType): this;
1198
+ addVendor(weaver: SchemaWeaver): this;
1199
+ addType(silk: GraphQLSilk): this;
1200
+ setConfig<TConfig extends WeaverConfig>(config: TConfig): this;
1201
+ weaveGraphQLSchema(): GraphQLSchema;
1202
+ protected addResolver(resolver: Resolver, modifyParent?: (parent: LoomObjectType) => LoomObjectType): this;
1203
+ protected getOperationObject(type: "query" | "mutation" | "subscription"): LoomObjectType;
1204
+ protected get fieldOptions(): ConstructorParameters<typeof LoomObjectType>[1];
1205
+ static optionsFrom(...inputs: (Resolver | Middleware | SchemaWeaver | WeaverConfig | GraphQLSilk)[]): {
1206
+ context: WeaverContext | undefined;
1207
+ configs: Set<WeaverConfig>;
1208
+ middlewares: Set<Middleware<any>>;
1209
+ resolvers: Set<Resolver>;
1210
+ silks: Set<GraphQLSilk<any, any>>;
1211
+ weavers: Set<SchemaWeaver>;
1212
+ };
1213
+ /**
1214
+ * Weave a GraphQL Schema from resolvers
1215
+ * @param inputs Resolvers, Global Middlewares, WeaverConfigs Or SchemaWeaver
1216
+ * @returns GraphQL Schema
1217
+ */
1218
+ static weave(...inputs: (Resolver | Middleware | SchemaWeaver | WeaverConfig | GraphQLSilk)[]): GraphQLSchema;
1219
+ }
1220
+ /**
1221
+ * Weave a GraphQL Schema from resolvers
1222
+ * @param inputs Resolvers, Global Middlewares or WeaverConfigs
1223
+ * @returns GraphQL Schema
1224
+ */
1225
+ declare const weave: typeof GraphQLSchemaLoom.weave;
1226
+ //#endregion
1227
+ //#region src/schema/input.d.ts
1228
+ interface EnsureInputOptions {
1229
+ fieldName?: string;
1230
+ }
1231
+ declare function inputToArgs(input: GraphQLSilk | Record<string, GraphQLSilk> | undefined | void, options: EnsureInputOptions | undefined): GraphQLFieldConfigArgumentMap | undefined;
1232
+ declare function ensureInputType(silkOrType: GraphQLType | GraphQLSilk, options: EnsureInputOptions | undefined): GraphQLInputType;
1233
+ declare function ensureInputObjectType(object: GraphQLObjectType | GraphQLInterfaceType | GraphQLInputObjectType, options: EnsureInputOptions | undefined): GraphQLInputObjectType;
1234
+ //#endregion
1235
+ //#region src/schema/interface.d.ts
1236
+ declare function ensureInterfaceType(gqlType: GraphQLOutputType, interfaceConfig?: Partial<GraphQLInterfaceTypeConfig<any, any>>): GraphQLInterfaceType;
1237
+ //#endregion
1238
+ //#region src/schema/extensions.d.ts
1239
+ interface GQLoomExtensions {
1240
+ defaultValue?: any;
1241
+ gqloom?: GQLoomExtensionAttribute;
1242
+ directives?: DirectiveItem[] | DirectiveRecord;
1243
+ }
1244
+ interface DirectiveItem {
1245
+ name: string;
1246
+ args?: Record<string, any>;
1247
+ }
1248
+ type DirectiveRecord = Record<string, Record<string, any>>;
1249
+ interface GQLoomExtensionAttribute {
1250
+ directives?: string[];
1251
+ }
1252
+ //#endregion
1253
+ 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 };