@gqloom/core 0.13.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/context.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-DBqGrLn7.d.cts → index-DPuy3FIT.d.cts} +178 -160
- package/dist/{index-DWjUYc0-.d.ts → index-DyGHE5li.d.ts} +178 -161
- package/dist/index.cjs +64 -25
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +64 -25
- 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
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { t as __export } from "./chunk-Bp6m_JJh.js";
|
|
2
1
|
import { GraphQLArgumentConfig, GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, GraphQLFieldExtensions, GraphQLFieldMap, GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLInterfaceTypeConfig, GraphQLList, GraphQLNamedType, GraphQLNonNull, GraphQLNullableType, GraphQLObjectType, GraphQLObjectTypeConfig, GraphQLOutputType, GraphQLResolveInfo, GraphQLScalarType, GraphQLSchema, GraphQLSchemaConfig, GraphQLType, GraphQLUnionType } from "graphql";
|
|
3
2
|
|
|
4
3
|
//#region ../../node_modules/.pnpm/@standard-schema+spec@1.0.0/node_modules/@standard-schema/spec/dist/index.d.ts
|
|
@@ -96,7 +95,7 @@ declare const FIELD_HIDDEN = false;
|
|
|
96
95
|
* @template TOutput - The output type of the GraphQL field
|
|
97
96
|
* @template TInput - The input type of the GraphQL field, can be a single type or a record of types
|
|
98
97
|
*/
|
|
99
|
-
interface IChainFactory<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> {
|
|
98
|
+
interface IChainFactory<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> {
|
|
100
99
|
/**
|
|
101
100
|
* Sets the description for the GraphQL field
|
|
102
101
|
* @param description - The description text for the field
|
|
@@ -117,13 +116,13 @@ interface IChainFactory<TOutput extends GraphQLSilk, TInput extends GraphQLSilk
|
|
|
117
116
|
* @template TOutputNew - The new output type
|
|
118
117
|
* @param output - The output type definition
|
|
119
118
|
*/
|
|
120
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): IChainFactory<TOutputNew, TInput>;
|
|
119
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): IChainFactory<TOutputNew, TInput$1>;
|
|
121
120
|
/**
|
|
122
121
|
* Sets the input type for the GraphQL field
|
|
123
122
|
* @template TInputNew - The new input type
|
|
124
123
|
* @param input - The input type definition
|
|
125
124
|
*/
|
|
126
|
-
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): IChainFactory<TOutput, TInputNew>;
|
|
125
|
+
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): IChainFactory<TOutput$1, TInputNew>;
|
|
127
126
|
}
|
|
128
127
|
/**
|
|
129
128
|
* Options for configuring a chain factory
|
|
@@ -183,7 +182,7 @@ declare abstract class BaseChainFactory<TField extends BaseField = any> {
|
|
|
183
182
|
* @template TInput - The input type of the field
|
|
184
183
|
* @template TDependencies - The dependencies of the field
|
|
185
184
|
*/
|
|
186
|
-
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> {
|
|
185
|
+
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> {
|
|
187
186
|
/**
|
|
188
187
|
* Returns the available methods for the field chain factory
|
|
189
188
|
*/
|
|
@@ -198,25 +197,25 @@ declare class FieldChainFactory<TOutput extends GraphQLSilk = never, TInput exte
|
|
|
198
197
|
* @template TOutputNew - The new output type
|
|
199
198
|
* @param output - The output type definition
|
|
200
199
|
*/
|
|
201
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): FieldChainFactory<TOutputNew, TInput, TDependencies>;
|
|
200
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): FieldChainFactory<TOutputNew, TInput$1, TDependencies$1>;
|
|
202
201
|
/**
|
|
203
202
|
* Sets the input type for the field
|
|
204
203
|
* @template TInputNew - The new input type
|
|
205
204
|
* @param input - The input type definition
|
|
206
205
|
*/
|
|
207
|
-
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): FieldChainFactory<TOutput, TInputNew, TDependencies>;
|
|
206
|
+
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): FieldChainFactory<TOutput$1, TInputNew, TDependencies$1>;
|
|
208
207
|
/**
|
|
209
208
|
* Specifies the dependencies for the field
|
|
210
209
|
* @template TDependencies - The dependencies type
|
|
211
210
|
* @param dependencies - The dependencies to add
|
|
212
211
|
*/
|
|
213
|
-
derivedFrom<const TDependencies extends string[]>(...dependencies: TDependencies): FieldChainFactory<TOutput, TInput, TDependencies>;
|
|
212
|
+
derivedFrom<const TDependencies$1 extends string[]>(...dependencies: TDependencies$1): FieldChainFactory<TOutput$1, TInput$1, TDependencies$1>;
|
|
214
213
|
/**
|
|
215
214
|
* Sets the resolve function for the field
|
|
216
215
|
* @template TParent - The parent type
|
|
217
216
|
* @param resolve - The resolve function
|
|
218
217
|
*/
|
|
219
|
-
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>;
|
|
218
|
+
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>;
|
|
220
219
|
/**
|
|
221
220
|
* Creates a field resolver that uses DataLoader for batch loading data.
|
|
222
221
|
* This method is particularly useful for optimizing performance when dealing with multiple data requests
|
|
@@ -226,15 +225,15 @@ declare class FieldChainFactory<TOutput extends GraphQLSilk = never, TInput exte
|
|
|
226
225
|
* @param resolve - A function that handles batch loading of data.
|
|
227
226
|
* @returns A GraphQL field resolver that implements batch loading
|
|
228
227
|
*/
|
|
229
|
-
load<TParent extends GraphQLSilk>(resolve: (parents: InferParent<TParent, TDependencies>[], input: InferInputO<TInput>, payloads: (ResolverPayload | undefined)[]) => MayPromise<StandardSchemaV1.InferOutput<TOutput>[]>): Field<TParent, TOutput, TInput, TDependencies>;
|
|
228
|
+
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>;
|
|
230
229
|
}
|
|
231
|
-
type InferParent<TParent extends GraphQLSilk, TDependencies extends string[] | undefined = undefined> = TDependencies extends string[] ? RequireKeys<NonNullable<StandardSchemaV1.InferOutput<TParent>>, TDependencies[number]> : NonNullable<StandardSchemaV1.InferOutput<TParent>>;
|
|
230
|
+
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>>;
|
|
232
231
|
/**
|
|
233
232
|
* Factory for creating query resolvers with chainable configuration
|
|
234
233
|
* @template TOutput - The output type of the query
|
|
235
234
|
* @template TInput - The input type of the query
|
|
236
235
|
*/
|
|
237
|
-
declare class QueryChainFactory<TOutput extends GraphQLSilk = never, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseChainFactory<Query<TOutput, TInput>> implements IChainFactory<TOutput, TInput> {
|
|
236
|
+
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> {
|
|
238
237
|
/**
|
|
239
238
|
* Returns the available methods for the query chain factory
|
|
240
239
|
* @returns An object containing all available methods
|
|
@@ -252,28 +251,28 @@ declare class QueryChainFactory<TOutput extends GraphQLSilk = never, TInput exte
|
|
|
252
251
|
* @param output - The output type definition
|
|
253
252
|
* @returns A new QueryChainFactory instance with the updated output type
|
|
254
253
|
*/
|
|
255
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): QueryChainFactory<TOutputNew, TInput>;
|
|
254
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): QueryChainFactory<TOutputNew, TInput$1>;
|
|
256
255
|
/**
|
|
257
256
|
* Sets the input type for the query
|
|
258
257
|
* @template TInputNew - The new input type
|
|
259
258
|
* @param input - The input type definition
|
|
260
259
|
* @returns A new QueryChainFactory instance with the updated input type
|
|
261
260
|
*/
|
|
262
|
-
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): QueryChainFactory<TOutput, TInputNew>;
|
|
261
|
+
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): QueryChainFactory<TOutput$1, TInputNew>;
|
|
263
262
|
/**
|
|
264
263
|
* Sets the resolve function for the query
|
|
265
264
|
* @param resolve - The resolve function that processes the input and returns the output
|
|
266
265
|
* @returns A GraphQL query resolver
|
|
267
266
|
* @throws {Error} If output type is not set
|
|
268
267
|
*/
|
|
269
|
-
resolve(resolve: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Query<TOutput, TInput>;
|
|
268
|
+
resolve(resolve: (input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Query<TOutput$1, TInput$1>;
|
|
270
269
|
}
|
|
271
270
|
/**
|
|
272
271
|
* Factory for creating mutation resolvers with chainable configuration
|
|
273
272
|
* @template TOutput - The output type of the mutation
|
|
274
273
|
* @template TInput - The input type of the mutation
|
|
275
274
|
*/
|
|
276
|
-
declare class MutationChainFactory<TOutput extends GraphQLSilk = never, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined> extends BaseChainFactory<Mutation<TOutput, TInput>> implements IChainFactory<TOutput, TInput> {
|
|
275
|
+
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> {
|
|
277
276
|
/**
|
|
278
277
|
* Returns the available methods for the mutation chain factory
|
|
279
278
|
* @returns An object containing all available methods
|
|
@@ -291,28 +290,28 @@ declare class MutationChainFactory<TOutput extends GraphQLSilk = never, TInput e
|
|
|
291
290
|
* @param output - The output type definition
|
|
292
291
|
* @returns A new MutationChainFactory instance with the updated output type
|
|
293
292
|
*/
|
|
294
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): MutationChainFactory<TOutputNew, TInput>;
|
|
293
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): MutationChainFactory<TOutputNew, TInput$1>;
|
|
295
294
|
/**
|
|
296
295
|
* Sets the input type for the mutation
|
|
297
296
|
* @template TInputNew - The new input type
|
|
298
297
|
* @param input - The input type definition
|
|
299
298
|
* @returns A new MutationChainFactory instance with the updated input type
|
|
300
299
|
*/
|
|
301
|
-
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): MutationChainFactory<TOutput, TInputNew>;
|
|
300
|
+
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): MutationChainFactory<TOutput$1, TInputNew>;
|
|
302
301
|
/**
|
|
303
302
|
* Sets the resolve function for the mutation
|
|
304
303
|
* @param resolve - The resolve function that processes the input and returns the output
|
|
305
304
|
* @returns A GraphQL mutation resolver
|
|
306
305
|
* @throws {Error} If output type is not set
|
|
307
306
|
*/
|
|
308
|
-
resolve(resolve: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Mutation<TOutput, TInput>;
|
|
307
|
+
resolve(resolve: (input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Mutation<TOutput$1, TInput$1>;
|
|
309
308
|
}
|
|
310
309
|
/**
|
|
311
310
|
* Factory for creating subscription resolvers with chainable configuration
|
|
312
311
|
* @template TOutput - The output type of the subscription
|
|
313
312
|
* @template TInput - The input type of the subscription
|
|
314
313
|
*/
|
|
315
|
-
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> {
|
|
314
|
+
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> {
|
|
316
315
|
/**
|
|
317
316
|
* Returns the available methods for the subscription chain factory
|
|
318
317
|
* @returns An object containing all available methods
|
|
@@ -330,14 +329,14 @@ declare class SubscriptionChainFactory<TOutput extends GraphQLSilk = never, TInp
|
|
|
330
329
|
* @param output - The output type definition
|
|
331
330
|
* @returns A new SubscriptionChainFactory instance with the updated output type
|
|
332
331
|
*/
|
|
333
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): SubscriptionChainFactory<TOutputNew, TInput>;
|
|
332
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew): SubscriptionChainFactory<TOutputNew, TInput$1>;
|
|
334
333
|
/**
|
|
335
334
|
* Sets the input type for the subscription
|
|
336
335
|
* @template TInputNew - The new input type
|
|
337
336
|
* @param input - The input type definition
|
|
338
337
|
* @returns A new SubscriptionChainFactory instance with the updated input type
|
|
339
338
|
*/
|
|
340
|
-
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): SubscriptionChainFactory<TOutput, TInputNew>;
|
|
339
|
+
input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): SubscriptionChainFactory<TOutput$1, TInputNew>;
|
|
341
340
|
/**
|
|
342
341
|
* Sets the subscribe function for the subscription
|
|
343
342
|
* @template TValue - The value type of the subscription
|
|
@@ -345,7 +344,7 @@ declare class SubscriptionChainFactory<TOutput extends GraphQLSilk = never, TInp
|
|
|
345
344
|
* @returns A subscription resolver that can be further configured with a resolve function
|
|
346
345
|
* @throws {Error} If output type is not set
|
|
347
346
|
*/
|
|
348
|
-
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>;
|
|
347
|
+
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>;
|
|
349
348
|
}
|
|
350
349
|
/**
|
|
351
350
|
* Interface for a subscription that can be resolved
|
|
@@ -353,12 +352,12 @@ declare class SubscriptionChainFactory<TOutput extends GraphQLSilk = never, TInp
|
|
|
353
352
|
* @template TInput - The input type of the subscription
|
|
354
353
|
* @template TValue - The value type of the subscription
|
|
355
354
|
*/
|
|
356
|
-
interface ResolvableSubscription<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput>> extends Subscription<TOutput, TInput, TValue> {
|
|
355
|
+
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> {
|
|
357
356
|
/**
|
|
358
357
|
* Sets the resolve function for the subscription
|
|
359
358
|
* @param resolve - The resolve function
|
|
360
359
|
*/
|
|
361
|
-
resolve(resolve: (value: TValue, input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Subscription<TOutput, TInput, TValue>;
|
|
360
|
+
resolve(resolve: (value: TValue, input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Subscription<TOutput$1, TInput$1, TValue>;
|
|
362
361
|
}
|
|
363
362
|
/**
|
|
364
363
|
* A subscription that can not be resolved yet, still needs to be resolved.
|
|
@@ -367,39 +366,39 @@ interface ResolvableSubscription<TOutput extends GraphQLSilk, TInput extends Gra
|
|
|
367
366
|
* @template TInput - The input type of the subscription
|
|
368
367
|
* @template TValue - The value type of the subscription
|
|
369
368
|
*/
|
|
370
|
-
interface SubscriptionNeedResolve<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput>> {
|
|
369
|
+
interface SubscriptionNeedResolve<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput$1>> {
|
|
371
370
|
/**
|
|
372
371
|
* Sets the resolve function for the subscription
|
|
373
372
|
* @param resolve - The resolve function
|
|
374
373
|
*/
|
|
375
|
-
resolve(resolve: (value: TValue, input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Subscription<TOutput, TInput, TValue>;
|
|
376
|
-
}
|
|
377
|
-
declare class QueryFactoryWithResolve<TInputO, TOutput extends GraphQLSilk, TInput extends GraphQLSilk<TInputO>> extends BaseChainFactory<Query<TOutput, TInput>> implements Query<TOutput, TInput> {
|
|
378
|
-
protected outputSilk: TOutput;
|
|
379
|
-
protected readonly options: QueryOptions<TOutput, TInput>;
|
|
380
|
-
get "~meta"(): Query<TOutput, TInput>["~meta"];
|
|
381
|
-
constructor(outputSilk: TOutput, options: QueryOptions<TOutput, TInput>);
|
|
382
|
-
protected clone(options?: Partial<QueryOptions<TOutput, TInput>> | undefined): this;
|
|
383
|
-
input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): QueryFactoryWithResolve<TInputO, TOutput, TInputNew>;
|
|
384
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): QueryFactoryWithResolve<TInputO, TOutputNew, TInput>;
|
|
385
|
-
}
|
|
386
|
-
declare class MutationFactoryWithResolve<TInputO, TOutput extends GraphQLSilk, TInput extends GraphQLSilk<TInputO>> extends BaseChainFactory<Query<TOutput, TInput>> implements Mutation<TOutput, TInput> {
|
|
387
|
-
protected outputSilk: TOutput;
|
|
388
|
-
protected readonly options: MutationOptions<TOutput, TInput>;
|
|
389
|
-
get "~meta"(): Mutation<TOutput, TInput>["~meta"];
|
|
390
|
-
constructor(outputSilk: TOutput, options: MutationOptions<TOutput, TInput>);
|
|
391
|
-
protected clone(options?: Partial<MutationOptions<TOutput, TInput>> | undefined): this;
|
|
392
|
-
input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): MutationFactoryWithResolve<TInputO, TOutput, TInputNew>;
|
|
393
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): MutationFactoryWithResolve<TInputO, TOutputNew, TInput>;
|
|
394
|
-
}
|
|
395
|
-
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>> {
|
|
396
|
-
protected outputSilk: TOutput;
|
|
397
|
-
protected readonly options: FieldOptions<TParent, TOutput, TInput, string[] | undefined>;
|
|
398
|
-
get "~meta"(): Field<TParent, TOutput, TInput, string[] | undefined>["~meta"];
|
|
399
|
-
constructor(outputSilk: TOutput, options: FieldOptions<TParent, TOutput, TInput, string[] | undefined>);
|
|
400
|
-
protected clone(options?: Partial<FieldOptions<TParent, TOutput, TInput, string[] | undefined>> | undefined): this;
|
|
401
|
-
input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): FieldFactoryWithResolve<TParent, TOutput, TInputO, TInputNew>;
|
|
402
|
-
output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): FieldFactoryWithResolve<TParent, TOutputNew, TInputO, TInput>;
|
|
374
|
+
resolve(resolve: (value: TValue, input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Subscription<TOutput$1, TInput$1, TValue>;
|
|
375
|
+
}
|
|
376
|
+
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> {
|
|
377
|
+
protected outputSilk: TOutput$1;
|
|
378
|
+
protected readonly options: QueryOptions<TOutput$1, TInput$1>;
|
|
379
|
+
get "~meta"(): Query<TOutput$1, TInput$1>["~meta"];
|
|
380
|
+
constructor(outputSilk: TOutput$1, options: QueryOptions<TOutput$1, TInput$1>);
|
|
381
|
+
protected clone(options?: Partial<QueryOptions<TOutput$1, TInput$1>> | undefined): this;
|
|
382
|
+
input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): QueryFactoryWithResolve<TInputO, TOutput$1, TInputNew>;
|
|
383
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput$1>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): QueryFactoryWithResolve<TInputO, TOutputNew, TInput$1>;
|
|
384
|
+
}
|
|
385
|
+
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> {
|
|
386
|
+
protected outputSilk: TOutput$1;
|
|
387
|
+
protected readonly options: MutationOptions<TOutput$1, TInput$1>;
|
|
388
|
+
get "~meta"(): Mutation<TOutput$1, TInput$1>["~meta"];
|
|
389
|
+
constructor(outputSilk: TOutput$1, options: MutationOptions<TOutput$1, TInput$1>);
|
|
390
|
+
protected clone(options?: Partial<MutationOptions<TOutput$1, TInput$1>> | undefined): this;
|
|
391
|
+
input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): MutationFactoryWithResolve<TInputO, TOutput$1, TInputNew>;
|
|
392
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput$1>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): MutationFactoryWithResolve<TInputO, TOutputNew, TInput$1>;
|
|
393
|
+
}
|
|
394
|
+
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>> {
|
|
395
|
+
protected outputSilk: TOutput$1;
|
|
396
|
+
protected readonly options: FieldOptions<TParent$1, TOutput$1, TInput$1, string[] | undefined>;
|
|
397
|
+
get "~meta"(): Field<TParent$1, TOutput$1, TInput$1, string[] | undefined>["~meta"];
|
|
398
|
+
constructor(outputSilk: TOutput$1, options: FieldOptions<TParent$1, TOutput$1, TInput$1, string[] | undefined>);
|
|
399
|
+
protected clone(options?: Partial<FieldOptions<TParent$1, TOutput$1, TInput$1, string[] | undefined>> | undefined): this;
|
|
400
|
+
input<TInputNew extends GraphQLSilk<TInputO>>(input: TInputNew): FieldFactoryWithResolve<TParent$1, TOutput$1, TInputO, TInputNew>;
|
|
401
|
+
output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput$1>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): FieldFactoryWithResolve<TParent$1, TOutputNew, TInputO, TInput$1>;
|
|
403
402
|
}
|
|
404
403
|
declare namespace types_loom_d_exports {
|
|
405
404
|
export { BaseField, Field, FieldMeta, FieldOrOperation, Mutation, Operation, Query, Resolver, Subscription };
|
|
@@ -415,51 +414,51 @@ interface FieldMeta extends GraphQLFieldOptions {
|
|
|
415
414
|
interface BaseField {
|
|
416
415
|
readonly "~meta": FieldMeta;
|
|
417
416
|
}
|
|
418
|
-
interface Field<TParent extends GraphQLSilk, TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void, TDependencies extends string[] | undefined = undefined> extends BaseField {
|
|
417
|
+
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 {
|
|
419
418
|
"~meta": {
|
|
420
419
|
operation: "field";
|
|
421
|
-
output: TOutput;
|
|
422
|
-
input: TInput;
|
|
420
|
+
output: TOutput$1;
|
|
421
|
+
input: TInput$1;
|
|
423
422
|
middlewares?: Middleware[];
|
|
424
|
-
dependencies?: TDependencies;
|
|
423
|
+
dependencies?: TDependencies$1;
|
|
425
424
|
types?: {
|
|
426
|
-
parent: ReSilk<TParent>;
|
|
425
|
+
parent: ReSilk<TParent$1>;
|
|
427
426
|
};
|
|
428
|
-
resolve: (parent: StandardSchemaV1.InferOutput<NonNullable<TParent>>, input: InferInputO<TInput>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
427
|
+
resolve: (parent: StandardSchemaV1.InferOutput<NonNullable<TParent$1>>, input: InferInputO<TInput$1>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
429
428
|
} & GraphQLFieldOptions;
|
|
430
429
|
}
|
|
431
|
-
interface Query<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseField {
|
|
430
|
+
interface Query<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseField {
|
|
432
431
|
"~meta": {
|
|
433
432
|
operation: "query";
|
|
434
433
|
parent?: undefined;
|
|
435
|
-
output: TOutput;
|
|
436
|
-
input: TInput;
|
|
434
|
+
output: TOutput$1;
|
|
435
|
+
input: TInput$1;
|
|
437
436
|
middlewares?: Middleware[];
|
|
438
|
-
resolve: (input: InferInputO<TInput>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
437
|
+
resolve: (input: InferInputO<TInput$1>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
439
438
|
} & GraphQLFieldOptions;
|
|
440
439
|
}
|
|
441
|
-
interface Mutation<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseField {
|
|
440
|
+
interface Mutation<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends BaseField {
|
|
442
441
|
"~meta": {
|
|
443
442
|
operation: "mutation";
|
|
444
443
|
parent?: undefined;
|
|
445
|
-
output: TOutput;
|
|
446
|
-
input: TInput;
|
|
444
|
+
output: TOutput$1;
|
|
445
|
+
input: TInput$1;
|
|
447
446
|
middlewares?: Middleware[];
|
|
448
|
-
resolve: (input: InferInputO<TInput>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
447
|
+
resolve: (input: InferInputO<TInput$1>, payload: ResolverPayload | void) => Promise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
449
448
|
} & GraphQLFieldOptions;
|
|
450
449
|
}
|
|
451
|
-
interface Subscription<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void, TValue = StandardSchemaV1.InferOutput<TOutput>> extends BaseField {
|
|
450
|
+
interface Subscription<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void, TValue = StandardSchemaV1.InferOutput<TOutput$1>> extends BaseField {
|
|
452
451
|
"~meta": {
|
|
453
452
|
operation: "subscription";
|
|
454
453
|
parent?: undefined;
|
|
455
|
-
output: TOutput;
|
|
456
|
-
input: TInput;
|
|
454
|
+
output: TOutput$1;
|
|
455
|
+
input: TInput$1;
|
|
457
456
|
middlewares?: Middleware[];
|
|
458
457
|
types?: {
|
|
459
458
|
value: TValue;
|
|
460
459
|
} & GraphQLFieldOptions;
|
|
461
|
-
resolve: (value: TValue, input: InferInputO<TInput>, payload: ResolverPayload | void) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
462
|
-
subscribe: (input: InferInputO<TInput>, payload: ResolverPayload | void) => MayPromise<AsyncIterator<TValue>>;
|
|
460
|
+
resolve: (value: TValue, input: InferInputO<TInput$1>, payload: ResolverPayload | void) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
461
|
+
subscribe: (input: InferInputO<TInput$1>, payload: ResolverPayload | void) => MayPromise<AsyncIterator<TValue>>;
|
|
463
462
|
} & GraphQLFieldOptions;
|
|
464
463
|
}
|
|
465
464
|
interface Resolver {
|
|
@@ -472,10 +471,10 @@ interface Resolver {
|
|
|
472
471
|
}
|
|
473
472
|
type Operation = Query<GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void> | Mutation<GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void> | Subscription<GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void, any>;
|
|
474
473
|
type FieldOrOperation = Field<GraphQLSilk, GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void, string[] | undefined> | Operation;
|
|
475
|
-
type ReSilk<T extends GraphQLSilk> = GraphQLSilk<NonNullable<T["~standard"]["types"]>["output"], NonNullable<T["~standard"]["types"]>["input"]>;
|
|
474
|
+
type ReSilk<T$1 extends GraphQLSilk> = GraphQLSilk<NonNullable<T$1["~standard"]["types"]>["output"], NonNullable<T$1["~standard"]["types"]>["input"]>;
|
|
476
475
|
//#endregion
|
|
477
476
|
//#region src/resolver/types.d.ts
|
|
478
|
-
interface GraphQLSilk<TOutput = any, TInput = any> extends StandardSchemaV1<TInput, TOutput> {
|
|
477
|
+
interface GraphQLSilk<TOutput$1 = any, TInput$1 = any> extends StandardSchemaV1<TInput$1, TOutput$1> {
|
|
479
478
|
/**
|
|
480
479
|
* GraphQL type for schema
|
|
481
480
|
*/
|
|
@@ -503,33 +502,33 @@ type InferFieldOutput<TField extends BaseField> = TField["~meta"]["output"];
|
|
|
503
502
|
/**
|
|
504
503
|
* Options for creating a GraphQL Query.
|
|
505
504
|
*/
|
|
506
|
-
interface QueryOptions<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends ResolverOptions<Query<TOutput, TInput>>, GraphQLFieldOptions {
|
|
507
|
-
input?: TInput;
|
|
508
|
-
resolve: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
505
|
+
interface QueryOptions<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | void = void> extends ResolverOptions<Query<TOutput$1, TInput$1>>, GraphQLFieldOptions {
|
|
506
|
+
input?: TInput$1;
|
|
507
|
+
resolve: (input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
509
508
|
}
|
|
510
509
|
/**
|
|
511
510
|
* Options for creating a GraphQL Mutation.
|
|
512
511
|
*/
|
|
513
|
-
interface MutationOptions<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined> extends ResolverOptions<Mutation<TOutput, TInput>>, GraphQLFieldOptions {
|
|
514
|
-
input?: TInput;
|
|
515
|
-
resolve: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
512
|
+
interface MutationOptions<TOutput$1 extends GraphQLSilk, TInput$1 extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined> extends ResolverOptions<Mutation<TOutput$1, TInput$1>>, GraphQLFieldOptions {
|
|
513
|
+
input?: TInput$1;
|
|
514
|
+
resolve: (input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
516
515
|
}
|
|
517
516
|
/**
|
|
518
517
|
* Function to create a GraphQL query.
|
|
519
518
|
*/
|
|
520
519
|
interface QueryFactory {
|
|
521
|
-
<TOutput extends GraphQLSilk>(output: TOutput, resolve: (input: void, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Query<TOutput, void>;
|
|
522
|
-
<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | void = void>(output: TOutput, options: QueryOptions<TOutput, TInput>): Query<TOutput, TInput>;
|
|
523
|
-
<TOutput extends GraphQLSilk>(output: TOutput): QueryChainFactory<TOutput, void>;
|
|
520
|
+
<TOutput$1 extends GraphQLSilk>(output: TOutput$1, resolve: (input: void, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Query<TOutput$1, void>;
|
|
521
|
+
<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>;
|
|
522
|
+
<TOutput$1 extends GraphQLSilk>(output: TOutput$1): QueryChainFactory<TOutput$1, void>;
|
|
524
523
|
}
|
|
525
524
|
interface QueryFactoryWithChain extends QueryFactory, QueryChainFactory<never, void> {}
|
|
526
525
|
/**
|
|
527
526
|
* Function to create a GraphQL mutation.
|
|
528
527
|
*/
|
|
529
528
|
interface MutationFactory {
|
|
530
|
-
<TOutput extends GraphQLSilk>(output: TOutput, resolve: (input: void, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>): Mutation<TOutput, undefined>;
|
|
531
|
-
<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined>(output: TOutput, options: MutationOptions<TOutput, TInput>): Mutation<TOutput, TInput>;
|
|
532
|
-
<TOutput extends GraphQLSilk>(output: TOutput): MutationChainFactory<TOutput, undefined>;
|
|
529
|
+
<TOutput$1 extends GraphQLSilk>(output: TOutput$1, resolve: (input: void, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>): Mutation<TOutput$1, undefined>;
|
|
530
|
+
<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>;
|
|
531
|
+
<TOutput$1 extends GraphQLSilk>(output: TOutput$1): MutationChainFactory<TOutput$1, undefined>;
|
|
533
532
|
}
|
|
534
533
|
/**
|
|
535
534
|
* Function to create a GraphQL mutation.
|
|
@@ -538,28 +537,28 @@ interface MutationFactoryWithChain extends MutationFactory, MutationChainFactory
|
|
|
538
537
|
/**
|
|
539
538
|
* Options for External Filed of existing GraphQL Object.
|
|
540
539
|
*/
|
|
541
|
-
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 {
|
|
542
|
-
input?: TInput;
|
|
543
|
-
dependencies?: TDependencies;
|
|
544
|
-
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>>;
|
|
540
|
+
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 {
|
|
541
|
+
input?: TInput$1;
|
|
542
|
+
dependencies?: TDependencies$1;
|
|
543
|
+
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>>;
|
|
545
544
|
}
|
|
546
545
|
/**
|
|
547
546
|
* Function to create a GraphQL Field.
|
|
548
547
|
*/
|
|
549
548
|
interface FieldFactory {
|
|
550
|
-
<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>;
|
|
551
|
-
<TParent extends GraphQLSilk, TOutput extends GraphQLSilk>(output: TOutput, options: FieldOptions<TParent, TOutput, undefined, undefined>): Field<TParent, TOutput, undefined, undefined>;
|
|
552
|
-
<TParent extends GraphQLSilk, TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined>(output: TOutput, options: FieldOptions<TParent, TOutput, TInput, undefined> & {
|
|
553
|
-
input: TInput;
|
|
554
|
-
}): Field<TParent, TOutput, TInput, undefined>;
|
|
555
|
-
<TParent extends GraphQLSilk, TOutput extends GraphQLSilk, const TDependencies extends string[] | undefined>(output: TOutput, options: FieldOptions<TParent, TOutput, undefined, TDependencies> & {
|
|
556
|
-
dependencies: TDependencies;
|
|
557
|
-
}): Field<TParent, TOutput, undefined, TDependencies>;
|
|
558
|
-
<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> & {
|
|
559
|
-
input: TInput;
|
|
560
|
-
dependencies: TDependencies;
|
|
561
|
-
}): Field<TParent, TOutput, TInput, TDependencies>;
|
|
562
|
-
<TOutput extends GraphQLSilk>(output: TOutput): FieldChainFactory<TOutput, undefined, undefined>;
|
|
549
|
+
<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>;
|
|
550
|
+
<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>;
|
|
551
|
+
<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> & {
|
|
552
|
+
input: TInput$1;
|
|
553
|
+
}): Field<TParent$1, TOutput$1, TInput$1, undefined>;
|
|
554
|
+
<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> & {
|
|
555
|
+
dependencies: TDependencies$1;
|
|
556
|
+
}): Field<TParent$1, TOutput$1, undefined, TDependencies$1>;
|
|
557
|
+
<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> & {
|
|
558
|
+
input: TInput$1;
|
|
559
|
+
dependencies: TDependencies$1;
|
|
560
|
+
}): Field<TParent$1, TOutput$1, TInput$1, TDependencies$1>;
|
|
561
|
+
<TOutput$1 extends GraphQLSilk>(output: TOutput$1): FieldChainFactory<TOutput$1, undefined, undefined>;
|
|
563
562
|
}
|
|
564
563
|
interface FieldFactoryWithUtils extends FieldFactory, FieldChainFactory<never, undefined, undefined> {
|
|
565
564
|
/** Set fields to be hidden in GraphQL Schema */
|
|
@@ -568,18 +567,18 @@ interface FieldFactoryWithUtils extends FieldFactory, FieldChainFactory<never, u
|
|
|
568
567
|
/**
|
|
569
568
|
* Options for creating a GraphQL Subscription.
|
|
570
569
|
*/
|
|
571
|
-
interface SubscriptionOptions<TOutput extends GraphQLSilk, TInput extends GraphQLSilk | Record<string, GraphQLSilk> | undefined = undefined, TValue = StandardSchemaV1.InferOutput<TOutput>> extends ResolverOptions<Subscription<TOutput, TInput, TValue>>, GraphQLFieldOptions {
|
|
572
|
-
input?: TInput;
|
|
573
|
-
subscribe: (input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<AsyncIterator<TValue>>;
|
|
574
|
-
resolve?: (value: TValue, input: InferInputO<TInput>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput>>;
|
|
570
|
+
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 {
|
|
571
|
+
input?: TInput$1;
|
|
572
|
+
subscribe: (input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<AsyncIterator<TValue>>;
|
|
573
|
+
resolve?: (value: TValue, input: InferInputO<TInput$1>, payload: ResolverPayload | undefined) => MayPromise<StandardSchemaV1.InferOutput<TOutput$1>>;
|
|
575
574
|
}
|
|
576
575
|
/**
|
|
577
576
|
* Function to create a GraphQL subscription.
|
|
578
577
|
*/
|
|
579
578
|
interface SubscriptionFactory {
|
|
580
|
-
<TOutput extends GraphQLSilk, TValue = StandardSchemaV1.InferOutput<TOutput>>(output: TOutput, subscribe: (payload: ResolverPayload | undefined) => MayPromise<AsyncIterator<StandardSchemaV1.InferOutput<TOutput>>>): Subscription<TOutput, undefined, TValue>;
|
|
581
|
-
<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>;
|
|
582
|
-
<TOutput extends GraphQLSilk>(output: TOutput): SubscriptionChainFactory<TOutput, undefined>;
|
|
579
|
+
<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>;
|
|
580
|
+
<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>;
|
|
581
|
+
<TOutput$1 extends GraphQLSilk>(output: TOutput$1): SubscriptionChainFactory<TOutput$1, undefined>;
|
|
583
582
|
}
|
|
584
583
|
interface SubscriptionFactoryWithChain extends SubscriptionFactory, SubscriptionChainFactory<never, undefined> {}
|
|
585
584
|
/**
|
|
@@ -643,7 +642,7 @@ declare function assignContextMap(target: ContextMemoryContainer): WeakMap<WeakK
|
|
|
643
642
|
//#endregion
|
|
644
643
|
//#region src/utils/error.d.ts
|
|
645
644
|
declare function markErrorLocation<TError>(error: TError, ...locations: string[]): TError;
|
|
646
|
-
declare function tryIn<T>(func: () => T, ...locations: string[]): T;
|
|
645
|
+
declare function tryIn<T$1>(func: () => T$1, ...locations: string[]): T$1;
|
|
647
646
|
/**
|
|
648
647
|
* mark message with location
|
|
649
648
|
* @param message origin message
|
|
@@ -688,12 +687,12 @@ declare class EasyDataLoader<TKey, TData> extends LoomDataLoader<TKey, TData> {
|
|
|
688
687
|
}
|
|
689
688
|
//#endregion
|
|
690
689
|
//#region src/utils/types.d.ts
|
|
691
|
-
type MayPromise<T> = T | Promise<T>;
|
|
692
|
-
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
693
|
-
type ValueOf<T extends object> = T[keyof T];
|
|
690
|
+
type MayPromise<T$1> = T$1 | Promise<T$1>;
|
|
691
|
+
type IsAny<T$1> = 0 extends 1 & T$1 ? true : false;
|
|
692
|
+
type ValueOf<T$1 extends object> = T$1[keyof T$1];
|
|
694
693
|
type OmitInUnion<TUnion, TOmit> = TUnion extends infer T ? T extends TOmit ? never : T : never;
|
|
695
|
-
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] };
|
|
696
|
-
type MayGetter<T> = T | (() => T);
|
|
694
|
+
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] };
|
|
695
|
+
type MayGetter<T$1> = T$1 | (() => T$1);
|
|
697
696
|
//#endregion
|
|
698
697
|
//#region src/utils/middleware.d.ts
|
|
699
698
|
/**
|
|
@@ -740,13 +739,13 @@ declare function filterMiddlewares(operation: MiddlewareOperation, ...middleware
|
|
|
740
739
|
* Creates an object map with the same keys as `map` and values generated by
|
|
741
740
|
* running each value of `record` thru `fn`.
|
|
742
741
|
*/
|
|
743
|
-
declare function mapValue<T, V>(record: Record<string, T>, fn: (value: T, key: string) => V | typeof mapValue.SKIP): Record<string, V>;
|
|
742
|
+
declare function mapValue<T$1, V>(record: Record<string, T$1>, fn: (value: T$1, key: string) => V | typeof mapValue.SKIP): Record<string, V>;
|
|
744
743
|
declare namespace mapValue {
|
|
745
744
|
var SKIP: unique symbol;
|
|
746
745
|
}
|
|
747
|
-
declare function toObjMap<T>(obj: Maybe<ReadOnlyObjMapLike<T>>): ReadOnlyObjMap<T>;
|
|
748
|
-
declare function notNullish<T>(x: T | undefined | null): x is T;
|
|
749
|
-
declare function deepMerge<T extends Record<string, any>>(...objects: (T | null | undefined)[]): T;
|
|
746
|
+
declare function toObjMap<T$1>(obj: Maybe<ReadOnlyObjMapLike<T$1>>): ReadOnlyObjMap<T$1>;
|
|
747
|
+
declare function notNullish<T$1>(x: T$1 | undefined | null): x is T$1;
|
|
748
|
+
declare function deepMerge<T$1 extends Record<string, any>>(...objects: (T$1 | null | undefined)[]): T$1;
|
|
750
749
|
/**
|
|
751
750
|
* Wraps the provided data in an object with a single key `"~meta"`.
|
|
752
751
|
*
|
|
@@ -758,15 +757,15 @@ declare function deepMerge<T extends Record<string, any>>(...objects: (T | null
|
|
|
758
757
|
* const metaData = meta(originalData);
|
|
759
758
|
* console.log(metaData); // Output: { "~meta": { key: "value" } }
|
|
760
759
|
*/
|
|
761
|
-
declare function meta<T>(data: T): {
|
|
762
|
-
"~meta": T;
|
|
760
|
+
declare function meta<T$1>(data: T$1): {
|
|
761
|
+
"~meta": T$1;
|
|
763
762
|
};
|
|
764
|
-
type Maybe<T> = null | undefined | T;
|
|
765
|
-
type ReadOnlyObjMapLike<T> = ReadOnlyObjMap<T> | {
|
|
766
|
-
readonly [key: string]: T;
|
|
763
|
+
type Maybe<T$1> = null | undefined | T$1;
|
|
764
|
+
type ReadOnlyObjMapLike<T$1> = ReadOnlyObjMap<T$1> | {
|
|
765
|
+
readonly [key: string]: T$1;
|
|
767
766
|
};
|
|
768
|
-
interface ReadOnlyObjMap<T> {
|
|
769
|
-
readonly [key: string]: T;
|
|
767
|
+
interface ReadOnlyObjMap<T$1> {
|
|
768
|
+
readonly [key: string]: T$1;
|
|
770
769
|
}
|
|
771
770
|
//#endregion
|
|
772
771
|
//#region src/utils/parse-resolving-fields.d.ts
|
|
@@ -791,40 +790,53 @@ interface ResolvingFields {
|
|
|
791
790
|
*/
|
|
792
791
|
selectedFields: ReadonlySet<string>;
|
|
793
792
|
}
|
|
793
|
+
interface ResolvingFieldsOptions {
|
|
794
|
+
/**
|
|
795
|
+
* Whether to include GraphQL introspection/meta fields (names starting with "__").
|
|
796
|
+
* Default: false (filtered out).
|
|
797
|
+
*/
|
|
798
|
+
includeIntrospection?: boolean;
|
|
799
|
+
/**
|
|
800
|
+
* Maximum depth of nested fields to parse.
|
|
801
|
+
* Default: Infinity for deep helpers; default is handled per caller.
|
|
802
|
+
*/
|
|
803
|
+
maxDepth?: number;
|
|
804
|
+
}
|
|
794
805
|
/**
|
|
795
806
|
* Analyzes and processes field resolution in a GraphQL query deeply.
|
|
796
807
|
*
|
|
797
808
|
* @param payload - The resolver payload containing the current field resolution context
|
|
798
|
-
* @param
|
|
809
|
+
* @param options - Additional parsing options (e.g., includeIntrospection, maxDepth; default maxDepth = Infinity)
|
|
799
810
|
* @returns A map of field paths to their resolving fields
|
|
800
811
|
*/
|
|
801
|
-
declare function getDeepResolvingFields(payload: Pick<ResolverPayload, "info">,
|
|
812
|
+
declare function getDeepResolvingFields(payload: Pick<ResolverPayload, "info">, options?: ResolvingFieldsOptions): Map<string, ResolvingFields>;
|
|
802
813
|
/**
|
|
803
814
|
* Analyzes and processes field resolution in a GraphQL query.
|
|
804
815
|
*
|
|
805
816
|
* @param payload - The resolver payload containing the current field resolution context
|
|
817
|
+
* @param options - Additional parsing options (e.g., includeIntrospection; fixed maxDepth = 1)
|
|
806
818
|
* @returns An object containing sets of different field types
|
|
807
819
|
*/
|
|
808
|
-
declare function getResolvingFields(payload: Pick<ResolverPayload, "info">): ResolvingFields;
|
|
820
|
+
declare function getResolvingFields(payload: Pick<ResolverPayload, "info">, options?: Omit<ResolvingFieldsOptions, "maxDepth">): ResolvingFields;
|
|
809
821
|
/**
|
|
810
822
|
* Parses the GraphQL resolve info to extract all requested fields.
|
|
811
823
|
* Returns a Set of field paths where nested fields are represented as 'parent.field'.
|
|
812
824
|
* Supports @include, @skip directives, fragments, and variables.
|
|
813
825
|
*
|
|
814
826
|
* @param info - The GraphQL resolve info object containing the query information
|
|
815
|
-
* @param
|
|
827
|
+
* @param options - Additional parsing options (e.g., includeIntrospection, maxDepth; default maxDepth = 1)
|
|
816
828
|
* @returns A Set of field paths
|
|
817
829
|
*/
|
|
818
|
-
declare function parseResolvingFields(info: GraphQLResolveInfo,
|
|
830
|
+
declare function parseResolvingFields(info: GraphQLResolveInfo, options?: ResolvingFieldsOptions): Set<string>;
|
|
819
831
|
//#endregion
|
|
820
832
|
//#region src/utils/string.d.ts
|
|
821
833
|
declare function pascalCase(str: string): string;
|
|
822
|
-
declare function capitalize<T extends string>(str: T): Capitalize<T>;
|
|
834
|
+
declare function capitalize<T$1 extends string>(str: T$1): Capitalize<T$1>;
|
|
823
835
|
declare function screamingSnakeCase(str: string): string;
|
|
824
836
|
//#endregion
|
|
825
837
|
//#region src/resolver/input.d.ts
|
|
826
|
-
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;
|
|
827
|
-
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;
|
|
838
|
+
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;
|
|
839
|
+
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;
|
|
828
840
|
interface CallableInputParser<TSchema extends GraphQLSilk | Record<string, GraphQLSilk> | void> {
|
|
829
841
|
/**
|
|
830
842
|
* input schema
|
|
@@ -857,9 +869,9 @@ interface CallableInputParser<TSchema extends GraphQLSilk | Record<string, Graph
|
|
|
857
869
|
}
|
|
858
870
|
declare function createInputParser<TSchema extends GraphQLSilk | Record<string, GraphQLSilk> | void>(schema: TSchema, value: InferInputI<TSchema>): CallableInputParser<TSchema>;
|
|
859
871
|
declare function parseInputValue<TSchema extends GraphQLSilk | Record<string, GraphQLSilk> | void>(inputSchema: TSchema, input: any): MayPromise<StandardSchemaV1.Result<InferInputO<TSchema>>>;
|
|
860
|
-
declare function getStandardValue<T>(result: StandardSchemaV1.Result<T>): T;
|
|
861
|
-
declare function getStandardValue<T>(result?: StandardSchemaV1.Result<T>): T | undefined;
|
|
862
|
-
declare function getStandardValue<T>(result: StandardSchemaV1.Result<T> | null): T | null;
|
|
872
|
+
declare function getStandardValue<T$1>(result: StandardSchemaV1.Result<T$1>): T$1;
|
|
873
|
+
declare function getStandardValue<T$1>(result?: StandardSchemaV1.Result<T$1>): T$1 | undefined;
|
|
874
|
+
declare function getStandardValue<T$1>(result: StandardSchemaV1.Result<T$1> | null): T$1 | null;
|
|
863
875
|
//#endregion
|
|
864
876
|
//#region src/resolver/resolver.d.ts
|
|
865
877
|
/**
|
|
@@ -868,7 +880,7 @@ declare function getStandardValue<T>(result: StandardSchemaV1.Result<T> | null):
|
|
|
868
880
|
* @param resolveOrOptions - Either a resolve function or options object
|
|
869
881
|
* @returns A GraphQL query resolver
|
|
870
882
|
*/
|
|
871
|
-
declare const createQuery: (output: GraphQLSilk<any, any>, resolveOrOptions?: ((...args: any) => MayPromise<unknown>) | QueryOptions<any, any>) =>
|
|
883
|
+
declare const createQuery: (output: GraphQLSilk<any, any>, resolveOrOptions?: ((...args: any) => MayPromise<unknown>) | QueryOptions<any, any>) => Query<any, any> | QueryChainFactory<never, void>;
|
|
872
884
|
/**
|
|
873
885
|
* Factory function for creating GraphQL queries with chainable configuration
|
|
874
886
|
*/
|
|
@@ -879,7 +891,7 @@ declare const query$1: QueryFactoryWithChain;
|
|
|
879
891
|
* @param resolveOrOptions - Either a resolve function or options object
|
|
880
892
|
* @returns A GraphQL mutation resolver
|
|
881
893
|
*/
|
|
882
|
-
declare const createMutation: (output: GraphQLSilk<any, any>, resolveOrOptions?: (() => MayPromise<unknown>) | MutationOptions<any, any>) =>
|
|
894
|
+
declare const createMutation: (output: GraphQLSilk<any, any>, resolveOrOptions?: (() => MayPromise<unknown>) | MutationOptions<any, any>) => Mutation<any, any> | MutationChainFactory<never, undefined>;
|
|
883
895
|
/**
|
|
884
896
|
* Factory function for creating GraphQL mutations with chainable configuration
|
|
885
897
|
*/
|
|
@@ -890,7 +902,7 @@ declare const mutation$1: MutationFactoryWithChain;
|
|
|
890
902
|
* @param resolveOrOptions - Either a resolve function or options object
|
|
891
903
|
* @returns A GraphQL field resolver
|
|
892
904
|
*/
|
|
893
|
-
declare const createField: (output: GraphQLSilk<any, any>, resolveOrOptions?: (() => unknown) | FieldOptions<GraphQLSilk, GraphQLSilk, GraphQLSilk | Record<string, GraphQLSilk> | void, string[] | undefined>) =>
|
|
905
|
+
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>;
|
|
894
906
|
/**
|
|
895
907
|
* Factory function for creating GraphQL fields with chainable configuration
|
|
896
908
|
*/
|
|
@@ -947,7 +959,7 @@ interface ResolverFactory {
|
|
|
947
959
|
* @param fields - The fields to resolve
|
|
948
960
|
* @param options - Optional resolver options
|
|
949
961
|
*/
|
|
950
|
-
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>;
|
|
962
|
+
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>;
|
|
951
963
|
/**
|
|
952
964
|
* Creates a resolver for operations
|
|
953
965
|
* @template TFields - The operations to resolve
|
|
@@ -990,9 +1002,9 @@ declare class ChainResolver<TFields extends Record<string, FieldOrOperation | ty
|
|
|
990
1002
|
* @template TParent - The parent type
|
|
991
1003
|
* @template TFields - The fields to resolve
|
|
992
1004
|
*/
|
|
993
|
-
declare class ObjectChainResolver<TParent extends GraphQLSilk, TFields extends Record<string, FieldOrOperation | typeof FIELD_HIDDEN>> extends ChainResolver<TFields> {
|
|
1005
|
+
declare class ObjectChainResolver<TParent$1 extends GraphQLSilk, TFields extends Record<string, FieldOrOperation | typeof FIELD_HIDDEN>> extends ChainResolver<TFields> {
|
|
994
1006
|
protected meta: ResolverMeta<TFields> & {
|
|
995
|
-
parent: TParent;
|
|
1007
|
+
parent: TParent$1;
|
|
996
1008
|
};
|
|
997
1009
|
/**
|
|
998
1010
|
* Creates a new object chain resolver
|
|
@@ -1000,12 +1012,12 @@ declare class ObjectChainResolver<TParent extends GraphQLSilk, TFields extends R
|
|
|
1000
1012
|
* @param fields - The fields to resolve
|
|
1001
1013
|
* @param options - Optional resolver options
|
|
1002
1014
|
*/
|
|
1003
|
-
constructor(parent: TParent, fields: TFields, options?: ResolverOptionsWithExtensions<any>);
|
|
1015
|
+
constructor(parent: TParent$1, fields: TFields, options?: ResolverOptionsWithExtensions<any>);
|
|
1004
1016
|
/**
|
|
1005
1017
|
* Gets the metadata for the resolver
|
|
1006
1018
|
*/
|
|
1007
1019
|
get "~meta"(): ResolverMeta<TFields> & {
|
|
1008
|
-
parent: TParent;
|
|
1020
|
+
parent: TParent$1;
|
|
1009
1021
|
};
|
|
1010
1022
|
/**
|
|
1011
1023
|
* Sets custom extensions for the resolver
|
|
@@ -1031,7 +1043,7 @@ declare function silk<TObject extends GraphQLVariants<GraphQLObjectType>>(type:
|
|
|
1031
1043
|
/**
|
|
1032
1044
|
* Create a GraphQLSilk Object.
|
|
1033
1045
|
*/
|
|
1034
|
-
declare function silk<TOutput, TInput = TOutput>(type: GraphQLOutputType | (() => GraphQLOutputType), validate?: (value: TInput) => StandardSchemaV1.Result<TOutput> | Promise<StandardSchemaV1.Result<TOutput>>): GraphQLSilk<TOutput, TInput>;
|
|
1046
|
+
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>;
|
|
1035
1047
|
declare namespace silk {
|
|
1036
1048
|
var parse: typeof parseSilk;
|
|
1037
1049
|
var getType: typeof getGraphQLType;
|
|
@@ -1074,10 +1086,10 @@ declare function getGraphQLArgumentConfig(silk: GraphQLSilk): Omit<GraphQLArgume
|
|
|
1074
1086
|
*/
|
|
1075
1087
|
declare function parseSilk<TSilk extends GraphQLSilk>(silk: TSilk, input: StandardSchemaV1.InferInput<TSilk>): MayPromise<StandardSchemaV1.Result<StandardSchemaV1.InferOutput<TSilk>>>;
|
|
1076
1088
|
declare function isSilk(target: any): target is GraphQLSilk;
|
|
1077
|
-
type GraphQLVariants<TSource extends GraphQLNullableType> = TSource | GraphQLList<TSource> | GraphQLList<GraphQLNonNull<TSource>> | GraphQLNonNull<TSource> | GraphQLNonNull<GraphQLList<TSource>> | GraphQLNonNull<GraphQLList<GraphQLNonNull<TSource>>>;
|
|
1078
|
-
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;
|
|
1079
|
-
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;
|
|
1080
|
-
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;
|
|
1089
|
+
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>>>;
|
|
1090
|
+
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;
|
|
1091
|
+
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;
|
|
1092
|
+
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;
|
|
1081
1093
|
//#endregion
|
|
1082
1094
|
//#region src/schema/extensions.d.ts
|
|
1083
1095
|
interface GQLoomExtensions {
|
|
@@ -1133,7 +1145,7 @@ declare class WeaverContext {
|
|
|
1133
1145
|
setConfig<TConfig extends WeaverConfig>(config: TConfig): void;
|
|
1134
1146
|
deleteConfig<TConfig extends WeaverConfig>(key: TConfig[typeof WEAVER_CONFIG]): void;
|
|
1135
1147
|
memoNamedType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(gqlTypeValue: TGraphQLType): TGraphQLType;
|
|
1136
|
-
getNamedType<T extends GraphQLOutputType>(name: string): T | undefined;
|
|
1148
|
+
getNamedType<T$1 extends GraphQLOutputType>(name: string): T$1 | undefined;
|
|
1137
1149
|
protected static readonly namedTypes: {
|
|
1138
1150
|
readonly Object: "Object";
|
|
1139
1151
|
readonly Union: "Union";
|
|
@@ -1142,16 +1154,21 @@ declare class WeaverContext {
|
|
|
1142
1154
|
readonly Scalar: "Scalar";
|
|
1143
1155
|
};
|
|
1144
1156
|
protected aliasCounters: Partial<Record<keyof typeof WeaverContext.namedTypes, number>>;
|
|
1145
|
-
|
|
1157
|
+
protected aliasMap: WeakMap<GraphQLNamedType, Set<string>>;
|
|
1158
|
+
setAlias(namedType: GraphQLNamedType, alias: string | undefined): string;
|
|
1146
1159
|
/**
|
|
1147
1160
|
* @returns -1 if a is better than b, 1 if b is better than a, 0 if they are equal
|
|
1148
1161
|
*/
|
|
1149
1162
|
protected static higherPriorityThan(a: string | undefined, b: string | undefined): number;
|
|
1150
|
-
|
|
1163
|
+
protected ensureAliasStore(namedType: GraphQLNamedType): Set<string>;
|
|
1164
|
+
protected pickAlias(namedType: GraphQLNamedType, aliases: Set<string>): string;
|
|
1165
|
+
protected reduceAliases(aliases: Iterable<string>): string | undefined;
|
|
1166
|
+
protected createFallbackAlias(namedType: GraphQLNamedType): string;
|
|
1167
|
+
static provide<T$1>(func: () => T$1, value: WeaverContext | undefined): T$1;
|
|
1151
1168
|
}
|
|
1152
1169
|
declare const initWeaverContext: () => WeaverContext;
|
|
1153
1170
|
declare const provideWeaverContext: typeof WeaverContext.provide & {
|
|
1154
|
-
inherit: <T>(func: () => T) => () => T;
|
|
1171
|
+
inherit: <T$1>(func: () => T$1) => () => T$1;
|
|
1155
1172
|
};
|
|
1156
1173
|
interface WeaverConfig {
|
|
1157
1174
|
[WEAVER_CONFIG]: string | symbol;
|
|
@@ -1163,7 +1180,7 @@ declare class GlobalWeaverContext implements Partial<Omit<WeaverContext, GlobalC
|
|
|
1163
1180
|
get id(): number | undefined;
|
|
1164
1181
|
get loomObjectMap(): Map<GraphQLObjectType<any, any>, LoomObjectType> | undefined;
|
|
1165
1182
|
get loomUnionMap(): Map<GraphQLUnionType, GraphQLUnionType> | undefined;
|
|
1166
|
-
get inputMap(): Map<GraphQLObjectType<any, any
|
|
1183
|
+
get inputMap(): Map<GraphQLInterfaceType | GraphQLObjectType<any, any>, GraphQLInputObjectType> | undefined;
|
|
1167
1184
|
get interfaceMap(): Map<GraphQLObjectType<any, any>, GraphQLInterfaceType> | undefined;
|
|
1168
1185
|
get configs(): Map<string | symbol, WeaverConfig> | undefined;
|
|
1169
1186
|
get vendorWeavers(): Map<string, SchemaWeaver> | undefined;
|
|
@@ -1174,11 +1191,11 @@ declare class GlobalWeaverContext implements Partial<Omit<WeaverContext, GlobalC
|
|
|
1174
1191
|
setConfig(config: WeaverConfig): void;
|
|
1175
1192
|
deleteConfig(key: string | symbol): void;
|
|
1176
1193
|
useConfig<TConfig extends WeaverConfig, TCallback extends () => any>(config: TConfig, callback: TCallback): ReturnType<TCallback>;
|
|
1177
|
-
getNamedType<T extends GraphQLOutputType>(name: string): T | undefined;
|
|
1194
|
+
getNamedType<T$1 extends GraphQLOutputType>(name: string): T$1 | undefined;
|
|
1178
1195
|
memoNamedType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(gqlType: TGraphQLType): TGraphQLType;
|
|
1179
1196
|
getGraphQLType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(origin: object): TGraphQLType | undefined;
|
|
1180
1197
|
memoGraphQLType<TGraphQLType extends GraphQLOutputType = GraphQLOutputType>(origin: object, gqlType: TGraphQLType): TGraphQLType;
|
|
1181
|
-
setAlias(namedType: GraphQLNamedType, alias: string | undefined): string
|
|
1198
|
+
setAlias(namedType: GraphQLNamedType, alias: string | undefined): string;
|
|
1182
1199
|
}
|
|
1183
1200
|
declare const weaverContext: GlobalWeaverContext;
|
|
1184
1201
|
/**
|
|
@@ -1194,7 +1211,7 @@ declare function collectNames<TRecords extends Record<string, object>[]>(...name
|
|
|
1194
1211
|
* @returns schema
|
|
1195
1212
|
*/
|
|
1196
1213
|
declare function collectName<TSchema extends object>(name: string, schema: TSchema): TSchema;
|
|
1197
|
-
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
1214
|
+
type UnionToIntersection<U$1> = (U$1 extends any ? (k: U$1) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
1198
1215
|
//#endregion
|
|
1199
1216
|
//#region src/schema/object.d.ts
|
|
1200
1217
|
declare class LoomObjectType extends GraphQLObjectType {
|
|
@@ -1296,4 +1313,4 @@ declare class GraphQLSchemaLoom {
|
|
|
1296
1313
|
*/
|
|
1297
1314
|
declare const weave: typeof GraphQLSchemaLoom.weave;
|
|
1298
1315
|
//#endregion
|
|
1299
|
-
export { subscription$1 as $,
|
|
1316
|
+
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 };
|