@gqloom/core 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/context.cjs +1 -1
- package/dist/context.d.cts +1 -1
- package/dist/context.d.ts +1 -1
- package/dist/context.js +1 -1
- package/dist/{index-DWjUYc0-.d.ts → index-BdLdDytD.d.ts} +171 -159
- package/dist/{index-DBqGrLn7.d.cts → index-C26E_cfW.d.cts} +171 -158
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{parse-resolving-fields-BS_BL7I_.js → parse-resolving-fields-CH8rJgks.js} +35 -17
- package/dist/{parse-resolving-fields-BXQG_2Z-.cjs → parse-resolving-fields-Czn0O39L.cjs} +35 -17
- package/package.json +1 -1
|
@@ -97,7 +97,7 @@ declare const FIELD_HIDDEN = false;
|
|
|
97
97
|
* @template TOutput - The output type of the GraphQL field
|
|
98
98
|
* @template TInput - The input type of the GraphQL field, can be a single type or a record of types
|
|
99
99
|
*/
|
|
100
|
-
interface IChainFactory<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> {
|
|
100
|
+
interface IChainFactory<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> {
|
|
101
101
|
/**
|
|
102
102
|
* Sets the description for the GraphQL field
|
|
103
103
|
* @param description - The description text for the field
|
|
@@ -118,13 +118,13 @@ interface IChainFactory<TOutput extends GraphQLSilk, TInput extends GraphQLSilk
|
|
|
118
118
|
* @template TOutputNew - The new output type
|
|
119
119
|
* @param output - The output type definition
|
|
120
120
|
*/
|
|
121
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): IChainFactory<TOutputNew, TInput>;
|
|
121
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): IChainFactory<TOutputNew, TInput$1>;
|
|
122
122
|
/**
|
|
123
123
|
* Sets the input type for the GraphQL field
|
|
124
124
|
* @template TInputNew - The new input type
|
|
125
125
|
* @param input - The input type definition
|
|
126
126
|
*/
|
|
127
|
-
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): IChainFactory<TOutput, TInputNew>;
|
|
127
|
+
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): IChainFactory<TOutput$1, TInputNew>;
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
130
|
* Options for configuring a chain factory
|
|
@@ -184,7 +184,7 @@ declare abstract class BaseChainFactory<TField extends BaseField = any> {
|
|
|
184
184
|
* @template TInput - The input type of the field
|
|
185
185
|
* @template TDependencies - The dependencies of the field
|
|
186
186
|
*/
|
|
187
|
-
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> {
|
|
187
|
+
declare class FieldChainFactory<TOutput$1 extends GraphQLSilk = never, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TDependencies$1 extends string[] | undefined = undefined> extends BaseChainFactory<Field<any, TOutput$1, TInput$1, TDependencies$1>> implements IChainFactory<TOutput$1, TInput$1> {
|
|
188
188
|
/**
|
|
189
189
|
* Returns the available methods for the field chain factory
|
|
190
190
|
*/
|
|
@@ -199,25 +199,25 @@ declare class FieldChainFactory<TOutput extends GraphQLSilk = never, TInput exte
|
|
|
199
199
|
* @template TOutputNew - The new output type
|
|
200
200
|
* @param output - The output type definition
|
|
201
201
|
*/
|
|
202
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): FieldChainFactory<TOutputNew, TInput, TDependencies>;
|
|
202
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): FieldChainFactory<TOutputNew, TInput$1, TDependencies$1>;
|
|
203
203
|
/**
|
|
204
204
|
* Sets the input type for the field
|
|
205
205
|
* @template TInputNew - The new input type
|
|
206
206
|
* @param input - The input type definition
|
|
207
207
|
*/
|
|
208
|
-
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): FieldChainFactory<TOutput, TInputNew, TDependencies>;
|
|
208
|
+
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): FieldChainFactory<TOutput$1, TInputNew, TDependencies$1>;
|
|
209
209
|
/**
|
|
210
210
|
* Specifies the dependencies for the field
|
|
211
211
|
* @template TDependencies - The dependencies type
|
|
212
212
|
* @param dependencies - The dependencies to add
|
|
213
213
|
*/
|
|
214
|
-
derivedFrom<const TDependencies extends string[]>(...dependencies: TDependencies): FieldChainFactory<TOutput, TInput, TDependencies>;
|
|
214
|
+
derivedFrom<const TDependencies$1 extends string[]>(...dependencies: TDependencies$1): FieldChainFactory<TOutput$1, TInput$1, TDependencies$1>;
|
|
215
215
|
/**
|
|
216
216
|
* Sets the resolve function for the field
|
|
217
217
|
* @template TParent - The parent type
|
|
218
218
|
* @param resolve - The resolve function
|
|
219
219
|
*/
|
|
220
|
-
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>;
|
|
220
|
+
resolve<TParent$1 extends GraphQLSilk>(resolve: (parent: TDependencies$1 extends string[] ? RequireKeys<NonNullable<StandardSchemaV1.InferOutput<TParent$1>>, TDependencies$1[number]> : NonNullable<StandardSchemaV1.InferOutput<TParent$1>>, input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Field<TParent$1, TOutput$1, TInput$1, TDependencies$1>;
|
|
221
221
|
/**
|
|
222
222
|
* Creates a field resolver that uses DataLoader for batch loading data.
|
|
223
223
|
* This method is particularly useful for optimizing performance when dealing with multiple data requests
|
|
@@ -227,15 +227,15 @@ declare class FieldChainFactory<TOutput extends GraphQLSilk = never, TInput exte
|
|
|
227
227
|
* @param resolve - A function that handles batch loading of data.
|
|
228
228
|
* @returns A GraphQL field resolver that implements batch loading
|
|
229
229
|
*/
|
|
230
|
-
load<TParent extends GraphQLSilk>(resolve: (parents: InferParent<TParent, TDependencies>[], input: InferInputO<TInput>, payloads: (ResolverPayload | undefined)[]) => MayPromise<StandardSchemaV1.InferOutput<TOutput>[]>): Field<TParent, TOutput, TInput, TDependencies>;
|
|
230
|
+
load<TParent$1 extends GraphQLSilk>(resolve: (parents: InferParent<TParent$1, TDependencies$1>[], input: InferInputO<TInput$1>, payloads: (ResolverPayload | undefined)[]) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>[]>): Field<TParent$1, TOutput$1, TInput$1, TDependencies$1>;
|
|
231
231
|
}
|
|
232
|
-
type InferParent<TParent extends GraphQLSilk, TDependencies extends string[] | undefined = undefined> = TDependencies extends string[] ? RequireKeys<NonNullable<StandardSchemaV1.InferOutput<TParent>>, TDependencies[number]> : NonNullable<StandardSchemaV1.InferOutput<TParent>>;
|
|
232
|
+
type InferParent<TParent$1 extends GraphQLSilk, TDependencies$1 extends string[] | undefined = undefined> = TDependencies$1 extends string[] ? RequireKeys<NonNullable<StandardSchemaV1.InferOutput<TParent$1>>, TDependencies$1[number]> : NonNullable<StandardSchemaV1.InferOutput<TParent$1>>;
|
|
233
233
|
/**
|
|
234
234
|
* Factory for creating query resolvers with chainable configuration
|
|
235
235
|
* @template TOutput - The output type of the query
|
|
236
236
|
* @template TInput - The input type of the query
|
|
237
237
|
*/
|
|
238
|
-
declare class QueryChainFactory<TOutput extends GraphQLSilk = never, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseChainFactory<Query<TOutput, TInput>> implements IChainFactory<TOutput, TInput> {
|
|
238
|
+
declare class QueryChainFactory<TOutput$1 extends GraphQLSilk = never, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseChainFactory<Query<TOutput$1, TInput$1>> implements IChainFactory<TOutput$1, TInput$1> {
|
|
239
239
|
/**
|
|
240
240
|
* Returns the available methods for the query chain factory
|
|
241
241
|
* @returns An object containing all available methods
|
|
@@ -253,28 +253,28 @@ declare class QueryChainFactory<TOutput extends GraphQLSilk = never, TInput exte
|
|
|
253
253
|
* @param output - The output type definition
|
|
254
254
|
* @returns A new QueryChainFactory instance with the updated output type
|
|
255
255
|
*/
|
|
256
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): QueryChainFactory<TOutputNew, TInput>;
|
|
256
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): QueryChainFactory<TOutputNew, TInput$1>;
|
|
257
257
|
/**
|
|
258
258
|
* Sets the input type for the query
|
|
259
259
|
* @template TInputNew - The new input type
|
|
260
260
|
* @param input - The input type definition
|
|
261
261
|
* @returns A new QueryChainFactory instance with the updated input type
|
|
262
262
|
*/
|
|
263
|
-
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): QueryChainFactory<TOutput, TInputNew>;
|
|
263
|
+
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): QueryChainFactory<TOutput$1, TInputNew>;
|
|
264
264
|
/**
|
|
265
265
|
* Sets the resolve function for the query
|
|
266
266
|
* @param resolve - The resolve function that processes the input and returns the output
|
|
267
267
|
* @returns A GraphQL query resolver
|
|
268
268
|
* @throws {Error} If output type is not set
|
|
269
269
|
*/
|
|
270
|
-
resolve(resolve: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Query<TOutput, TInput>;
|
|
270
|
+
resolve(resolve: (input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Query<TOutput$1, TInput$1>;
|
|
271
271
|
}
|
|
272
272
|
/**
|
|
273
273
|
* Factory for creating mutation resolvers with chainable configuration
|
|
274
274
|
* @template TOutput - The output type of the mutation
|
|
275
275
|
* @template TInput - The input type of the mutation
|
|
276
276
|
*/
|
|
277
|
-
declare class MutationChainFactory<TOutput extends GraphQLSilk = never, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined> extends BaseChainFactory<Mutation<TOutput, TInput>> implements IChainFactory<TOutput, TInput> {
|
|
277
|
+
declare class MutationChainFactory<TOutput$1 extends GraphQLSilk = never, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined> extends BaseChainFactory<Mutation<TOutput$1, TInput$1>> implements IChainFactory<TOutput$1, TInput$1> {
|
|
278
278
|
/**
|
|
279
279
|
* Returns the available methods for the mutation chain factory
|
|
280
280
|
* @returns An object containing all available methods
|
|
@@ -292,28 +292,28 @@ declare class MutationChainFactory<TOutput extends GraphQLSilk = never, TInput e
|
|
|
292
292
|
* @param output - The output type definition
|
|
293
293
|
* @returns A new MutationChainFactory instance with the updated output type
|
|
294
294
|
*/
|
|
295
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): MutationChainFactory<TOutputNew, TInput>;
|
|
295
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): MutationChainFactory<TOutputNew, TInput$1>;
|
|
296
296
|
/**
|
|
297
297
|
* Sets the input type for the mutation
|
|
298
298
|
* @template TInputNew - The new input type
|
|
299
299
|
* @param input - The input type definition
|
|
300
300
|
* @returns A new MutationChainFactory instance with the updated input type
|
|
301
301
|
*/
|
|
302
|
-
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): MutationChainFactory<TOutput, TInputNew>;
|
|
302
|
+
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): MutationChainFactory<TOutput$1, TInputNew>;
|
|
303
303
|
/**
|
|
304
304
|
* Sets the resolve function for the mutation
|
|
305
305
|
* @param resolve - The resolve function that processes the input and returns the output
|
|
306
306
|
* @returns A GraphQL mutation resolver
|
|
307
307
|
* @throws {Error} If output type is not set
|
|
308
308
|
*/
|
|
309
|
-
resolve(resolve: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Mutation<TOutput, TInput>;
|
|
309
|
+
resolve(resolve: (input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Mutation<TOutput$1, TInput$1>;
|
|
310
310
|
}
|
|
311
311
|
/**
|
|
312
312
|
* Factory for creating subscription resolvers with chainable configuration
|
|
313
313
|
* @template TOutput - The output type of the subscription
|
|
314
314
|
* @template TInput - The input type of the subscription
|
|
315
315
|
*/
|
|
316
|
-
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> {
|
|
316
|
+
declare class SubscriptionChainFactory<TOutput$1 extends GraphQLSilk = never, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined> extends BaseChainFactory<Subscription<TOutput$1, TInput$1, any>> implements IChainFactory<TOutput$1, TInput$1> {
|
|
317
317
|
/**
|
|
318
318
|
* Returns the available methods for the subscription chain factory
|
|
319
319
|
* @returns An object containing all available methods
|
|
@@ -331,14 +331,14 @@ declare class SubscriptionChainFactory<TOutput extends GraphQLSilk = never, TInp
|
|
|
331
331
|
* @param output - The output type definition
|
|
332
332
|
* @returns A new SubscriptionChainFactory instance with the updated output type
|
|
333
333
|
*/
|
|
334
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): SubscriptionChainFactory<TOutputNew, TInput>;
|
|
334
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): SubscriptionChainFactory<TOutputNew, TInput$1>;
|
|
335
335
|
/**
|
|
336
336
|
* Sets the input type for the subscription
|
|
337
337
|
* @template TInputNew - The new input type
|
|
338
338
|
* @param input - The input type definition
|
|
339
339
|
* @returns A new SubscriptionChainFactory instance with the updated input type
|
|
340
340
|
*/
|
|
341
|
-
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): SubscriptionChainFactory<TOutput, TInputNew>;
|
|
341
|
+
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): SubscriptionChainFactory<TOutput$1, TInputNew>;
|
|
342
342
|
/**
|
|
343
343
|
* Sets the subscribe function for the subscription
|
|
344
344
|
* @template TValue - The value type of the subscription
|
|
@@ -346,7 +346,7 @@ declare class SubscriptionChainFactory<TOutput extends GraphQLSilk = never, TInp
|
|
|
346
346
|
* @returns A subscription resolver that can be further configured with a resolve function
|
|
347
347
|
* @throws {Error} If output type is not set
|
|
348
348
|
*/
|
|
349
|
-
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>;
|
|
349
|
+
subscribe<TValue = StandardSchemaV1.InferOutput<TOutput$1>>(subscribe: (input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<AsyncIterator<TValue>>): TValue extends StandardSchemaV1.InferOutput<TOutput$1> ? ResolvableSubscription<TOutput$1, TInput$1, TValue> : SubscriptionNeedResolve<TOutput$1, TInput$1, TValue>;
|
|
350
350
|
}
|
|
351
351
|
/**
|
|
352
352
|
* Interface for a subscription that can be resolved
|
|
@@ -354,12 +354,12 @@ declare class SubscriptionChainFactory<TOutput extends GraphQLSilk = never, TInp
|
|
|
354
354
|
* @template TInput - The input type of the subscription
|
|
355
355
|
* @template TValue - The value type of the subscription
|
|
356
356
|
*/
|
|
357
|
-
interface ResolvableSubscription<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput>> extends Subscription<TOutput, TInput, TValue> {
|
|
357
|
+
interface ResolvableSubscription<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput$1>> extends Subscription<TOutput$1, TInput$1, TValue> {
|
|
358
358
|
/**
|
|
359
359
|
* Sets the resolve function for the subscription
|
|
360
360
|
* @param resolve - The resolve function
|
|
361
361
|
*/
|
|
362
|
-
resolve(resolve: (value: TValue, input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Subscription<TOutput, TInput, TValue>;
|
|
362
|
+
resolve(resolve: (value: TValue, input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Subscription<TOutput$1, TInput$1, TValue>;
|
|
363
363
|
}
|
|
364
364
|
/**
|
|
365
365
|
* A subscription that can not be resolved yet, still needs to be resolved.
|
|
@@ -368,39 +368,39 @@ interface ResolvableSubscription<TOutput extends GraphQLSilk, TInput extends Gra
|
|
|
368
368
|
* @template TInput - The input type of the subscription
|
|
369
369
|
* @template TValue - The value type of the subscription
|
|
370
370
|
*/
|
|
371
|
-
interface SubscriptionNeedResolve<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput>> {
|
|
371
|
+
interface SubscriptionNeedResolve<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput$1>> {
|
|
372
372
|
/**
|
|
373
373
|
* Sets the resolve function for the subscription
|
|
374
374
|
* @param resolve - The resolve function
|
|
375
375
|
*/
|
|
376
|
-
resolve(resolve: (value: TValue, input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Subscription<TOutput, TInput, TValue>;
|
|
377
|
-
}
|
|
378
|
-
declare class QueryFactoryWithResolve<TInputO, TOutput extends GraphQLSilk, TInput extends GraphQLSilk<TInputO>> extends BaseChainFactory<Query<TOutput, TInput>> implements Query<TOutput, TInput> {
|
|
379
|
-
protected outputSilk: TOutput;
|
|
380
|
-
protected readonly options: QueryOptions<TOutput, TInput>;
|
|
381
|
-
get "~meta"(): Query<TOutput, TInput>["~meta"];
|
|
382
|
-
constructor(outputSilk: TOutput, options: QueryOptions<TOutput, TInput>);
|
|
383
|
-
protected clone(options?: Partial<QueryOptions<TOutput, TInput>> | undefined): this;
|
|
384
|
-
input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): QueryFactoryWithResolve<TInputO, TOutput, TInputNew>;
|
|
385
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): QueryFactoryWithResolve<TInputO, TOutputNew, TInput>;
|
|
386
|
-
}
|
|
387
|
-
declare class MutationFactoryWithResolve<TInputO, TOutput extends GraphQLSilk, TInput extends GraphQLSilk<TInputO>> extends BaseChainFactory<Query<TOutput, TInput>> implements Mutation<TOutput, TInput> {
|
|
388
|
-
protected outputSilk: TOutput;
|
|
389
|
-
protected readonly options: MutationOptions<TOutput, TInput>;
|
|
390
|
-
get "~meta"(): Mutation<TOutput, TInput>["~meta"];
|
|
391
|
-
constructor(outputSilk: TOutput, options: MutationOptions<TOutput, TInput>);
|
|
392
|
-
protected clone(options?: Partial<MutationOptions<TOutput, TInput>> | undefined): this;
|
|
393
|
-
input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): MutationFactoryWithResolve<TInputO, TOutput, TInputNew>;
|
|
394
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): MutationFactoryWithResolve<TInputO, TOutputNew, TInput>;
|
|
395
|
-
}
|
|
396
|
-
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>> {
|
|
397
|
-
protected outputSilk: TOutput;
|
|
398
|
-
protected readonly options: FieldOptions<TParent, TOutput, TInput, string[] | undefined>;
|
|
399
|
-
get "~meta"(): Field<TParent, TOutput, TInput, string[] | undefined>["~meta"];
|
|
400
|
-
constructor(outputSilk: TOutput, options: FieldOptions<TParent, TOutput, TInput, string[] | undefined>);
|
|
401
|
-
protected clone(options?: Partial<FieldOptions<TParent, TOutput, TInput, string[] | undefined>> | undefined): this;
|
|
402
|
-
input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): FieldFactoryWithResolve<TParent, TOutput, TInputO, TInputNew>;
|
|
403
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): FieldFactoryWithResolve<TParent, TOutputNew, TInputO, TInput>;
|
|
376
|
+
resolve(resolve: (value: TValue, input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Subscription<TOutput$1, TInput$1, TValue>;
|
|
377
|
+
}
|
|
378
|
+
declare class QueryFactoryWithResolve<TInputO, TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk<TInputO>> extends BaseChainFactory<Query<TOutput$1, TInput$1>> implements Query<TOutput$1, TInput$1> {
|
|
379
|
+
protected outputSilk: TOutput$1;
|
|
380
|
+
protected readonly options: QueryOptions<TOutput$1, TInput$1>;
|
|
381
|
+
get "~meta"(): Query<TOutput$1, TInput$1>["~meta"];
|
|
382
|
+
constructor(outputSilk: TOutput$1, options: QueryOptions<TOutput$1, TInput$1>);
|
|
383
|
+
protected clone(options?: Partial<QueryOptions<TOutput$1, TInput$1>> | undefined): this;
|
|
384
|
+
input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): QueryFactoryWithResolve<TInputO, TOutput$1, TInputNew>;
|
|
385
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput$1>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): QueryFactoryWithResolve<TInputO, TOutputNew, TInput$1>;
|
|
386
|
+
}
|
|
387
|
+
declare class MutationFactoryWithResolve<TInputO, TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk<TInputO>> extends BaseChainFactory<Query<TOutput$1, TInput$1>> implements Mutation<TOutput$1, TInput$1> {
|
|
388
|
+
protected outputSilk: TOutput$1;
|
|
389
|
+
protected readonly options: MutationOptions<TOutput$1, TInput$1>;
|
|
390
|
+
get "~meta"(): Mutation<TOutput$1, TInput$1>["~meta"];
|
|
391
|
+
constructor(outputSilk: TOutput$1, options: MutationOptions<TOutput$1, TInput$1>);
|
|
392
|
+
protected clone(options?: Partial<MutationOptions<TOutput$1, TInput$1>> | undefined): this;
|
|
393
|
+
input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): MutationFactoryWithResolve<TInputO, TOutput$1, TInputNew>;
|
|
394
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput$1>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): MutationFactoryWithResolve<TInputO, TOutputNew, TInput$1>;
|
|
395
|
+
}
|
|
396
|
+
declare class FieldFactoryWithResolve<TParent$1 extends GraphQLSilk, TOutput$1 extends GraphQLSilk, TInputO = never, TInput$1 extends GraphQLSilk<TInputO> | void = void> extends BaseChainFactory<Field<TParent$1, TOutput$1, TInput$1, string[] | undefined>> {
|
|
397
|
+
protected outputSilk: TOutput$1;
|
|
398
|
+
protected readonly options: FieldOptions<TParent$1, TOutput$1, TInput$1, string[] | undefined>;
|
|
399
|
+
get "~meta"(): Field<TParent$1, TOutput$1, TInput$1, string[] | undefined>["~meta"];
|
|
400
|
+
constructor(outputSilk: TOutput$1, options: FieldOptions<TParent$1, TOutput$1, TInput$1, string[] | undefined>);
|
|
401
|
+
protected clone(options?: Partial<FieldOptions<TParent$1, TOutput$1, TInput$1, string[] | undefined>> | undefined): this;
|
|
402
|
+
input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): FieldFactoryWithResolve<TParent$1, TOutput$1, TInputO, TInputNew>;
|
|
403
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput$1>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): FieldFactoryWithResolve<TParent$1, TOutputNew, TInputO, TInput$1>;
|
|
404
404
|
}
|
|
405
405
|
declare namespace types_loom_d_exports {
|
|
406
406
|
export { BaseField, Field, FieldMeta, FieldOrOperation, Mutation, Operation, Query, Resolver, Subscription };
|
|
@@ -416,51 +416,51 @@ interface FieldMeta extends GraphQLFieldOptions {
|
|
|
416
416
|
interface BaseField {
|
|
417
417
|
readonly "~meta": FieldMeta;
|
|
418
418
|
}
|
|
419
|
-
interface Field<TParent extends GraphQLSilk, TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void, TDependencies extends string[] | undefined = undefined> extends BaseField {
|
|
419
|
+
interface Field<TParent$1 extends GraphQLSilk, TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void, TDependencies$1 extends string[] | undefined = undefined> extends BaseField {
|
|
420
420
|
"~meta": {
|
|
421
421
|
operation: "field";
|
|
422
|
-
output: TOutput;
|
|
423
|
-
input: TInput;
|
|
422
|
+
output: TOutput$1;
|
|
423
|
+
input: TInput$1;
|
|
424
424
|
middlewares?: Middleware[];
|
|
425
|
-
dependencies?: TDependencies;
|
|
425
|
+
dependencies?: TDependencies$1;
|
|
426
426
|
types?: {
|
|
427
|
-
parent: ReSilk<TParent>;
|
|
427
|
+
parent: ReSilk<TParent$1>;
|
|
428
428
|
};
|
|
429
|
-
resolve: (parent: StandardSchemaV1.InferOutput<NonNullable<TParent>>, input: InferInputO<TInput>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
429
|
+
resolve: (parent: StandardSchemaV1.InferOutput<NonNullable<TParent$1>>, input: InferInputO<TInput$1>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
430
430
|
} & GraphQLFieldOptions;
|
|
431
431
|
}
|
|
432
|
-
interface Query<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseField {
|
|
432
|
+
interface Query<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseField {
|
|
433
433
|
"~meta": {
|
|
434
434
|
operation: "query";
|
|
435
435
|
parent?: undefined;
|
|
436
|
-
output: TOutput;
|
|
437
|
-
input: TInput;
|
|
436
|
+
output: TOutput$1;
|
|
437
|
+
input: TInput$1;
|
|
438
438
|
middlewares?: Middleware[];
|
|
439
|
-
resolve: (input: InferInputO<TInput>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
439
|
+
resolve: (input: InferInputO<TInput$1>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
440
440
|
} & GraphQLFieldOptions;
|
|
441
441
|
}
|
|
442
|
-
interface Mutation<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseField {
|
|
442
|
+
interface Mutation<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseField {
|
|
443
443
|
"~meta": {
|
|
444
444
|
operation: "mutation";
|
|
445
445
|
parent?: undefined;
|
|
446
|
-
output: TOutput;
|
|
447
|
-
input: TInput;
|
|
446
|
+
output: TOutput$1;
|
|
447
|
+
input: TInput$1;
|
|
448
448
|
middlewares?: Middleware[];
|
|
449
|
-
resolve: (input: InferInputO<TInput>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
449
|
+
resolve: (input: InferInputO<TInput$1>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
450
450
|
} & GraphQLFieldOptions;
|
|
451
451
|
}
|
|
452
|
-
interface Subscription<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void, TValue = StandardSchemaV1.InferOutput<TOutput>> extends BaseField {
|
|
452
|
+
interface Subscription<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void, TValue = StandardSchemaV1.InferOutput<TOutput$1>> extends BaseField {
|
|
453
453
|
"~meta": {
|
|
454
454
|
operation: "subscription";
|
|
455
455
|
parent?: undefined;
|
|
456
|
-
output: TOutput;
|
|
457
|
-
input: TInput;
|
|
456
|
+
output: TOutput$1;
|
|
457
|
+
input: TInput$1;
|
|
458
458
|
middlewares?: Middleware[];
|
|
459
459
|
types?: {
|
|
460
460
|
value: TValue;
|
|
461
461
|
} & GraphQLFieldOptions;
|
|
462
|
-
resolve: (value: TValue, input: InferInputO<TInput>, payload: ResolverPayload | void) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
463
|
-
subscribe: (input: InferInputO<TInput>, payload: ResolverPayload | void) => MayPromise<AsyncIterator<TValue>>;
|
|
462
|
+
resolve: (value: TValue, input: InferInputO<TInput$1>, payload: ResolverPayload | void) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
463
|
+
subscribe: (input: InferInputO<TInput$1>, payload: ResolverPayload | void) => MayPromise<AsyncIterator<TValue>>;
|
|
464
464
|
} & GraphQLFieldOptions;
|
|
465
465
|
}
|
|
466
466
|
interface Resolver {
|
|
@@ -473,10 +473,10 @@ interface Resolver {
|
|
|
473
473
|
}
|
|
474
474
|
type Operation = Query<GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void> | Mutation<GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void> | Subscription<GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void, any>;
|
|
475
475
|
type FieldOrOperation = Field<GraphQLSilk, GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void, string[] | undefined> | Operation;
|
|
476
|
-
type ReSilk<T extends GraphQLSilk> = GraphQLSilk<NonNullable<T["~standard"]["types"]>["output"], NonNullable<T["~standard"]["types"]>["input"]>;
|
|
476
|
+
type ReSilk<T$1 extends GraphQLSilk> = GraphQLSilk<NonNullable<T$1["~standard"]["types"]>["output"], NonNullable<T$1["~standard"]["types"]>["input"]>;
|
|
477
477
|
//#endregion
|
|
478
478
|
//#region src/resolver/types.d.ts
|
|
479
|
-
interface GraphQLSilk<TOutput = any, TInput = any> extends StandardSchemaV1<TInput, TOutput> {
|
|
479
|
+
interface GraphQLSilk<TOutput$1 = any, TInput$1 = any> extends StandardSchemaV1<TInput$1, TOutput$1> {
|
|
480
480
|
/**
|
|
481
481
|
* GraphQL type for schema
|
|
482
482
|
*/
|
|
@@ -504,33 +504,33 @@ type InferFieldOutput<TField extends BaseField> = TField["~meta"]["output"];
|
|
|
504
504
|
/**
|
|
505
505
|
* Options for creating a GraphQL Query.
|
|
506
506
|
*/
|
|
507
|
-
interface QueryOptions<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends ResolverOptions<Query<TOutput, TInput>>, GraphQLFieldOptions {
|
|
508
|
-
input?: TInput;
|
|
509
|
-
resolve: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
507
|
+
interface QueryOptions<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends ResolverOptions<Query<TOutput$1, TInput$1>>, GraphQLFieldOptions {
|
|
508
|
+
input?: TInput$1;
|
|
509
|
+
resolve: (input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
510
510
|
}
|
|
511
511
|
/**
|
|
512
512
|
* Options for creating a GraphQL Mutation.
|
|
513
513
|
*/
|
|
514
|
-
interface MutationOptions<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined> extends ResolverOptions<Mutation<TOutput, TInput>>, GraphQLFieldOptions {
|
|
515
|
-
input?: TInput;
|
|
516
|
-
resolve: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
514
|
+
interface MutationOptions<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined> extends ResolverOptions<Mutation<TOutput$1, TInput$1>>, GraphQLFieldOptions {
|
|
515
|
+
input?: TInput$1;
|
|
516
|
+
resolve: (input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
517
517
|
}
|
|
518
518
|
/**
|
|
519
519
|
* Function to create a GraphQL query.
|
|
520
520
|
*/
|
|
521
521
|
interface QueryFactory {
|
|
522
|
-
<TOutput extends GraphQLSilk>(output: TOutput, resolve: (input: void, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Query<TOutput, void>;
|
|
523
|
-
<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void>(output: TOutput, options: QueryOptions<TOutput, TInput>): Query<TOutput, TInput>;
|
|
524
|
-
<TOutput extends GraphQLSilk>(output: TOutput): QueryChainFactory<TOutput, void>;
|
|
522
|
+
<TOutput$1 extends GraphQLSilk>(output: TOutput$1, resolve: (input: void, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Query<TOutput$1, void>;
|
|
523
|
+
<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void>(output: TOutput$1, options: QueryOptions<TOutput$1, TInput$1>): Query<TOutput$1, TInput$1>;
|
|
524
|
+
<TOutput$1 extends GraphQLSilk>(output: TOutput$1): QueryChainFactory<TOutput$1, void>;
|
|
525
525
|
}
|
|
526
526
|
interface QueryFactoryWithChain extends QueryFactory, QueryChainFactory<never, void> {}
|
|
527
527
|
/**
|
|
528
528
|
* Function to create a GraphQL mutation.
|
|
529
529
|
*/
|
|
530
530
|
interface MutationFactory {
|
|
531
|
-
<TOutput extends GraphQLSilk>(output: TOutput, resolve: (input: void, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Mutation<TOutput, undefined>;
|
|
532
|
-
<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined>(output: TOutput, options: MutationOptions<TOutput, TInput>): Mutation<TOutput, TInput>;
|
|
533
|
-
<TOutput extends GraphQLSilk>(output: TOutput): MutationChainFactory<TOutput, undefined>;
|
|
531
|
+
<TOutput$1 extends GraphQLSilk>(output: TOutput$1, resolve: (input: void, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Mutation<TOutput$1, undefined>;
|
|
532
|
+
<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined>(output: TOutput$1, options: MutationOptions<TOutput$1, TInput$1>): Mutation<TOutput$1, TInput$1>;
|
|
533
|
+
<TOutput$1 extends GraphQLSilk>(output: TOutput$1): MutationChainFactory<TOutput$1, undefined>;
|
|
534
534
|
}
|
|
535
535
|
/**
|
|
536
536
|
* Function to create a GraphQL mutation.
|
|
@@ -539,28 +539,28 @@ interface MutationFactoryWithChain extends MutationFactory, MutationChainFactory
|
|
|
539
539
|
/**
|
|
540
540
|
* Options for External Filed of existing GraphQL Object.
|
|
541
541
|
*/
|
|
542
|
-
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 {
|
|
543
|
-
input?: TInput;
|
|
544
|
-
dependencies?: TDependencies;
|
|
545
|
-
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>>;
|
|
542
|
+
interface FieldOptions<TParent$1 extends GraphQLSilk, TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void, TDependencies$1 extends string[] | undefined = undefined> extends ResolverOptions<Field<TParent$1, TOutput$1, TInput$1, TDependencies$1>>, GraphQLFieldOptions {
|
|
543
|
+
input?: TInput$1;
|
|
544
|
+
dependencies?: TDependencies$1;
|
|
545
|
+
resolve: (parent: TDependencies$1 extends string[] ? RequireKeys<NonNullable<StandardSchemaV1.InferOutput<TParent$1>>, TDependencies$1[number]> : NonNullable<StandardSchemaV1.InferOutput<TParent$1>>, input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
546
546
|
}
|
|
547
547
|
/**
|
|
548
548
|
* Function to create a GraphQL Field.
|
|
549
549
|
*/
|
|
550
550
|
interface FieldFactory {
|
|
551
|
-
<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>;
|
|
552
|
-
<TParent extends GraphQLSilk, TOutput extends GraphQLSilk>(output: TOutput, options: FieldOptions<TParent, TOutput, undefined, undefined>): Field<TParent, TOutput, undefined, undefined>;
|
|
553
|
-
<TParent extends GraphQLSilk, TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined>(output: TOutput, options: FieldOptions<TParent, TOutput, TInput, undefined> & {
|
|
554
|
-
input: TInput;
|
|
555
|
-
}): Field<TParent, TOutput, TInput, undefined>;
|
|
556
|
-
<TParent extends GraphQLSilk, TOutput extends GraphQLSilk, const TDependencies extends string[] | undefined>(output: TOutput, options: FieldOptions<TParent, TOutput, undefined, TDependencies> & {
|
|
557
|
-
dependencies: TDependencies;
|
|
558
|
-
}): Field<TParent, TOutput, undefined, TDependencies>;
|
|
559
|
-
<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> & {
|
|
560
|
-
input: TInput;
|
|
561
|
-
dependencies: TDependencies;
|
|
562
|
-
}): Field<TParent, TOutput, TInput, TDependencies>;
|
|
563
|
-
<TOutput extends GraphQLSilk>(output: TOutput): FieldChainFactory<TOutput, undefined, undefined>;
|
|
551
|
+
<TParent$1 extends GraphQLSilk, TOutput$1 extends GraphQLSilk>(output: TOutput$1, resolve: (parent: StandardSchemaV1.InferOutput<TParent$1>, input: void, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Field<TParent$1, TOutput$1, undefined, undefined>;
|
|
552
|
+
<TParent$1 extends GraphQLSilk, TOutput$1 extends GraphQLSilk>(output: TOutput$1, options: FieldOptions<TParent$1, TOutput$1, undefined, undefined>): Field<TParent$1, TOutput$1, undefined, undefined>;
|
|
553
|
+
<TParent$1 extends GraphQLSilk, TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | undefined>(output: TOutput$1, options: FieldOptions<TParent$1, TOutput$1, TInput$1, undefined> & {
|
|
554
|
+
input: TInput$1;
|
|
555
|
+
}): Field<TParent$1, TOutput$1, TInput$1, undefined>;
|
|
556
|
+
<TParent$1 extends GraphQLSilk, TOutput$1 extends GraphQLSilk, const TDependencies$1 extends string[] | undefined>(output: TOutput$1, options: FieldOptions<TParent$1, TOutput$1, undefined, TDependencies$1> & {
|
|
557
|
+
dependencies: TDependencies$1;
|
|
558
|
+
}): Field<TParent$1, TOutput$1, undefined, TDependencies$1>;
|
|
559
|
+
<TParent$1 extends GraphQLSilk, TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | undefined, TDependencies$1 extends string[] | undefined>(output: TOutput$1, options: FieldOptions<TParent$1, TOutput$1, TInput$1, TDependencies$1> & {
|
|
560
|
+
input: TInput$1;
|
|
561
|
+
dependencies: TDependencies$1;
|
|
562
|
+
}): Field<TParent$1, TOutput$1, TInput$1, TDependencies$1>;
|
|
563
|
+
<TOutput$1 extends GraphQLSilk>(output: TOutput$1): FieldChainFactory<TOutput$1, undefined, undefined>;
|
|
564
564
|
}
|
|
565
565
|
interface FieldFactoryWithUtils extends FieldFactory, FieldChainFactory<never, undefined, undefined> {
|
|
566
566
|
/** Set fields to be hidden in GraphQL Schema */
|
|
@@ -569,18 +569,18 @@ interface FieldFactoryWithUtils extends FieldFactory, FieldChainFactory<never, u
|
|
|
569
569
|
/**
|
|
570
570
|
* Options for creating a GraphQL Subscription.
|
|
571
571
|
*/
|
|
572
|
-
interface SubscriptionOptions<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput>> extends ResolverOptions<Subscription<TOutput, TInput, TValue>>, GraphQLFieldOptions {
|
|
573
|
-
input?: TInput;
|
|
574
|
-
subscribe: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<AsyncIterator<TValue>>;
|
|
575
|
-
resolve?: (value: TValue, input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
572
|
+
interface SubscriptionOptions<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput$1>> extends ResolverOptions<Subscription<TOutput$1, TInput$1, TValue>>, GraphQLFieldOptions {
|
|
573
|
+
input?: TInput$1;
|
|
574
|
+
subscribe: (input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<AsyncIterator<TValue>>;
|
|
575
|
+
resolve?: (value: TValue, input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
576
576
|
}
|
|
577
577
|
/**
|
|
578
578
|
* Function to create a GraphQL subscription.
|
|
579
579
|
*/
|
|
580
580
|
interface SubscriptionFactory {
|
|
581
|
-
<TOutput extends GraphQLSilk, TValue = StandardSchemaV1.InferOutput<TOutput>>(output: TOutput, subscribe: (payload: ResolverPayload | undefined) => MayPromise<AsyncIterator<StandardSchemaV1.InferOutput<TOutput>>>): Subscription<TOutput, undefined, TValue>;
|
|
582
|
-
<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>;
|
|
583
|
-
<TOutput extends GraphQLSilk>(output: TOutput): SubscriptionChainFactory<TOutput, undefined>;
|
|
581
|
+
<TOutput$1 extends GraphQLSilk, TValue = StandardSchemaV1.InferOutput<TOutput$1>>(output: TOutput$1, subscribe: (payload: ResolverPayload | undefined) => MayPromise<AsyncIterator<StandardSchemaV1.InferOutput<TOutput$1>>>): Subscription<TOutput$1, undefined, TValue>;
|
|
582
|
+
<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput$1>>(output: TOutput$1, options: SubscriptionOptions<TOutput$1, TInput$1, TValue>): Subscription<TOutput$1, TInput$1, TValue>;
|
|
583
|
+
<TOutput$1 extends GraphQLSilk>(output: TOutput$1): SubscriptionChainFactory<TOutput$1, undefined>;
|
|
584
584
|
}
|
|
585
585
|
interface SubscriptionFactoryWithChain extends SubscriptionFactory, SubscriptionChainFactory<never, undefined> {}
|
|
586
586
|
/**
|
|
@@ -644,7 +644,7 @@ declare function assignContextMap(target: ContextMemoryContainer): WeakMap<WeakK
|
|
|
644
644
|
//#endregion
|
|
645
645
|
//#region src/utils/error.d.ts
|
|
646
646
|
declare function markErrorLocation<TError>(error: TError, ...locations: string[]): TError;
|
|
647
|
-
declare function tryIn<T>(func: () => T, ...locations: string[]): T;
|
|
647
|
+
declare function tryIn<T$1>(func: () => T$1, ...locations: string[]): T$1;
|
|
648
648
|
/**
|
|
649
649
|
* mark message with location
|
|
650
650
|
* @param message origin message
|
|
@@ -689,12 +689,12 @@ declare class EasyDataLoader<TKey, TData> extends LoomDataLoader<TKey, TData> {
|
|
|
689
689
|
}
|
|
690
690
|
//#endregion
|
|
691
691
|
//#region src/utils/types.d.ts
|
|
692
|
-
type MayPromise<T> = T | Promise<T>;
|
|
693
|
-
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
694
|
-
type ValueOf<T extends object> = T[keyof T];
|
|
692
|
+
type MayPromise<T$1> = T$1 | Promise<T$1>;
|
|
693
|
+
type IsAny<T$1> = 0 extends 1 & T$1 ? true : false;
|
|
694
|
+
type ValueOf<T$1 extends object> = T$1[keyof T$1];
|
|
695
695
|
type OmitInUnion<TUnion, TOmit> = TUnion extends infer T ? T extends TOmit ? never : T : never;
|
|
696
|
-
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] };
|
|
697
|
-
type MayGetter<T> = T | (() => T);
|
|
696
|
+
type RequireKeys<T$1, TKey extends string | number | symbol> = { [P in keyof T$1 as P extends TKey ? P : never]-?: T$1[P] } & { [P in keyof T$1 as P extends TKey ? never : P]: T$1[P] };
|
|
697
|
+
type MayGetter<T$1> = T$1 | (() => T$1);
|
|
698
698
|
//#endregion
|
|
699
699
|
//#region src/utils/middleware.d.ts
|
|
700
700
|
/**
|
|
@@ -741,13 +741,13 @@ declare function filterMiddlewares(operation: MiddlewareOperation, ...middleware
|
|
|
741
741
|
* Creates an object map with the same keys as `map` and values generated by
|
|
742
742
|
* running each value of `record` thru `fn`.
|
|
743
743
|
*/
|
|
744
|
-
declare function mapValue<T, V>(record: Record<string, T>, fn: (value: T, key: string) => V | typeof mapValue.SKIP): Record<string, V>;
|
|
744
|
+
declare function mapValue<T$1, V>(record: Record<string, T$1>, fn: (value: T$1, key: string) => V | typeof mapValue.SKIP): Record<string, V>;
|
|
745
745
|
declare namespace mapValue {
|
|
746
746
|
var SKIP: unique symbol;
|
|
747
747
|
}
|
|
748
|
-
declare function toObjMap<T>(obj: Maybe<ReadOnlyObjMapLike<T>>): ReadOnlyObjMap<T>;
|
|
749
|
-
declare function notNullish<T>(x: T | undefined | null): x is T;
|
|
750
|
-
declare function deepMerge<T extends Record<string, any>>(...objects: (T | null | undefined)[]): T;
|
|
748
|
+
declare function toObjMap<T$1>(obj: Maybe<ReadOnlyObjMapLike<T$1>>): ReadOnlyObjMap<T$1>;
|
|
749
|
+
declare function notNullish<T$1>(x: T$1 | undefined | null): x is T$1;
|
|
750
|
+
declare function deepMerge<T$1 extends Record<string, any>>(...objects: (T$1 | null | undefined)[]): T$1;
|
|
751
751
|
/**
|
|
752
752
|
* Wraps the provided data in an object with a single key `"~meta"`.
|
|
753
753
|
*
|
|
@@ -759,15 +759,15 @@ declare function deepMerge<T extends Record<string, any>>(...objects: (T | null
|
|
|
759
759
|
* const metaData = meta(originalData);
|
|
760
760
|
* console.log(metaData); // Output: { "~meta": { key: "value" } }
|
|
761
761
|
*/
|
|
762
|
-
declare function meta<T>(data: T): {
|
|
763
|
-
"~meta": T;
|
|
762
|
+
declare function meta<T$1>(data: T$1): {
|
|
763
|
+
"~meta": T$1;
|
|
764
764
|
};
|
|
765
|
-
type Maybe<T> = null | undefined | T;
|
|
766
|
-
type ReadOnlyObjMapLike<T> = ReadOnlyObjMap<T> | {
|
|
767
|
-
readonly [key: string]: T;
|
|
765
|
+
type Maybe<T$1> = null | undefined | T$1;
|
|
766
|
+
type ReadOnlyObjMapLike<T$1> = ReadOnlyObjMap<T$1> | {
|
|
767
|
+
readonly [key: string]: T$1;
|
|
768
768
|
};
|
|
769
|
-
interface ReadOnlyObjMap<T> {
|
|
770
|
-
readonly [key: string]: T;
|
|
769
|
+
interface ReadOnlyObjMap<T$1> {
|
|
770
|
+
readonly [key: string]: T$1;
|
|
771
771
|
}
|
|
772
772
|
//#endregion
|
|
773
773
|
//#region src/utils/parse-resolving-fields.d.ts
|
|
@@ -792,40 +792,53 @@ interface ResolvingFields {
|
|
|
792
792
|
*/
|
|
793
793
|
selectedFields: ReadonlySet<string>;
|
|
794
794
|
}
|
|
795
|
+
interface ResolvingFieldsOptions {
|
|
796
|
+
/**
|
|
797
|
+
* Whether to include GraphQL introspection/meta fields (names starting with "__").
|
|
798
|
+
* Default: false (filtered out).
|
|
799
|
+
*/
|
|
800
|
+
includeIntrospection?: boolean;
|
|
801
|
+
/**
|
|
802
|
+
* Maximum depth of nested fields to parse.
|
|
803
|
+
* Default: Infinity for deep helpers; default is handled per caller.
|
|
804
|
+
*/
|
|
805
|
+
maxDepth?: number;
|
|
806
|
+
}
|
|
795
807
|
/**
|
|
796
808
|
* Analyzes and processes field resolution in a GraphQL query deeply.
|
|
797
809
|
*
|
|
798
810
|
* @param payload - The resolver payload containing the current field resolution context
|
|
799
|
-
* @param
|
|
811
|
+
* @param options - Additional parsing options (e.g., includeIntrospection, maxDepth; default maxDepth = Infinity)
|
|
800
812
|
* @returns A map of field paths to their resolving fields
|
|
801
813
|
*/
|
|
802
|
-
declare function getDeepResolvingFields(payload: Pick<ResolverPayload, "info">,
|
|
814
|
+
declare function getDeepResolvingFields(payload: Pick<ResolverPayload, "info">, options?: ResolvingFieldsOptions): Map<string, ResolvingFields>;
|
|
803
815
|
/**
|
|
804
816
|
* Analyzes and processes field resolution in a GraphQL query.
|
|
805
817
|
*
|
|
806
818
|
* @param payload - The resolver payload containing the current field resolution context
|
|
819
|
+
* @param options - Additional parsing options (e.g., includeIntrospection; fixed maxDepth = 1)
|
|
807
820
|
* @returns An object containing sets of different field types
|
|
808
821
|
*/
|
|
809
|
-
declare function getResolvingFields(payload: Pick<ResolverPayload, "info">): ResolvingFields;
|
|
822
|
+
declare function getResolvingFields(payload: Pick<ResolverPayload, "info">, options?: Omit<ResolvingFieldsOptions, "maxDepth">): ResolvingFields;
|
|
810
823
|
/**
|
|
811
824
|
* Parses the GraphQL resolve info to extract all requested fields.
|
|
812
825
|
* Returns a Set of field paths where nested fields are represented as 'parent.field'.
|
|
813
826
|
* Supports @include, @skip directives, fragments, and variables.
|
|
814
827
|
*
|
|
815
828
|
* @param info - The GraphQL resolve info object containing the query information
|
|
816
|
-
* @param
|
|
829
|
+
* @param options - Additional parsing options (e.g., includeIntrospection, maxDepth; default maxDepth = 1)
|
|
817
830
|
* @returns A Set of field paths
|
|
818
831
|
*/
|
|
819
|
-
declare function parseResolvingFields(info: GraphQLResolveInfo,
|
|
832
|
+
declare function parseResolvingFields(info: GraphQLResolveInfo, options?: ResolvingFieldsOptions): Set<string>;
|
|
820
833
|
//#endregion
|
|
821
834
|
//#region src/utils/string.d.ts
|
|
822
835
|
declare function pascalCase(str: string): string;
|
|
823
|
-
declare function capitalize<T extends string>(str: T): Capitalize<T>;
|
|
836
|
+
declare function capitalize<T$1 extends string>(str: T$1): Capitalize<T$1>;
|
|
824
837
|
declare function screamingSnakeCase(str: string): string;
|
|
825
838
|
//#endregion
|
|
826
839
|
//#region src/resolver/input.d.ts
|
|
827
|
-
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;
|
|
828
|
-
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;
|
|
840
|
+
type InferInputI<TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void> = TInput$1 extends void ? void : TInput$1 extends GraphQLSilk ? StandardSchemaV1.InferInput<TInput$1> : TInput$1 extends Record<string, GraphQLSilk> ? { [K in keyof TInput$1]: StandardSchemaV1.InferInput<TInput$1[K]> } : void;
|
|
841
|
+
type InferInputO<TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void> = TInput$1 extends void ? void : TInput$1 extends GraphQLSilk ? StandardSchemaV1.InferOutput<TInput$1> : TInput$1 extends Record<string, GraphQLSilk> ? { [K in keyof TInput$1]: StandardSchemaV1.InferOutput<TInput$1[K]> } : never;
|
|
829
842
|
interface CallableInputParser<TSchema extends GraphQLSilk | Record<string, GraphQLSilk> | void> {
|
|
830
843
|
/**
|
|
831
844
|
* input schema
|
|
@@ -858,9 +871,9 @@ interface CallableInputParser<TSchema extends GraphQLSilk | Record<string, Graph
|
|
|
858
871
|
}
|
|
859
872
|
declare function createInputParser<TSchema extends GraphQLSilk | Record<string, GraphQLSilk> | void>(schema: TSchema, value: InferInputI<TSchema>): CallableInputParser<TSchema>;
|
|
860
873
|
declare function parseInputValue<TSchema extends GraphQLSilk | Record<string, GraphQLSilk> | void>(inputSchema: TSchema, input: any): MayPromise<StandardSchemaV1.Result<InferInputO<TSchema>>>;
|
|
861
|
-
declare function getStandardValue<T>(result: StandardSchemaV1.Result<T>): T;
|
|
862
|
-
declare function getStandardValue<T>(result?: StandardSchemaV1.Result<T>): T | undefined;
|
|
863
|
-
declare function getStandardValue<T>(result: StandardSchemaV1.Result<T> | null): T | null;
|
|
874
|
+
declare function getStandardValue<T$1>(result: StandardSchemaV1.Result<T$1>): T$1;
|
|
875
|
+
declare function getStandardValue<T$1>(result?: StandardSchemaV1.Result<T$1>): T$1 | undefined;
|
|
876
|
+
declare function getStandardValue<T$1>(result: StandardSchemaV1.Result<T$1> | null): T$1 | null;
|
|
864
877
|
//#endregion
|
|
865
878
|
//#region src/resolver/resolver.d.ts
|
|
866
879
|
/**
|
|
@@ -869,7 +882,7 @@ declare function getStandardValue<T>(result: StandardSchemaV1.Result<T> | null):
|
|
|
869
882
|
* @param resolveOrOptions - Either a resolve function or options object
|
|
870
883
|
* @returns A GraphQL query resolver
|
|
871
884
|
*/
|
|
872
|
-
declare const createQuery: (output: GraphQLSilk<any, any>, resolveOrOptions?: ((...args: any) => MayPromise<unknown>) | QueryOptions<any, any>) =>
|
|
885
|
+
declare const createQuery: (output: GraphQLSilk<any, any>, resolveOrOptions?: ((...args: any) => MayPromise<unknown>) | QueryOptions<any, any>) => Query<any, any> | QueryChainFactory<never, void>;
|
|
873
886
|
/**
|
|
874
887
|
* Factory function for creating GraphQL queries with chainable configuration
|
|
875
888
|
*/
|
|
@@ -880,7 +893,7 @@ declare const query$1: QueryFactoryWithChain;
|
|
|
880
893
|
* @param resolveOrOptions - Either a resolve function or options object
|
|
881
894
|
* @returns A GraphQL mutation resolver
|
|
882
895
|
*/
|
|
883
|
-
declare const createMutation: (output: GraphQLSilk<any, any>, resolveOrOptions?: (() => MayPromise<unknown>) | MutationOptions<any, any>) =>
|
|
896
|
+
declare const createMutation: (output: GraphQLSilk<any, any>, resolveOrOptions?: (() => MayPromise<unknown>) | MutationOptions<any, any>) => Mutation<any, any> | MutationChainFactory<never, undefined>;
|
|
884
897
|
/**
|
|
885
898
|
* Factory function for creating GraphQL mutations with chainable configuration
|
|
886
899
|
*/
|
|
@@ -891,7 +904,7 @@ declare const mutation$1: MutationFactoryWithChain;
|
|
|
891
904
|
* @param resolveOrOptions - Either a resolve function or options object
|
|
892
905
|
* @returns A GraphQL field resolver
|
|
893
906
|
*/
|
|
894
|
-
declare const createField: (output: GraphQLSilk<any, any>, resolveOrOptions?: (() => unknown) | FieldOptions<GraphQLSilk, GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void, string[] | undefined>) =>
|
|
907
|
+
declare const createField: (output: GraphQLSilk<any, any>, resolveOrOptions?: (() => unknown) | FieldOptions<GraphQLSilk, GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void, string[] | undefined>) => Field<any, any, any, any> | FieldChainFactory<never, undefined, undefined>;
|
|
895
908
|
/**
|
|
896
909
|
* Factory function for creating GraphQL fields with chainable configuration
|
|
897
910
|
*/
|
|
@@ -948,7 +961,7 @@ interface ResolverFactory {
|
|
|
948
961
|
* @param fields - The fields to resolve
|
|
949
962
|
* @param options - Optional resolver options
|
|
950
963
|
*/
|
|
951
|
-
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>;
|
|
964
|
+
of<TParent$1 extends GraphQLSilk, TFields extends Record<string, Field<TParent$1, any, any, any> | Operation | typeof FIELD_HIDDEN>>(parent: TParent$1, fields: TFields, options?: ResolverOptionsWithExtensions<OmitInUnion<ValueOf<TFields>, typeof FIELD_HIDDEN>>): ObjectChainResolver<TParent$1, TFields>;
|
|
952
965
|
/**
|
|
953
966
|
* Creates a resolver for operations
|
|
954
967
|
* @template TFields - The operations to resolve
|
|
@@ -991,9 +1004,9 @@ declare class ChainResolver<TFields extends Record<string, FieldOrOperation | ty
|
|
|
991
1004
|
* @template TParent - The parent type
|
|
992
1005
|
* @template TFields - The fields to resolve
|
|
993
1006
|
*/
|
|
994
|
-
declare class ObjectChainResolver<TParent extends GraphQLSilk, TFields extends Record<string, FieldOrOperation | typeof FIELD_HIDDEN>> extends ChainResolver<TFields> {
|
|
1007
|
+
declare class ObjectChainResolver<TParent$1 extends GraphQLSilk, TFields extends Record<string, FieldOrOperation | typeof FIELD_HIDDEN>> extends ChainResolver<TFields> {
|
|
995
1008
|
protected meta: ResolverMeta<TFields> & {
|
|
996
|
-
parent: TParent;
|
|
1009
|
+
parent: TParent$1;
|
|
997
1010
|
};
|
|
998
1011
|
/**
|
|
999
1012
|
* Creates a new object chain resolver
|
|
@@ -1001,12 +1014,12 @@ declare class ObjectChainResolver<TParent extends GraphQLSilk, TFields extends R
|
|
|
1001
1014
|
* @param fields - The fields to resolve
|
|
1002
1015
|
* @param options - Optional resolver options
|
|
1003
1016
|
*/
|
|
1004
|
-
constructor(parent: TParent, fields: TFields, options?: ResolverOptionsWithExtensions<any>);
|
|
1017
|
+
constructor(parent: TParent$1, fields: TFields, options?: ResolverOptionsWithExtensions<any>);
|
|
1005
1018
|
/**
|
|
1006
1019
|
* Gets the metadata for the resolver
|
|
1007
1020
|
*/
|
|
1008
1021
|
get "~meta"(): ResolverMeta<TFields> & {
|
|
1009
|
-
parent: TParent;
|
|
1022
|
+
parent: TParent$1;
|
|
1010
1023
|
};
|
|
1011
1024
|
/**
|
|
1012
1025
|
* Sets custom extensions for the resolver
|
|
@@ -1032,7 +1045,7 @@ declare function silk<TObject extends GraphQLVariants<GraphQLObjectType>>(type:
|
|
|
1032
1045
|
/**
|
|
1033
1046
|
* Create a GraphQLSilk Object.
|
|
1034
1047
|
*/
|
|
1035
|
-
declare function silk<TOutput, TInput = TOutput>(type: GraphQLOutputType | (() => GraphQLOutputType), validate?: (value: TInput) => StandardSchemaV1.Result<TOutput> | Promise<StandardSchemaV1.Result<TOutput>>): GraphQLSilk<TOutput, TInput>;
|
|
1048
|
+
declare function silk<TOutput$1, TInput$1 = TOutput$1>(type: GraphQLOutputType | (() => GraphQLOutputType), validate?: (value: TInput$1) => StandardSchemaV1.Result<TOutput$1> | Promise<StandardSchemaV1.Result<TOutput$1>>): GraphQLSilk<TOutput$1, TInput$1>;
|
|
1036
1049
|
declare namespace silk {
|
|
1037
1050
|
var parse: typeof parseSilk;
|
|
1038
1051
|
var getType: typeof getGraphQLType;
|
|
@@ -1075,10 +1088,10 @@ declare function getGraphQLArgumentConfig(silk: GraphQLSilk): Omit<GraphQLArgume
|
|
|
1075
1088
|
*/
|
|
1076
1089
|
declare function parseSilk<TSilk extends GraphQLSilk>(silk: TSilk, input: StandardSchemaV1.InferInput<TSilk>): MayPromise<StandardSchemaV1.Result<StandardSchemaV1.InferOutput<TSilk>>>;
|
|
1077
1090
|
declare function isSilk(target: any): target is GraphQLSilk;
|
|
1078
|
-
type GraphQLVariants<TSource extends GraphQLNullableType> = TSource | GraphQLList<TSource> | GraphQLList<GraphQLNonNull<TSource>> | GraphQLNonNull<TSource> | GraphQLNonNull<GraphQLList<TSource>> | GraphQLNonNull<GraphQLList<GraphQLNonNull<TSource>>>;
|
|
1079
|
-
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;
|
|
1080
|
-
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;
|
|
1081
|
-
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;
|
|
1091
|
+
type GraphQLVariants<TSource$1 extends GraphQLNullableType> = TSource$1 | GraphQLList<TSource$1> | GraphQLList<GraphQLNonNull<TSource$1>> | GraphQLNonNull<TSource$1> | GraphQLNonNull<GraphQLList<TSource$1>> | GraphQLNonNull<GraphQLList<GraphQLNonNull<TSource$1>>>;
|
|
1092
|
+
type InferScalarInternalByVariants<T$1 extends GraphQLVariants<GraphQLScalarType>> = T$1 extends GraphQLNonNull<infer U> ? U extends GraphQLVariants<GraphQLScalarType> ? NonNullable<InferScalarInternalByVariants<U>> : never : T$1 extends GraphQLList<infer U> ? U extends GraphQLVariants<GraphQLScalarType> ? InferScalarInternalByVariants<U>[] : never : T$1 extends GraphQLScalarType<infer TInternal, any> ? TInternal | null | undefined : never;
|
|
1093
|
+
type InferScalarExternalByVariants<T$1 extends GraphQLVariants<GraphQLScalarType>> = T$1 extends GraphQLNonNull<infer U> ? U extends GraphQLVariants<GraphQLScalarType> ? NonNullable<InferScalarExternalByVariants<U>> : never : T$1 extends GraphQLList<infer U> ? U extends GraphQLVariants<GraphQLScalarType> ? InferScalarExternalByVariants<U>[] : never : T$1 extends GraphQLScalarType<any, infer TExternal> ? TExternal | null | undefined : never;
|
|
1094
|
+
type InferObjectSourceByVariants<T$1 extends GraphQLVariants<GraphQLObjectType>> = T$1 extends GraphQLNonNull<infer U> ? U extends GraphQLVariants<GraphQLObjectType> ? NonNullable<InferObjectSourceByVariants<U>> : never : T$1 extends GraphQLList<infer U> ? U extends GraphQLVariants<GraphQLObjectType> ? InferObjectSourceByVariants<U>[] : never : T$1 extends GraphQLObjectType<infer TSource> ? TSource | null | undefined : never;
|
|
1082
1095
|
//#endregion
|
|
1083
1096
|
//#region src/schema/extensions.d.ts
|
|
1084
1097
|
interface GQLoomExtensions {
|
|
@@ -1134,7 +1147,7 @@ declare class WeaverContext {
|
|
|
1134
1147
|
setConfig<TConfig extends WeaverConfig>(config: TConfig): void;
|
|
1135
1148
|
deleteConfig<TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]): void;
|
|
1136
1149
|
memoNamedType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(gqlTypeValue: TGraphQLType): TGraphQLType;
|
|
1137
|
-
getNamedType<T extends GraphQLOutputType>(name: string): T | undefined;
|
|
1150
|
+
getNamedType<T$1 extends GraphQLOutputType>(name: string): T$1 | undefined;
|
|
1138
1151
|
protected static readonly namedTypes: {
|
|
1139
1152
|
readonly Object: "Object";
|
|
1140
1153
|
readonly Union: "Union";
|
|
@@ -1148,11 +1161,11 @@ declare class WeaverContext {
|
|
|
1148
1161
|
* @returns -1 if a is better than b, 1 if b is better than a, 0 if they are equal
|
|
1149
1162
|
*/
|
|
1150
1163
|
protected static higherPriorityThan(a: string | undefined, b: string | undefined): number;
|
|
1151
|
-
static provide<T>(func: () => T, value: WeaverContext | undefined): T;
|
|
1164
|
+
static provide<T$1>(func: () => T$1, value: WeaverContext | undefined): T$1;
|
|
1152
1165
|
}
|
|
1153
1166
|
declare const initWeaverContext: () => WeaverContext;
|
|
1154
1167
|
declare const provideWeaverContext: typeof WeaverContext.provide & {
|
|
1155
|
-
inherit: <T>(func: () => T) => () => T;
|
|
1168
|
+
inherit: <T$1>(func: () => T$1) => () => T$1;
|
|
1156
1169
|
};
|
|
1157
1170
|
interface WeaverConfig {
|
|
1158
1171
|
[WEAVER_CONFIG]: string | symbol;
|
|
@@ -1164,7 +1177,7 @@ declare class GlobalWeaverContext implements Partial<Omit<WeaverContext, GlobalC
|
|
|
1164
1177
|
get id(): number | undefined;
|
|
1165
1178
|
get loomObjectMap(): Map<GraphQLObjectType<any, any>, LoomObjectType> | undefined;
|
|
1166
1179
|
get loomUnionMap(): Map<GraphQLUnionType, GraphQLUnionType> | undefined;
|
|
1167
|
-
get inputMap(): Map<GraphQLObjectType<any, any
|
|
1180
|
+
get inputMap(): Map<GraphQLInterfaceType | GraphQLObjectType<any, any>, GraphQLInputObjectType> | undefined;
|
|
1168
1181
|
get interfaceMap(): Map<GraphQLObjectType<any, any>, GraphQLInterfaceType> | undefined;
|
|
1169
1182
|
get configs(): Map<string | symbol, WeaverConfig> | undefined;
|
|
1170
1183
|
get vendorWeavers(): Map<string, SchemaWeaver> | undefined;
|
|
@@ -1175,7 +1188,7 @@ declare class GlobalWeaverContext implements Partial<Omit<WeaverContext, GlobalC
|
|
|
1175
1188
|
setConfig(config: WeaverConfig): void;
|
|
1176
1189
|
deleteConfig(key: string | symbol): void;
|
|
1177
1190
|
useConfig<TConfig extends WeaverConfig, TCallback extends () => any>(config: TConfig, callback: TCallback): ReturnType<TCallback>;
|
|
1178
|
-
getNamedType<T extends GraphQLOutputType>(name: string): T | undefined;
|
|
1191
|
+
getNamedType<T$1 extends GraphQLOutputType>(name: string): T$1 | undefined;
|
|
1179
1192
|
memoNamedType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(gqlType: TGraphQLType): TGraphQLType;
|
|
1180
1193
|
getGraphQLType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(origin: object): TGraphQLType | undefined;
|
|
1181
1194
|
memoGraphQLType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(origin: object, gqlType: TGraphQLType): TGraphQLType;
|
|
@@ -1195,7 +1208,7 @@ declare function collectNames<TRecords extends Record<string, object>[]>(...name
|
|
|
1195
1208
|
* @returns schema
|
|
1196
1209
|
*/
|
|
1197
1210
|
declare function collectName<TSchema extends object>(name: string, schema: TSchema): TSchema;
|
|
1198
|
-
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
1211
|
+
type UnionToIntersection<U$1> = (U$1 extends any ? (k: U$1) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
1199
1212
|
//#endregion
|
|
1200
1213
|
//#region src/schema/object.d.ts
|
|
1201
1214
|
declare class LoomObjectType extends GraphQLObjectType {
|
|
@@ -1297,4 +1310,4 @@ declare class GraphQLSchemaLoom {
|
|
|
1297
1310
|
*/
|
|
1298
1311
|
declare const weave: typeof GraphQLSchemaLoom.weave;
|
|
1299
1312
|
//#endregion
|
|
1300
|
-
export { subscription$1 as $,
|
|
1313
|
+
export { subscription$1 as $, GraphQLSilk as $t, getGraphQLType as A, FieldFactoryWithResolve as An, RequireKeys as At, ResolverFactory as B, StandardSchemaV1 as Bn, getMemoizationMap as Bt, DirectiveRecord as C, Query as Cn, MiddlewareOptions as Ct, NonNullSilk as D, BaseChainFactory as Dn, MayGetter as Dt, ListSilk as E, types_loom_d_exports as En, IsAny as Et, parseSilk as F, QueryFactoryWithResolve as Fn, markErrorLocation as Ft, createQuery as G, getFieldOptions as Gt, ToExecutorProps as H, onlyMemoization as Ht, silk as I, ResolvableSubscription as In, markLocation as It, field as J, FieldFactory as Jt, createSubscription as K, getOperationOptions as Kt, ChainResolver as L, SubscriptionChainFactory as Ln, tryIn as Lt, listSilk as M, MutationChainFactory as Mn, BatchLoadFn as Mt, nonNullSilk as N, MutationFactoryWithResolve as Nn, EasyDataLoader as Nt, NullableSilk as O, ChainFactoryOptions as On, MayPromise as Ot, nullableSilk as P, QueryChainFactory as Pn, LoomDataLoader as Pt, resolver as Q, GraphQLFieldOptions as Qt, Executor as R, SubscriptionNeedResolve as Rn, OnlyMemoizationPayload as Rt, DirectiveItem as S, Operation as Sn, MiddlewareOperation as St, GQLoomExtensions as T, Subscription as Tn, filterMiddlewares as Tt, createField as U, AUTO_ALIASING as Ut, ResolverMeta as V, isOnlyMemoryPayload as Vt, createMutation as W, DERIVED_DEPENDENCIES as Wt, mutation$1 as X, FieldOptions as Xt, loom as Y, FieldFactoryWithUtils as Yt, query$1 as Z, FieldOrOperationType as Zt, isSchemaVendorWeaver as _, BaseField as _n, notNullish as _t, LoomObjectType as a, OperationType as an, parseInputValue as at, ensureInputType as b, FieldOrOperation as bn, Middleware as bt, GlobalWeaverContext as c, QueryOptions as cn, screamingSnakeCase as ct, collectName as d, ResolverOptionsWithParent as dn, getDeepResolvingFields as dt, InferFieldInput as en, CallableInputParser as et, collectNames as f, ResolverPayload as fn, getResolvingFields as ft, SchemaWeaver as g, SubscriptionOptions as gn, meta as gt, weaverContext as h, SubscriptionFactoryWithChain as hn, mapValue as ht, CoreSchemaWeaverConfigOptions as i, MutationOptions as in, getStandardValue as it, isSilk as j, IChainFactory as jn, ValueOf as jt, getGraphQLArgumentConfig as k, FieldChainFactory as kn, OmitInUnion as kt, WeaverConfig as l, ResolverOptions as ln, ResolvingFields as lt, provideWeaverContext as m, SubscriptionFactory as mn, deepMerge as mt, weave as n, MutationFactory as nn, InferInputO as nt, OPERATION_OBJECT_NAMES as o, QueryFactory as on, capitalize as ot, initWeaverContext as p, ResolvingOptions as pn, parseResolvingFields as pt, defaultSubscriptionResolve as q, getSubscriptionOptions as qt, CoreSchemaWeaverConfig as r, MutationFactoryWithChain as rn, createInputParser as rt, getCacheType as s, QueryFactoryWithChain as sn, pascalCase as st, GraphQLSchemaLoom as t, InferFieldOutput as tn, InferInputI as tt, WeaverContext as u, ResolverOptionsWithExtensions as un, ResolvingFieldsOptions as ut, ensureInterfaceType as v, Field as vn, toObjMap as vt, GQLoomExtensionAttribute as w, Resolver as wn, applyMiddlewares as wt, inputToArgs as x, Mutation as xn, MiddlewareConfig as xt, ensureInputObjectType as y, FieldMeta as yn, CallableMiddlewareOptions as yt, ObjectChainResolver as z, symbols_d_exports as zn, assignContextMap as zt };
|