@gqloom/core 0.14.2 → 0.14.4

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.
@@ -1,4 +1,4 @@
1
- import { Bt as OnlyMemoizationPayload, St as Middleware, lt as ResolvingFields, mn as ResolverPayload, yn as BaseField } from "./index-BuNcG6Vh.cjs";
1
+ import { Ct as Middleware, Vt as OnlyMemoizationPayload, bn as BaseField, hn as ResolverPayload, ut as ResolvingFields } from "./index-BW7_Sr0t.cjs";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
 
4
4
  //#region src/context/async-iterator.d.ts
package/dist/context.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Bt as OnlyMemoizationPayload, St as Middleware, lt as ResolvingFields, mn as ResolverPayload, yn as BaseField } from "./index-DVABcenn.js";
1
+ import { Ct as Middleware, Vt as OnlyMemoizationPayload, bn as BaseField, hn as ResolverPayload, ut as ResolvingFields } from "./index-CFo2-jU-.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
 
4
4
  //#region src/context/async-iterator.d.ts
@@ -205,7 +205,7 @@ declare class FieldChainFactory<TOutput$1 extends GraphQLSilk = never, TInput$1
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$1, TInputNew, TDependencies$1>;
208
+ input<TInputNew extends GraphQLSilk<any, Record<string, any>> | 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
@@ -260,7 +260,7 @@ declare class QueryChainFactory<TOutput$1 extends GraphQLSilk = never, TInput$1
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$1, TInputNew>;
263
+ input<TInputNew extends GraphQLSilk<any, Record<string, any>> | 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
@@ -299,7 +299,7 @@ declare class MutationChainFactory<TOutput$1 extends GraphQLSilk = never, TInput
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$1, TInputNew>;
302
+ input<TInputNew extends GraphQLSilk<any, Record<string, any>> | 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
@@ -338,7 +338,7 @@ declare class SubscriptionChainFactory<TOutput$1 extends GraphQLSilk = never, TI
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$1, TInputNew>;
341
+ input<TInputNew extends GraphQLSilk<any, Record<string, any>> | 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
@@ -381,7 +381,7 @@ declare class QueryFactoryWithResolve<TInputO, TOutput$1 extends GraphQLSilk, TI
381
381
  get "~meta"(): Query<TOutput$1, TInput$1>["~meta"];
382
382
  constructor(outputSilk: TOutput$1, options: QueryOptions<TOutput$1, TInput$1>);
383
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>;
384
+ input<TInputNew extends GraphQLSilk<TInputO, Record<string, any>>>(input: TInputNew): QueryFactoryWithResolve<TInputO, TOutput$1, TInputNew>;
385
385
  output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput$1>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): QueryFactoryWithResolve<TInputO, TOutputNew, TInput$1>;
386
386
  }
387
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> {
@@ -390,7 +390,7 @@ declare class MutationFactoryWithResolve<TInputO, TOutput$1 extends GraphQLSilk,
390
390
  get "~meta"(): Mutation<TOutput$1, TInput$1>["~meta"];
391
391
  constructor(outputSilk: TOutput$1, options: MutationOptions<TOutput$1, TInput$1>);
392
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>;
393
+ input<TInputNew extends GraphQLSilk<TInputO, Record<string, any>>>(input: TInputNew): MutationFactoryWithResolve<TInputO, TOutput$1, TInputNew>;
394
394
  output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput$1>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): MutationFactoryWithResolve<TInputO, TOutputNew, TInput$1>;
395
395
  }
396
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>> {
@@ -399,7 +399,7 @@ declare class FieldFactoryWithResolve<TParent$1 extends GraphQLSilk, TOutput$1 e
399
399
  get "~meta"(): Field<TParent$1, TOutput$1, TInput$1, string[] | undefined>["~meta"];
400
400
  constructor(outputSilk: TOutput$1, options: FieldOptions<TParent$1, TOutput$1, TInput$1, string[] | undefined>);
401
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>;
402
+ input<TInputNew extends GraphQLSilk<TInputO, Record<string, any>>>(input: TInputNew): FieldFactoryWithResolve<TParent$1, TOutput$1, TInputO, TInputNew>;
403
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 {
@@ -1152,18 +1152,19 @@ declare class WeaverContext {
1152
1152
  readonly Scalar: "Scalar";
1153
1153
  };
1154
1154
  protected aliasCounters: Partial<Record<keyof typeof WeaverContext.namedTypes, number>>;
1155
- protected aliasMap: WeakMap<GraphQLNamedType, Set<string>>;
1156
- setAlias(namedType: GraphQLNamedType, alias: string | undefined): string;
1155
+ protected aliasMap: WeakMap<GraphQLNamedType, AliasList>;
1156
+ setAlias(namedType: GraphQLNamedType, fieldName: string | undefined, parent?: GraphQLNamedType): string;
1157
1157
  /**
1158
1158
  * @returns -1 if a is better than b, 1 if b is better than a, 0 if they are equal
1159
1159
  */
1160
1160
  protected static higherPriorityThan(a: string | undefined, b: string | undefined): number;
1161
- protected ensureAliasStore(namedType: GraphQLNamedType): Set<string>;
1162
- protected pickAlias(namedType: GraphQLNamedType, aliases: Set<string>): string;
1163
- protected reduceAliases(aliases: Iterable<string>): string | undefined;
1161
+ protected ensureAliasStore(namedType: GraphQLNamedType): AliasList;
1162
+ protected pickAlias(namedType: GraphQLNamedType, aliases: AliasList): string;
1163
+ protected reduceAliases(aliases: AliasList): string | undefined;
1164
1164
  protected createFallbackAlias(namedType: GraphQLNamedType): string;
1165
1165
  static provide<T>(func: () => T, value: WeaverContext | undefined): T;
1166
1166
  }
1167
+ type AliasList = (string | [fieldName: string, parent: GraphQLNamedType])[];
1167
1168
  declare const initWeaverContext: () => WeaverContext;
1168
1169
  declare const provideWeaverContext: typeof WeaverContext.provide & {
1169
1170
  inherit: <T>(func: () => T) => () => T;
@@ -1311,4 +1312,4 @@ declare class GraphQLSchemaLoom {
1311
1312
  */
1312
1313
  declare const weave: typeof GraphQLSchemaLoom.weave;
1313
1314
  //#endregion
1314
- export { subscription$1 as $, FieldOrOperationType as $t, getGraphQLType as A, ChainFactoryOptions as An, MayPromise as At, ResolverFactory as B, SubscriptionNeedResolve as Bn, OnlyMemoizationPayload as Bt, DirectiveRecord as C, Mutation as Cn, MiddlewareConfig as Ct, NonNullSilk as D, Subscription as Dn, filterMiddlewares as Dt, ListSilk as E, Resolver as En, applyMiddlewares as Et, parseSilk as F, MutationFactoryWithResolve as Fn, EasyDataLoader as Ft, createQuery as G, AUTO_ALIASING as Gt, ToExecutorProps as H, StandardSchemaV1 as Hn, getMemoizationMap as Ht, silk as I, QueryChainFactory as In, LoomDataLoader as It, field as J, getOperationOptions as Jt, createSubscription as K, DERIVED_DEPENDENCIES as Kt, ChainResolver as L, QueryFactoryWithResolve as Ln, markErrorLocation as Lt, listSilk as M, FieldFactoryWithResolve as Mn, RequireKeys as Mt, nonNullSilk as N, IChainFactory as Nn, ValueOf as Nt, NullableSilk as O, types_loom_d_exports as On, IsAny as Ot, nullableSilk as P, MutationChainFactory as Pn, BatchLoadFn as Pt, resolver as Q, FieldOptions as Qt, Executor as R, ResolvableSubscription as Rn, markLocation as Rt, DirectiveItem as S, FieldOrOperation as Sn, Middleware as St, GQLoomExtensions as T, Query as Tn, MiddlewareOptions as Tt, createField as U, isOnlyMemoryPayload as Ut, ResolverMeta as V, symbols_d_exports as Vn, assignContextMap as Vt, createMutation as W, onlyMemoization as Wt, mutation$1 as X, FieldFactory as Xt, loom as Y, getSubscriptionOptions as Yt, query$1 as Z, FieldFactoryWithUtils as Zt, isSchemaVendorWeaver as _, SubscriptionFactoryWithChain as _n, notNullish as _t, LoomObjectType as a, MutationFactoryWithChain as an, parseInputValue as at, ensureInputType as b, Field as bn, toObjMap as bt, GlobalWeaverContext as c, QueryFactory as cn, screamingSnakeCase as ct, collectName as d, ResolverOptions as dn, getDeepResolvingFields as dt, GraphQLFieldOptions as en, CallableInputParser as et, collectNames as f, ResolverOptionsWithExtensions as fn, getResolvingFields as ft, SchemaWeaver as g, SubscriptionFactory as gn, meta as gt, weaverContext as h, ResolvingOptions as hn, mapValue as ht, CoreSchemaWeaverConfigOptions as i, MutationFactory as in, getStandardValue as it, isSilk as j, FieldChainFactory as jn, OmitInUnion as jt, getGraphQLArgumentConfig as k, BaseChainFactory as kn, MayGetter as kt, WeaverConfig as l, QueryFactoryWithChain as ln, ResolvingFields as lt, provideWeaverContext as m, ResolverPayload as mn, deepMerge as mt, weave as n, InferFieldInput as nn, InferInputO as nt, OPERATION_OBJECT_NAMES as o, MutationOptions as on, capitalize as ot, initWeaverContext as p, ResolverOptionsWithParent as pn, parseResolvingFields as pt, defaultSubscriptionResolve as q, getFieldOptions as qt, CoreSchemaWeaverConfig as r, InferFieldOutput as rn, createInputParser as rt, getCacheType as s, OperationType as sn, pascalCase as st, GraphQLSchemaLoom as t, GraphQLSilk as tn, InferInputI as tt, WeaverContext as u, QueryOptions as un, ResolvingFieldsOptions as ut, ensureInterfaceType as v, SubscriptionOptions as vn, toArguments as vt, GQLoomExtensionAttribute as w, Operation as wn, MiddlewareOperation as wt, inputToArgs as x, FieldMeta as xn, CallableMiddlewareOptions as xt, ensureInputObjectType as y, BaseField as yn, toFieldMap as yt, ObjectChainResolver as z, SubscriptionChainFactory as zn, tryIn as zt };
1315
+ export { resolver as $, FieldOptions as $t, getGraphQLArgumentConfig as A, BaseChainFactory as An, MayGetter as At, ObjectChainResolver as B, SubscriptionChainFactory as Bn, tryIn as Bt, DirectiveItem as C, FieldOrOperation as Cn, Middleware as Ct, ListSilk as D, Resolver as Dn, applyMiddlewares as Dt, GQLoomExtensions as E, Query as En, MiddlewareOptions as Et, nullableSilk as F, MutationChainFactory as Fn, BatchLoadFn as Ft, createMutation as G, onlyMemoization as Gt, ResolverMeta as H, symbols_d_exports as Hn, assignContextMap as Ht, parseSilk as I, MutationFactoryWithResolve as In, EasyDataLoader as It, defaultSubscriptionResolve as J, getFieldOptions as Jt, createQuery as K, AUTO_ALIASING as Kt, silk as L, QueryChainFactory as Ln, LoomDataLoader as Lt, isSilk as M, FieldChainFactory as Mn, OmitInUnion as Mt, listSilk as N, FieldFactoryWithResolve as Nn, RequireKeys as Nt, NonNullSilk as O, Subscription as On, filterMiddlewares as Ot, nonNullSilk as P, IChainFactory as Pn, ValueOf as Pt, query$1 as Q, FieldFactoryWithUtils as Qt, ChainResolver as R, QueryFactoryWithResolve as Rn, markErrorLocation as Rt, inputToArgs as S, FieldMeta as Sn, CallableMiddlewareOptions as St, GQLoomExtensionAttribute as T, Operation as Tn, MiddlewareOperation as Tt, ToExecutorProps as U, StandardSchemaV1 as Un, getMemoizationMap as Ut, ResolverFactory as V, SubscriptionNeedResolve as Vn, OnlyMemoizationPayload as Vt, createField as W, isOnlyMemoryPayload as Wt, loom as X, getSubscriptionOptions as Xt, field as Y, getOperationOptions as Yt, mutation$1 as Z, FieldFactory as Zt, SchemaWeaver as _, SubscriptionFactory as _n, meta as _t, LoomObjectType as a, MutationFactory as an, getStandardValue as at, ensureInputObjectType as b, BaseField as bn, toFieldMap as bt, AliasList as c, OperationType as cn, pascalCase as ct, WeaverContext as d, QueryOptions as dn, ResolvingFieldsOptions as dt, FieldOrOperationType as en, subscription$1 as et, collectName as f, ResolverOptions as fn, getDeepResolvingFields as ft, weaverContext as g, ResolvingOptions as gn, mapValue as gt, provideWeaverContext as h, ResolverPayload as hn, deepMerge as ht, CoreSchemaWeaverConfigOptions as i, InferFieldOutput as in, createInputParser as it, getGraphQLType as j, ChainFactoryOptions as jn, MayPromise as jt, NullableSilk as k, types_loom_d_exports as kn, IsAny as kt, GlobalWeaverContext as l, QueryFactory as ln, screamingSnakeCase as lt, initWeaverContext as m, ResolverOptionsWithParent as mn, parseResolvingFields as mt, weave as n, GraphQLSilk as nn, InferInputI as nt, OPERATION_OBJECT_NAMES as o, MutationFactoryWithChain as on, parseInputValue as ot, collectNames as p, ResolverOptionsWithExtensions as pn, getResolvingFields as pt, createSubscription as q, DERIVED_DEPENDENCIES as qt, CoreSchemaWeaverConfig as r, InferFieldInput as rn, InferInputO as rt, getCacheType as s, MutationOptions as sn, capitalize as st, GraphQLSchemaLoom as t, GraphQLFieldOptions as tn, CallableInputParser as tt, WeaverConfig as u, QueryFactoryWithChain as un, ResolvingFields as ut, isSchemaVendorWeaver as v, SubscriptionFactoryWithChain as vn, notNullish as vt, DirectiveRecord as w, Mutation as wn, MiddlewareConfig as wt, ensureInputType as x, Field as xn, toObjMap as xt, ensureInterfaceType as y, SubscriptionOptions as yn, toArguments as yt, Executor as z, ResolvableSubscription as zn, markLocation as zt };
@@ -203,7 +203,7 @@ declare class FieldChainFactory<TOutput$1 extends GraphQLSilk = never, TInput$1
203
203
  * @template TInputNew - The new input type
204
204
  * @param input - The input type definition
205
205
  */
206
- input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): FieldChainFactory<TOutput$1, TInputNew, TDependencies$1>;
206
+ input<TInputNew extends GraphQLSilk<any, Record<string, any>> | Record<string, GraphQLSilk>>(input: TInputNew): FieldChainFactory<TOutput$1, TInputNew, TDependencies$1>;
207
207
  /**
208
208
  * Specifies the dependencies for the field
209
209
  * @template TDependencies - The dependencies type
@@ -258,7 +258,7 @@ declare class QueryChainFactory<TOutput$1 extends GraphQLSilk = never, TInput$1
258
258
  * @param input - The input type definition
259
259
  * @returns A new QueryChainFactory instance with the updated input type
260
260
  */
261
- input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): QueryChainFactory<TOutput$1, TInputNew>;
261
+ input<TInputNew extends GraphQLSilk<any, Record<string, any>> | Record<string, GraphQLSilk>>(input: TInputNew): QueryChainFactory<TOutput$1, TInputNew>;
262
262
  /**
263
263
  * Sets the resolve function for the query
264
264
  * @param resolve - The resolve function that processes the input and returns the output
@@ -297,7 +297,7 @@ declare class MutationChainFactory<TOutput$1 extends GraphQLSilk = never, TInput
297
297
  * @param input - The input type definition
298
298
  * @returns A new MutationChainFactory instance with the updated input type
299
299
  */
300
- input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): MutationChainFactory<TOutput$1, TInputNew>;
300
+ input<TInputNew extends GraphQLSilk<any, Record<string, any>> | Record<string, GraphQLSilk>>(input: TInputNew): MutationChainFactory<TOutput$1, TInputNew>;
301
301
  /**
302
302
  * Sets the resolve function for the mutation
303
303
  * @param resolve - The resolve function that processes the input and returns the output
@@ -336,7 +336,7 @@ declare class SubscriptionChainFactory<TOutput$1 extends GraphQLSilk = never, TI
336
336
  * @param input - The input type definition
337
337
  * @returns A new SubscriptionChainFactory instance with the updated input type
338
338
  */
339
- input<TInputNew extends GraphQLSilk | Record<string, GraphQLSilk>>(input: TInputNew): SubscriptionChainFactory<TOutput$1, TInputNew>;
339
+ input<TInputNew extends GraphQLSilk<any, Record<string, any>> | Record<string, GraphQLSilk>>(input: TInputNew): SubscriptionChainFactory<TOutput$1, TInputNew>;
340
340
  /**
341
341
  * Sets the subscribe function for the subscription
342
342
  * @template TValue - The value type of the subscription
@@ -379,7 +379,7 @@ declare class QueryFactoryWithResolve<TInputO, TOutput$1 extends GraphQLSilk, TI
379
379
  get "~meta"(): Query<TOutput$1, TInput$1>["~meta"];
380
380
  constructor(outputSilk: TOutput$1, options: QueryOptions<TOutput$1, TInput$1>);
381
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>;
382
+ input<TInputNew extends GraphQLSilk<TInputO, Record<string, any>>>(input: TInputNew): QueryFactoryWithResolve<TInputO, TOutput$1, TInputNew>;
383
383
  output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput$1>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): QueryFactoryWithResolve<TInputO, TOutputNew, TInput$1>;
384
384
  }
385
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> {
@@ -388,7 +388,7 @@ declare class MutationFactoryWithResolve<TInputO, TOutput$1 extends GraphQLSilk,
388
388
  get "~meta"(): Mutation<TOutput$1, TInput$1>["~meta"];
389
389
  constructor(outputSilk: TOutput$1, options: MutationOptions<TOutput$1, TInput$1>);
390
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>;
391
+ input<TInputNew extends GraphQLSilk<TInputO, Record<string, any>>>(input: TInputNew): MutationFactoryWithResolve<TInputO, TOutput$1, TInputNew>;
392
392
  output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput$1>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): MutationFactoryWithResolve<TInputO, TOutputNew, TInput$1>;
393
393
  }
394
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>> {
@@ -397,7 +397,7 @@ declare class FieldFactoryWithResolve<TParent$1 extends GraphQLSilk, TOutput$1 e
397
397
  get "~meta"(): Field<TParent$1, TOutput$1, TInput$1, string[] | undefined>["~meta"];
398
398
  constructor(outputSilk: TOutput$1, options: FieldOptions<TParent$1, TOutput$1, TInput$1, string[] | undefined>);
399
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>;
400
+ input<TInputNew extends GraphQLSilk<TInputO, Record<string, any>>>(input: TInputNew): FieldFactoryWithResolve<TParent$1, TOutput$1, TInputO, TInputNew>;
401
401
  output<TOutputNew extends GraphQLSilk>(output: TOutputNew, transform: (output: StandardSchemaV1.InferOutput<TOutput$1>) => MayPromise<StandardSchemaV1.InferOutput<TOutputNew>>): FieldFactoryWithResolve<TParent$1, TOutputNew, TInputO, TInput$1>;
402
402
  }
403
403
  declare namespace types_loom_d_exports {
@@ -1150,18 +1150,19 @@ declare class WeaverContext {
1150
1150
  readonly Scalar: "Scalar";
1151
1151
  };
1152
1152
  protected aliasCounters: Partial<Record<keyof typeof WeaverContext.namedTypes, number>>;
1153
- protected aliasMap: WeakMap<GraphQLNamedType, Set<string>>;
1154
- setAlias(namedType: GraphQLNamedType, alias: string | undefined): string;
1153
+ protected aliasMap: WeakMap<GraphQLNamedType, AliasList>;
1154
+ setAlias(namedType: GraphQLNamedType, fieldName: string | undefined, parent?: GraphQLNamedType): string;
1155
1155
  /**
1156
1156
  * @returns -1 if a is better than b, 1 if b is better than a, 0 if they are equal
1157
1157
  */
1158
1158
  protected static higherPriorityThan(a: string | undefined, b: string | undefined): number;
1159
- protected ensureAliasStore(namedType: GraphQLNamedType): Set<string>;
1160
- protected pickAlias(namedType: GraphQLNamedType, aliases: Set<string>): string;
1161
- protected reduceAliases(aliases: Iterable<string>): string | undefined;
1159
+ protected ensureAliasStore(namedType: GraphQLNamedType): AliasList;
1160
+ protected pickAlias(namedType: GraphQLNamedType, aliases: AliasList): string;
1161
+ protected reduceAliases(aliases: AliasList): string | undefined;
1162
1162
  protected createFallbackAlias(namedType: GraphQLNamedType): string;
1163
1163
  static provide<T>(func: () => T, value: WeaverContext | undefined): T;
1164
1164
  }
1165
+ type AliasList = (string | [fieldName: string, parent: GraphQLNamedType])[];
1165
1166
  declare const initWeaverContext: () => WeaverContext;
1166
1167
  declare const provideWeaverContext: typeof WeaverContext.provide & {
1167
1168
  inherit: <T>(func: () => T) => () => T;
@@ -1309,4 +1310,4 @@ declare class GraphQLSchemaLoom {
1309
1310
  */
1310
1311
  declare const weave: typeof GraphQLSchemaLoom.weave;
1311
1312
  //#endregion
1312
- export { subscription$1 as $, FieldOrOperationType as $t, getGraphQLType as A, ChainFactoryOptions as An, MayPromise as At, ResolverFactory as B, SubscriptionNeedResolve as Bn, OnlyMemoizationPayload as Bt, DirectiveRecord as C, Mutation as Cn, MiddlewareConfig as Ct, NonNullSilk as D, Subscription as Dn, filterMiddlewares as Dt, ListSilk as E, Resolver as En, applyMiddlewares as Et, parseSilk as F, MutationFactoryWithResolve as Fn, EasyDataLoader as Ft, createQuery as G, AUTO_ALIASING as Gt, ToExecutorProps as H, StandardSchemaV1 as Hn, getMemoizationMap as Ht, silk as I, QueryChainFactory as In, LoomDataLoader as It, field as J, getOperationOptions as Jt, createSubscription as K, DERIVED_DEPENDENCIES as Kt, ChainResolver as L, QueryFactoryWithResolve as Ln, markErrorLocation as Lt, listSilk as M, FieldFactoryWithResolve as Mn, RequireKeys as Mt, nonNullSilk as N, IChainFactory as Nn, ValueOf as Nt, NullableSilk as O, types_loom_d_exports as On, IsAny as Ot, nullableSilk as P, MutationChainFactory as Pn, BatchLoadFn as Pt, resolver as Q, FieldOptions as Qt, Executor as R, ResolvableSubscription as Rn, markLocation as Rt, DirectiveItem as S, FieldOrOperation as Sn, Middleware as St, GQLoomExtensions as T, Query as Tn, MiddlewareOptions as Tt, createField as U, isOnlyMemoryPayload as Ut, ResolverMeta as V, symbols_d_exports as Vn, assignContextMap as Vt, createMutation as W, onlyMemoization as Wt, mutation$1 as X, FieldFactory as Xt, loom as Y, getSubscriptionOptions as Yt, query$1 as Z, FieldFactoryWithUtils as Zt, isSchemaVendorWeaver as _, SubscriptionFactoryWithChain as _n, notNullish as _t, LoomObjectType as a, MutationFactoryWithChain as an, parseInputValue as at, ensureInputType as b, Field as bn, toObjMap as bt, GlobalWeaverContext as c, QueryFactory as cn, screamingSnakeCase as ct, collectName as d, ResolverOptions as dn, getDeepResolvingFields as dt, GraphQLFieldOptions as en, CallableInputParser as et, collectNames as f, ResolverOptionsWithExtensions as fn, getResolvingFields as ft, SchemaWeaver as g, SubscriptionFactory as gn, meta as gt, weaverContext as h, ResolvingOptions as hn, mapValue as ht, CoreSchemaWeaverConfigOptions as i, MutationFactory as in, getStandardValue as it, isSilk as j, FieldChainFactory as jn, OmitInUnion as jt, getGraphQLArgumentConfig as k, BaseChainFactory as kn, MayGetter as kt, WeaverConfig as l, QueryFactoryWithChain as ln, ResolvingFields as lt, provideWeaverContext as m, ResolverPayload as mn, deepMerge as mt, weave as n, InferFieldInput as nn, InferInputO as nt, OPERATION_OBJECT_NAMES as o, MutationOptions as on, capitalize as ot, initWeaverContext as p, ResolverOptionsWithParent as pn, parseResolvingFields as pt, defaultSubscriptionResolve as q, getFieldOptions as qt, CoreSchemaWeaverConfig as r, InferFieldOutput as rn, createInputParser as rt, getCacheType as s, OperationType as sn, pascalCase as st, GraphQLSchemaLoom as t, GraphQLSilk as tn, InferInputI as tt, WeaverContext as u, QueryOptions as un, ResolvingFieldsOptions as ut, ensureInterfaceType as v, SubscriptionOptions as vn, toArguments as vt, GQLoomExtensionAttribute as w, Operation as wn, MiddlewareOperation as wt, inputToArgs as x, FieldMeta as xn, CallableMiddlewareOptions as xt, ensureInputObjectType as y, BaseField as yn, toFieldMap as yt, ObjectChainResolver as z, SubscriptionChainFactory as zn, tryIn as zt };
1313
+ export { resolver as $, FieldOptions as $t, getGraphQLArgumentConfig as A, BaseChainFactory as An, MayGetter as At, ObjectChainResolver as B, SubscriptionChainFactory as Bn, tryIn as Bt, DirectiveItem as C, FieldOrOperation as Cn, Middleware as Ct, ListSilk as D, Resolver as Dn, applyMiddlewares as Dt, GQLoomExtensions as E, Query as En, MiddlewareOptions as Et, nullableSilk as F, MutationChainFactory as Fn, BatchLoadFn as Ft, createMutation as G, onlyMemoization as Gt, ResolverMeta as H, symbols_d_exports as Hn, assignContextMap as Ht, parseSilk as I, MutationFactoryWithResolve as In, EasyDataLoader as It, defaultSubscriptionResolve as J, getFieldOptions as Jt, createQuery as K, AUTO_ALIASING as Kt, silk as L, QueryChainFactory as Ln, LoomDataLoader as Lt, isSilk as M, FieldChainFactory as Mn, OmitInUnion as Mt, listSilk as N, FieldFactoryWithResolve as Nn, RequireKeys as Nt, NonNullSilk as O, Subscription as On, filterMiddlewares as Ot, nonNullSilk as P, IChainFactory as Pn, ValueOf as Pt, query$1 as Q, FieldFactoryWithUtils as Qt, ChainResolver as R, QueryFactoryWithResolve as Rn, markErrorLocation as Rt, inputToArgs as S, FieldMeta as Sn, CallableMiddlewareOptions as St, GQLoomExtensionAttribute as T, Operation as Tn, MiddlewareOperation as Tt, ToExecutorProps as U, StandardSchemaV1 as Un, getMemoizationMap as Ut, ResolverFactory as V, SubscriptionNeedResolve as Vn, OnlyMemoizationPayload as Vt, createField as W, isOnlyMemoryPayload as Wt, loom as X, getSubscriptionOptions as Xt, field as Y, getOperationOptions as Yt, mutation$1 as Z, FieldFactory as Zt, SchemaWeaver as _, SubscriptionFactory as _n, meta as _t, LoomObjectType as a, MutationFactory as an, getStandardValue as at, ensureInputObjectType as b, BaseField as bn, toFieldMap as bt, AliasList as c, OperationType as cn, pascalCase as ct, WeaverContext as d, QueryOptions as dn, ResolvingFieldsOptions as dt, FieldOrOperationType as en, subscription$1 as et, collectName as f, ResolverOptions as fn, getDeepResolvingFields as ft, weaverContext as g, ResolvingOptions as gn, mapValue as gt, provideWeaverContext as h, ResolverPayload as hn, deepMerge as ht, CoreSchemaWeaverConfigOptions as i, InferFieldOutput as in, createInputParser as it, getGraphQLType as j, ChainFactoryOptions as jn, MayPromise as jt, NullableSilk as k, types_loom_d_exports as kn, IsAny as kt, GlobalWeaverContext as l, QueryFactory as ln, screamingSnakeCase as lt, initWeaverContext as m, ResolverOptionsWithParent as mn, parseResolvingFields as mt, weave as n, GraphQLSilk as nn, InferInputI as nt, OPERATION_OBJECT_NAMES as o, MutationFactoryWithChain as on, parseInputValue as ot, collectNames as p, ResolverOptionsWithExtensions as pn, getResolvingFields as pt, createSubscription as q, DERIVED_DEPENDENCIES as qt, CoreSchemaWeaverConfig as r, InferFieldInput as rn, InferInputO as rt, getCacheType as s, MutationOptions as sn, capitalize as st, GraphQLSchemaLoom as t, GraphQLFieldOptions as tn, CallableInputParser as tt, WeaverConfig as u, QueryFactoryWithChain as un, ResolvingFields as ut, isSchemaVendorWeaver as v, SubscriptionFactoryWithChain as vn, notNullish as vt, DirectiveRecord as w, Mutation as wn, MiddlewareConfig as wt, ensureInputType as x, Field as xn, toObjMap as xt, ensureInterfaceType as y, SubscriptionOptions as yn, toArguments as yt, Executor as z, ResolvableSubscription as zn, markLocation as zt };
package/dist/index.cjs CHANGED
@@ -55,11 +55,11 @@ var WeaverContext = class WeaverContext {
55
55
  };
56
56
  aliasCounters = {};
57
57
  aliasMap = /* @__PURE__ */ new WeakMap();
58
- setAlias(namedType, alias) {
58
+ setAlias(namedType, fieldName, parent) {
59
59
  if (namedType.name === require_parse_resolving_fields.AUTO_ALIASING) WeaverContext.autoAliasTypes.add(namedType);
60
60
  if (!WeaverContext.autoAliasTypes.has(namedType)) return namedType.name;
61
61
  const aliases = this.ensureAliasStore(namedType);
62
- if (alias) aliases.add(alias);
62
+ if (fieldName) parent ? aliases.push([fieldName, parent]) : aliases.push(fieldName);
63
63
  return this.pickAlias(namedType, aliases);
64
64
  }
65
65
  /**
@@ -77,12 +77,12 @@ var WeaverContext = class WeaverContext {
77
77
  ensureAliasStore(namedType) {
78
78
  const existing = this.aliasMap.get(namedType);
79
79
  if (existing) return existing;
80
- const aliases = /* @__PURE__ */ new Set();
80
+ const aliases = [];
81
81
  this.aliasMap.set(namedType, aliases);
82
82
  Object.defineProperty(namedType, "name", {
83
83
  get: () => this.pickAlias(namedType, aliases),
84
84
  set: (value) => {
85
- aliases.add(value);
85
+ aliases.push(value);
86
86
  },
87
87
  enumerable: true,
88
88
  configurable: true
@@ -93,12 +93,19 @@ var WeaverContext = class WeaverContext {
93
93
  const best = this.reduceAliases(aliases);
94
94
  if (best && best !== require_parse_resolving_fields.AUTO_ALIASING) return best;
95
95
  const fallback = this.createFallbackAlias(namedType);
96
- aliases.add(fallback);
96
+ aliases.push(fallback);
97
97
  return this.reduceAliases(aliases) ?? fallback;
98
98
  }
99
99
  reduceAliases(aliases) {
100
+ const stringAliases = aliases.filter((alias) => typeof alias === "string");
101
+ const tupleAliases = aliases.filter((alias) => Array.isArray(alias));
100
102
  let best;
101
- for (const alias of aliases) if (best === void 0 || WeaverContext.higherPriorityThan(alias, best) < 0) best = alias;
103
+ for (const alias of stringAliases) if (best === void 0 || WeaverContext.higherPriorityThan(alias, best) < 0) best = alias;
104
+ if (typeof best === "string") return best;
105
+ for (const [fieldName, parent] of tupleAliases) {
106
+ const alias = parent.name + fieldName;
107
+ if (best === void 0 || WeaverContext.higherPriorityThan(alias, best) < 0) best = alias;
108
+ }
102
109
  return best;
103
110
  }
104
111
  createFallbackAlias(namedType) {
@@ -1485,7 +1492,7 @@ var LoomObjectType = class extends graphql.GraphQLObjectType {
1485
1492
  return {
1486
1493
  ...extract(field$1),
1487
1494
  type: outputType,
1488
- args: inputToArgs(field$1["~meta"].input, { fieldName: parentName(this.name) + fieldName }),
1495
+ args: inputToArgs(field$1["~meta"].input, { fieldName }),
1489
1496
  resolve,
1490
1497
  ...subscribe ? { subscribe } : {}
1491
1498
  };
@@ -1609,27 +1616,25 @@ const OPERATION_OBJECT_NAMES = new Set([
1609
1616
  ]);
1610
1617
  function getCacheType(gqlType, options = {}) {
1611
1618
  const context = options.weaverContext ?? weaverContext;
1612
- const getAlias = () => {
1613
- if (!options.fieldName || !options.parent) return;
1614
- return parentName(options.parent.name) + pascalCase(options.fieldName);
1615
- };
1616
1619
  if (gqlType instanceof LoomObjectType) return gqlType;
1620
+ const parent = excludeOperationObject(options.parent);
1621
+ const fieldName = options.fieldName ? pascalCase(options.fieldName) : void 0;
1617
1622
  if ((0, graphql.isObjectType)(gqlType)) {
1618
1623
  const gqlObject = context.loomObjectMap?.get(gqlType);
1619
1624
  if (gqlObject != null) {
1620
- context.setAlias(gqlObject, getAlias());
1625
+ context.setAlias(gqlObject, fieldName, parent);
1621
1626
  return gqlObject;
1622
1627
  }
1623
1628
  const loomObject = new LoomObjectType(gqlType, options);
1624
1629
  context.loomObjectMap?.set(gqlType, loomObject);
1625
- context.setAlias(loomObject, getAlias());
1630
+ context.setAlias(loomObject, fieldName, parent);
1626
1631
  return loomObject;
1627
1632
  } else if ((0, graphql.isListType)(gqlType)) return new graphql.GraphQLList(getCacheType(gqlType.ofType, options));
1628
1633
  else if ((0, graphql.isNonNullType)(gqlType)) return new graphql.GraphQLNonNull(getCacheType(gqlType.ofType, options));
1629
1634
  else if ((0, graphql.isUnionType)(gqlType)) {
1630
1635
  const existing = context.loomUnionMap?.get(gqlType);
1631
1636
  if (existing != null) {
1632
- context.setAlias(existing, getAlias());
1637
+ context.setAlias(existing, fieldName, parent);
1633
1638
  return existing;
1634
1639
  }
1635
1640
  const config = gqlType.toConfig();
@@ -1641,17 +1646,18 @@ function getCacheType(gqlType, options = {}) {
1641
1646
  }))
1642
1647
  });
1643
1648
  context.loomUnionMap?.set(gqlType, unionType);
1644
- context.setAlias(unionType, getAlias());
1649
+ context.setAlias(unionType, fieldName, parent);
1645
1650
  return unionType;
1646
1651
  } else if ((0, graphql.isEnumType)(gqlType) || (0, graphql.isInterfaceType)(gqlType) || (0, graphql.isScalarType)(gqlType)) {
1647
- context.setAlias(gqlType, getAlias());
1652
+ context.setAlias(gqlType, fieldName, parent);
1648
1653
  return gqlType;
1649
1654
  }
1650
1655
  return gqlType;
1651
1656
  }
1652
- function parentName(name) {
1653
- if (OPERATION_OBJECT_NAMES.has(name)) name = "";
1654
- return name;
1657
+ function excludeOperationObject(object) {
1658
+ if (object == null) return void 0;
1659
+ if (OPERATION_OBJECT_NAMES.has(object.name)) return void 0;
1660
+ return object;
1655
1661
  }
1656
1662
 
1657
1663
  //#endregion
package/dist/index.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as subscription, $t as FieldOrOperationType, A as getGraphQLType, An as ChainFactoryOptions, At as MayPromise, B as ResolverFactory, Bn as SubscriptionNeedResolve, Bt as OnlyMemoizationPayload, C as DirectiveRecord, Cn as Mutation, Ct as MiddlewareConfig, D as NonNullSilk, Dn as Subscription, Dt as filterMiddlewares, E as ListSilk, En as Resolver, Et as applyMiddlewares, F as parseSilk, Fn as MutationFactoryWithResolve, Ft as EasyDataLoader, G as createQuery, Gt as AUTO_ALIASING, H as ToExecutorProps, Hn as StandardSchemaV1, Ht as getMemoizationMap, I as silk, In as QueryChainFactory, It as LoomDataLoader, J as field, Jt as getOperationOptions, K as createSubscription, Kt as DERIVED_DEPENDENCIES, L as ChainResolver, Ln as QueryFactoryWithResolve, Lt as markErrorLocation, M as listSilk, Mn as FieldFactoryWithResolve, Mt as RequireKeys, N as nonNullSilk, Nn as IChainFactory, Nt as ValueOf, O as NullableSilk, On as types_loom_d_exports, Ot as IsAny, P as nullableSilk, Pn as MutationChainFactory, Pt as BatchLoadFn, Q as resolver, Qt as FieldOptions, R as Executor, Rn as ResolvableSubscription, Rt as markLocation, S as DirectiveItem, Sn as FieldOrOperation, St as Middleware, T as GQLoomExtensions, Tn as Query, Tt as MiddlewareOptions, U as createField, Ut as isOnlyMemoryPayload, V as ResolverMeta, Vn as symbols_d_exports, Vt as assignContextMap, W as createMutation, Wt as onlyMemoization, X as mutation, Xt as FieldFactory, Y as loom, Yt as getSubscriptionOptions, Z as query, Zt as FieldFactoryWithUtils, _ as isSchemaVendorWeaver, _n as SubscriptionFactoryWithChain, _t as notNullish, a as LoomObjectType, an as MutationFactoryWithChain, at as parseInputValue, b as ensureInputType, bn as Field, bt as toObjMap, c as GlobalWeaverContext, cn as QueryFactory, ct as screamingSnakeCase, d as collectName, dn as ResolverOptions, dt as getDeepResolvingFields, en as GraphQLFieldOptions, et as CallableInputParser, f as collectNames, fn as ResolverOptionsWithExtensions, ft as getResolvingFields, g as SchemaWeaver, gn as SubscriptionFactory, gt as meta, h as weaverContext, hn as ResolvingOptions, ht as mapValue, i as CoreSchemaWeaverConfigOptions, in as MutationFactory, it as getStandardValue, j as isSilk, jn as FieldChainFactory, jt as OmitInUnion, k as getGraphQLArgumentConfig, kn as BaseChainFactory, kt as MayGetter, l as WeaverConfig, ln as QueryFactoryWithChain, lt as ResolvingFields, m as provideWeaverContext, mn as ResolverPayload, mt as deepMerge, n as weave, nn as InferFieldInput, nt as InferInputO, o as OPERATION_OBJECT_NAMES, on as MutationOptions, ot as capitalize, p as initWeaverContext, pn as ResolverOptionsWithParent, pt as parseResolvingFields, q as defaultSubscriptionResolve, qt as getFieldOptions, r as CoreSchemaWeaverConfig, rn as InferFieldOutput, rt as createInputParser, s as getCacheType, sn as OperationType, st as pascalCase, t as GraphQLSchemaLoom, tn as GraphQLSilk, tt as InferInputI, u as WeaverContext, un as QueryOptions, ut as ResolvingFieldsOptions, v as ensureInterfaceType, vn as SubscriptionOptions, vt as toArguments, w as GQLoomExtensionAttribute, wn as Operation, wt as MiddlewareOperation, x as inputToArgs, xn as FieldMeta, xt as CallableMiddlewareOptions, y as ensureInputObjectType, yn as BaseField, yt as toFieldMap, z as ObjectChainResolver, zn as SubscriptionChainFactory, zt as tryIn } from "./index-BuNcG6Vh.cjs";
2
- export { AUTO_ALIASING, BaseChainFactory, BaseField, BatchLoadFn, CallableInputParser, CallableMiddlewareOptions, ChainFactoryOptions, ChainResolver, CoreSchemaWeaverConfig, CoreSchemaWeaverConfigOptions, DERIVED_DEPENDENCIES, DirectiveItem, DirectiveRecord, EasyDataLoader, Executor, Field, FieldChainFactory, FieldFactory, FieldFactoryWithResolve, FieldFactoryWithUtils, FieldMeta, FieldOptions, FieldOrOperation, FieldOrOperationType, GQLoomExtensionAttribute, GQLoomExtensions, GlobalWeaverContext, GraphQLFieldOptions, GraphQLSchemaLoom, GraphQLSilk, IChainFactory, InferFieldInput, InferFieldOutput, InferInputI, InferInputO, IsAny, ListSilk, types_loom_d_exports as Loom, LoomDataLoader, LoomObjectType, MayGetter, MayPromise, Middleware, MiddlewareConfig, MiddlewareOperation, MiddlewareOptions, Mutation, MutationChainFactory, MutationFactory, MutationFactoryWithChain, MutationFactoryWithResolve, MutationOptions, NonNullSilk, NullableSilk, OPERATION_OBJECT_NAMES, ObjectChainResolver, OmitInUnion, OnlyMemoizationPayload, Operation, OperationType, Query, QueryChainFactory, QueryFactory, QueryFactoryWithChain, QueryFactoryWithResolve, QueryOptions, RequireKeys, ResolvableSubscription, Resolver, ResolverFactory, ResolverMeta, ResolverOptions, ResolverOptionsWithExtensions, ResolverOptionsWithParent, ResolverPayload, ResolvingFields, ResolvingFieldsOptions, ResolvingOptions, symbols_d_exports as SYMBOLS, SchemaWeaver, StandardSchemaV1, Subscription, SubscriptionChainFactory, SubscriptionFactory, SubscriptionFactoryWithChain, SubscriptionNeedResolve, SubscriptionOptions, ToExecutorProps, ValueOf, WeaverConfig, WeaverContext, applyMiddlewares, assignContextMap, capitalize, collectName, collectNames, createField, createInputParser, createMutation, createQuery, createSubscription, deepMerge, defaultSubscriptionResolve, ensureInputObjectType, ensureInputType, ensureInterfaceType, field, filterMiddlewares, getCacheType, getDeepResolvingFields, getFieldOptions, getGraphQLArgumentConfig, getGraphQLType, getMemoizationMap, getOperationOptions, getResolvingFields, getStandardValue, getSubscriptionOptions, initWeaverContext, inputToArgs, isOnlyMemoryPayload, isSchemaVendorWeaver, isSilk, listSilk, loom, mapValue, markErrorLocation, markLocation, meta, mutation, nonNullSilk, notNullish, nullableSilk, onlyMemoization, parseInputValue, parseResolvingFields, parseSilk, pascalCase, provideWeaverContext, query, resolver, screamingSnakeCase, silk, subscription, toArguments, toFieldMap, toObjMap, tryIn, weave, weaverContext };
1
+ import { $ as resolver, $t as FieldOptions, A as getGraphQLArgumentConfig, An as BaseChainFactory, At as MayGetter, B as ObjectChainResolver, Bn as SubscriptionChainFactory, Bt as tryIn, C as DirectiveItem, Cn as FieldOrOperation, Ct as Middleware, D as ListSilk, Dn as Resolver, Dt as applyMiddlewares, E as GQLoomExtensions, En as Query, Et as MiddlewareOptions, F as nullableSilk, Fn as MutationChainFactory, Ft as BatchLoadFn, G as createMutation, Gt as onlyMemoization, H as ResolverMeta, Hn as symbols_d_exports, Ht as assignContextMap, I as parseSilk, In as MutationFactoryWithResolve, It as EasyDataLoader, J as defaultSubscriptionResolve, Jt as getFieldOptions, K as createQuery, Kt as AUTO_ALIASING, L as silk, Ln as QueryChainFactory, Lt as LoomDataLoader, M as isSilk, Mn as FieldChainFactory, Mt as OmitInUnion, N as listSilk, Nn as FieldFactoryWithResolve, Nt as RequireKeys, O as NonNullSilk, On as Subscription, Ot as filterMiddlewares, P as nonNullSilk, Pn as IChainFactory, Pt as ValueOf, Q as query, Qt as FieldFactoryWithUtils, R as ChainResolver, Rn as QueryFactoryWithResolve, Rt as markErrorLocation, S as inputToArgs, Sn as FieldMeta, St as CallableMiddlewareOptions, T as GQLoomExtensionAttribute, Tn as Operation, Tt as MiddlewareOperation, U as ToExecutorProps, Un as StandardSchemaV1, Ut as getMemoizationMap, V as ResolverFactory, Vn as SubscriptionNeedResolve, Vt as OnlyMemoizationPayload, W as createField, Wt as isOnlyMemoryPayload, X as loom, Xt as getSubscriptionOptions, Y as field, Yt as getOperationOptions, Z as mutation, Zt as FieldFactory, _ as SchemaWeaver, _n as SubscriptionFactory, _t as meta, a as LoomObjectType, an as MutationFactory, at as getStandardValue, b as ensureInputObjectType, bn as BaseField, bt as toFieldMap, c as AliasList, cn as OperationType, ct as pascalCase, d as WeaverContext, dn as QueryOptions, dt as ResolvingFieldsOptions, en as FieldOrOperationType, et as subscription, f as collectName, fn as ResolverOptions, ft as getDeepResolvingFields, g as weaverContext, gn as ResolvingOptions, gt as mapValue, h as provideWeaverContext, hn as ResolverPayload, ht as deepMerge, i as CoreSchemaWeaverConfigOptions, in as InferFieldOutput, it as createInputParser, j as getGraphQLType, jn as ChainFactoryOptions, jt as MayPromise, k as NullableSilk, kn as types_loom_d_exports, kt as IsAny, l as GlobalWeaverContext, ln as QueryFactory, lt as screamingSnakeCase, m as initWeaverContext, mn as ResolverOptionsWithParent, mt as parseResolvingFields, n as weave, nn as GraphQLSilk, nt as InferInputI, o as OPERATION_OBJECT_NAMES, on as MutationFactoryWithChain, ot as parseInputValue, p as collectNames, pn as ResolverOptionsWithExtensions, pt as getResolvingFields, q as createSubscription, qt as DERIVED_DEPENDENCIES, r as CoreSchemaWeaverConfig, rn as InferFieldInput, rt as InferInputO, s as getCacheType, sn as MutationOptions, st as capitalize, t as GraphQLSchemaLoom, tn as GraphQLFieldOptions, tt as CallableInputParser, u as WeaverConfig, un as QueryFactoryWithChain, ut as ResolvingFields, v as isSchemaVendorWeaver, vn as SubscriptionFactoryWithChain, vt as notNullish, w as DirectiveRecord, wn as Mutation, wt as MiddlewareConfig, x as ensureInputType, xn as Field, xt as toObjMap, y as ensureInterfaceType, yn as SubscriptionOptions, yt as toArguments, z as Executor, zn as ResolvableSubscription, zt as markLocation } from "./index-BW7_Sr0t.cjs";
2
+ export { AUTO_ALIASING, AliasList, BaseChainFactory, BaseField, BatchLoadFn, CallableInputParser, CallableMiddlewareOptions, ChainFactoryOptions, ChainResolver, CoreSchemaWeaverConfig, CoreSchemaWeaverConfigOptions, DERIVED_DEPENDENCIES, DirectiveItem, DirectiveRecord, EasyDataLoader, Executor, Field, FieldChainFactory, FieldFactory, FieldFactoryWithResolve, FieldFactoryWithUtils, FieldMeta, FieldOptions, FieldOrOperation, FieldOrOperationType, GQLoomExtensionAttribute, GQLoomExtensions, GlobalWeaverContext, GraphQLFieldOptions, GraphQLSchemaLoom, GraphQLSilk, IChainFactory, InferFieldInput, InferFieldOutput, InferInputI, InferInputO, IsAny, ListSilk, types_loom_d_exports as Loom, LoomDataLoader, LoomObjectType, MayGetter, MayPromise, Middleware, MiddlewareConfig, MiddlewareOperation, MiddlewareOptions, Mutation, MutationChainFactory, MutationFactory, MutationFactoryWithChain, MutationFactoryWithResolve, MutationOptions, NonNullSilk, NullableSilk, OPERATION_OBJECT_NAMES, ObjectChainResolver, OmitInUnion, OnlyMemoizationPayload, Operation, OperationType, Query, QueryChainFactory, QueryFactory, QueryFactoryWithChain, QueryFactoryWithResolve, QueryOptions, RequireKeys, ResolvableSubscription, Resolver, ResolverFactory, ResolverMeta, ResolverOptions, ResolverOptionsWithExtensions, ResolverOptionsWithParent, ResolverPayload, ResolvingFields, ResolvingFieldsOptions, ResolvingOptions, symbols_d_exports as SYMBOLS, SchemaWeaver, StandardSchemaV1, Subscription, SubscriptionChainFactory, SubscriptionFactory, SubscriptionFactoryWithChain, SubscriptionNeedResolve, SubscriptionOptions, ToExecutorProps, ValueOf, WeaverConfig, WeaverContext, applyMiddlewares, assignContextMap, capitalize, collectName, collectNames, createField, createInputParser, createMutation, createQuery, createSubscription, deepMerge, defaultSubscriptionResolve, ensureInputObjectType, ensureInputType, ensureInterfaceType, field, filterMiddlewares, getCacheType, getDeepResolvingFields, getFieldOptions, getGraphQLArgumentConfig, getGraphQLType, getMemoizationMap, getOperationOptions, getResolvingFields, getStandardValue, getSubscriptionOptions, initWeaverContext, inputToArgs, isOnlyMemoryPayload, isSchemaVendorWeaver, isSilk, listSilk, loom, mapValue, markErrorLocation, markLocation, meta, mutation, nonNullSilk, notNullish, nullableSilk, onlyMemoization, parseInputValue, parseResolvingFields, parseSilk, pascalCase, provideWeaverContext, query, resolver, screamingSnakeCase, silk, subscription, toArguments, toFieldMap, toObjMap, tryIn, weave, weaverContext };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as subscription, $t as FieldOrOperationType, A as getGraphQLType, An as ChainFactoryOptions, At as MayPromise, B as ResolverFactory, Bn as SubscriptionNeedResolve, Bt as OnlyMemoizationPayload, C as DirectiveRecord, Cn as Mutation, Ct as MiddlewareConfig, D as NonNullSilk, Dn as Subscription, Dt as filterMiddlewares, E as ListSilk, En as Resolver, Et as applyMiddlewares, F as parseSilk, Fn as MutationFactoryWithResolve, Ft as EasyDataLoader, G as createQuery, Gt as AUTO_ALIASING, H as ToExecutorProps, Hn as StandardSchemaV1, Ht as getMemoizationMap, I as silk, In as QueryChainFactory, It as LoomDataLoader, J as field, Jt as getOperationOptions, K as createSubscription, Kt as DERIVED_DEPENDENCIES, L as ChainResolver, Ln as QueryFactoryWithResolve, Lt as markErrorLocation, M as listSilk, Mn as FieldFactoryWithResolve, Mt as RequireKeys, N as nonNullSilk, Nn as IChainFactory, Nt as ValueOf, O as NullableSilk, On as types_loom_d_exports, Ot as IsAny, P as nullableSilk, Pn as MutationChainFactory, Pt as BatchLoadFn, Q as resolver, Qt as FieldOptions, R as Executor, Rn as ResolvableSubscription, Rt as markLocation, S as DirectiveItem, Sn as FieldOrOperation, St as Middleware, T as GQLoomExtensions, Tn as Query, Tt as MiddlewareOptions, U as createField, Ut as isOnlyMemoryPayload, V as ResolverMeta, Vn as symbols_d_exports, Vt as assignContextMap, W as createMutation, Wt as onlyMemoization, X as mutation, Xt as FieldFactory, Y as loom, Yt as getSubscriptionOptions, Z as query, Zt as FieldFactoryWithUtils, _ as isSchemaVendorWeaver, _n as SubscriptionFactoryWithChain, _t as notNullish, a as LoomObjectType, an as MutationFactoryWithChain, at as parseInputValue, b as ensureInputType, bn as Field, bt as toObjMap, c as GlobalWeaverContext, cn as QueryFactory, ct as screamingSnakeCase, d as collectName, dn as ResolverOptions, dt as getDeepResolvingFields, en as GraphQLFieldOptions, et as CallableInputParser, f as collectNames, fn as ResolverOptionsWithExtensions, ft as getResolvingFields, g as SchemaWeaver, gn as SubscriptionFactory, gt as meta, h as weaverContext, hn as ResolvingOptions, ht as mapValue, i as CoreSchemaWeaverConfigOptions, in as MutationFactory, it as getStandardValue, j as isSilk, jn as FieldChainFactory, jt as OmitInUnion, k as getGraphQLArgumentConfig, kn as BaseChainFactory, kt as MayGetter, l as WeaverConfig, ln as QueryFactoryWithChain, lt as ResolvingFields, m as provideWeaverContext, mn as ResolverPayload, mt as deepMerge, n as weave, nn as InferFieldInput, nt as InferInputO, o as OPERATION_OBJECT_NAMES, on as MutationOptions, ot as capitalize, p as initWeaverContext, pn as ResolverOptionsWithParent, pt as parseResolvingFields, q as defaultSubscriptionResolve, qt as getFieldOptions, r as CoreSchemaWeaverConfig, rn as InferFieldOutput, rt as createInputParser, s as getCacheType, sn as OperationType, st as pascalCase, t as GraphQLSchemaLoom, tn as GraphQLSilk, tt as InferInputI, u as WeaverContext, un as QueryOptions, ut as ResolvingFieldsOptions, v as ensureInterfaceType, vn as SubscriptionOptions, vt as toArguments, w as GQLoomExtensionAttribute, wn as Operation, wt as MiddlewareOperation, x as inputToArgs, xn as FieldMeta, xt as CallableMiddlewareOptions, y as ensureInputObjectType, yn as BaseField, yt as toFieldMap, z as ObjectChainResolver, zn as SubscriptionChainFactory, zt as tryIn } from "./index-DVABcenn.js";
2
- export { AUTO_ALIASING, BaseChainFactory, BaseField, BatchLoadFn, CallableInputParser, CallableMiddlewareOptions, ChainFactoryOptions, ChainResolver, CoreSchemaWeaverConfig, CoreSchemaWeaverConfigOptions, DERIVED_DEPENDENCIES, DirectiveItem, DirectiveRecord, EasyDataLoader, Executor, Field, FieldChainFactory, FieldFactory, FieldFactoryWithResolve, FieldFactoryWithUtils, FieldMeta, FieldOptions, FieldOrOperation, FieldOrOperationType, GQLoomExtensionAttribute, GQLoomExtensions, GlobalWeaverContext, GraphQLFieldOptions, GraphQLSchemaLoom, GraphQLSilk, IChainFactory, InferFieldInput, InferFieldOutput, InferInputI, InferInputO, IsAny, ListSilk, types_loom_d_exports as Loom, LoomDataLoader, LoomObjectType, MayGetter, MayPromise, Middleware, MiddlewareConfig, MiddlewareOperation, MiddlewareOptions, Mutation, MutationChainFactory, MutationFactory, MutationFactoryWithChain, MutationFactoryWithResolve, MutationOptions, NonNullSilk, NullableSilk, OPERATION_OBJECT_NAMES, ObjectChainResolver, OmitInUnion, OnlyMemoizationPayload, Operation, OperationType, Query, QueryChainFactory, QueryFactory, QueryFactoryWithChain, QueryFactoryWithResolve, QueryOptions, RequireKeys, ResolvableSubscription, Resolver, ResolverFactory, ResolverMeta, ResolverOptions, ResolverOptionsWithExtensions, ResolverOptionsWithParent, ResolverPayload, ResolvingFields, ResolvingFieldsOptions, ResolvingOptions, symbols_d_exports as SYMBOLS, SchemaWeaver, StandardSchemaV1, Subscription, SubscriptionChainFactory, SubscriptionFactory, SubscriptionFactoryWithChain, SubscriptionNeedResolve, SubscriptionOptions, ToExecutorProps, ValueOf, WeaverConfig, WeaverContext, applyMiddlewares, assignContextMap, capitalize, collectName, collectNames, createField, createInputParser, createMutation, createQuery, createSubscription, deepMerge, defaultSubscriptionResolve, ensureInputObjectType, ensureInputType, ensureInterfaceType, field, filterMiddlewares, getCacheType, getDeepResolvingFields, getFieldOptions, getGraphQLArgumentConfig, getGraphQLType, getMemoizationMap, getOperationOptions, getResolvingFields, getStandardValue, getSubscriptionOptions, initWeaverContext, inputToArgs, isOnlyMemoryPayload, isSchemaVendorWeaver, isSilk, listSilk, loom, mapValue, markErrorLocation, markLocation, meta, mutation, nonNullSilk, notNullish, nullableSilk, onlyMemoization, parseInputValue, parseResolvingFields, parseSilk, pascalCase, provideWeaverContext, query, resolver, screamingSnakeCase, silk, subscription, toArguments, toFieldMap, toObjMap, tryIn, weave, weaverContext };
1
+ import { $ as resolver, $t as FieldOptions, A as getGraphQLArgumentConfig, An as BaseChainFactory, At as MayGetter, B as ObjectChainResolver, Bn as SubscriptionChainFactory, Bt as tryIn, C as DirectiveItem, Cn as FieldOrOperation, Ct as Middleware, D as ListSilk, Dn as Resolver, Dt as applyMiddlewares, E as GQLoomExtensions, En as Query, Et as MiddlewareOptions, F as nullableSilk, Fn as MutationChainFactory, Ft as BatchLoadFn, G as createMutation, Gt as onlyMemoization, H as ResolverMeta, Hn as symbols_d_exports, Ht as assignContextMap, I as parseSilk, In as MutationFactoryWithResolve, It as EasyDataLoader, J as defaultSubscriptionResolve, Jt as getFieldOptions, K as createQuery, Kt as AUTO_ALIASING, L as silk, Ln as QueryChainFactory, Lt as LoomDataLoader, M as isSilk, Mn as FieldChainFactory, Mt as OmitInUnion, N as listSilk, Nn as FieldFactoryWithResolve, Nt as RequireKeys, O as NonNullSilk, On as Subscription, Ot as filterMiddlewares, P as nonNullSilk, Pn as IChainFactory, Pt as ValueOf, Q as query, Qt as FieldFactoryWithUtils, R as ChainResolver, Rn as QueryFactoryWithResolve, Rt as markErrorLocation, S as inputToArgs, Sn as FieldMeta, St as CallableMiddlewareOptions, T as GQLoomExtensionAttribute, Tn as Operation, Tt as MiddlewareOperation, U as ToExecutorProps, Un as StandardSchemaV1, Ut as getMemoizationMap, V as ResolverFactory, Vn as SubscriptionNeedResolve, Vt as OnlyMemoizationPayload, W as createField, Wt as isOnlyMemoryPayload, X as loom, Xt as getSubscriptionOptions, Y as field, Yt as getOperationOptions, Z as mutation, Zt as FieldFactory, _ as SchemaWeaver, _n as SubscriptionFactory, _t as meta, a as LoomObjectType, an as MutationFactory, at as getStandardValue, b as ensureInputObjectType, bn as BaseField, bt as toFieldMap, c as AliasList, cn as OperationType, ct as pascalCase, d as WeaverContext, dn as QueryOptions, dt as ResolvingFieldsOptions, en as FieldOrOperationType, et as subscription, f as collectName, fn as ResolverOptions, ft as getDeepResolvingFields, g as weaverContext, gn as ResolvingOptions, gt as mapValue, h as provideWeaverContext, hn as ResolverPayload, ht as deepMerge, i as CoreSchemaWeaverConfigOptions, in as InferFieldOutput, it as createInputParser, j as getGraphQLType, jn as ChainFactoryOptions, jt as MayPromise, k as NullableSilk, kn as types_loom_d_exports, kt as IsAny, l as GlobalWeaverContext, ln as QueryFactory, lt as screamingSnakeCase, m as initWeaverContext, mn as ResolverOptionsWithParent, mt as parseResolvingFields, n as weave, nn as GraphQLSilk, nt as InferInputI, o as OPERATION_OBJECT_NAMES, on as MutationFactoryWithChain, ot as parseInputValue, p as collectNames, pn as ResolverOptionsWithExtensions, pt as getResolvingFields, q as createSubscription, qt as DERIVED_DEPENDENCIES, r as CoreSchemaWeaverConfig, rn as InferFieldInput, rt as InferInputO, s as getCacheType, sn as MutationOptions, st as capitalize, t as GraphQLSchemaLoom, tn as GraphQLFieldOptions, tt as CallableInputParser, u as WeaverConfig, un as QueryFactoryWithChain, ut as ResolvingFields, v as isSchemaVendorWeaver, vn as SubscriptionFactoryWithChain, vt as notNullish, w as DirectiveRecord, wn as Mutation, wt as MiddlewareConfig, x as ensureInputType, xn as Field, xt as toObjMap, y as ensureInterfaceType, yn as SubscriptionOptions, yt as toArguments, z as Executor, zn as ResolvableSubscription, zt as markLocation } from "./index-CFo2-jU-.js";
2
+ export { AUTO_ALIASING, AliasList, BaseChainFactory, BaseField, BatchLoadFn, CallableInputParser, CallableMiddlewareOptions, ChainFactoryOptions, ChainResolver, CoreSchemaWeaverConfig, CoreSchemaWeaverConfigOptions, DERIVED_DEPENDENCIES, DirectiveItem, DirectiveRecord, EasyDataLoader, Executor, Field, FieldChainFactory, FieldFactory, FieldFactoryWithResolve, FieldFactoryWithUtils, FieldMeta, FieldOptions, FieldOrOperation, FieldOrOperationType, GQLoomExtensionAttribute, GQLoomExtensions, GlobalWeaverContext, GraphQLFieldOptions, GraphQLSchemaLoom, GraphQLSilk, IChainFactory, InferFieldInput, InferFieldOutput, InferInputI, InferInputO, IsAny, ListSilk, types_loom_d_exports as Loom, LoomDataLoader, LoomObjectType, MayGetter, MayPromise, Middleware, MiddlewareConfig, MiddlewareOperation, MiddlewareOptions, Mutation, MutationChainFactory, MutationFactory, MutationFactoryWithChain, MutationFactoryWithResolve, MutationOptions, NonNullSilk, NullableSilk, OPERATION_OBJECT_NAMES, ObjectChainResolver, OmitInUnion, OnlyMemoizationPayload, Operation, OperationType, Query, QueryChainFactory, QueryFactory, QueryFactoryWithChain, QueryFactoryWithResolve, QueryOptions, RequireKeys, ResolvableSubscription, Resolver, ResolverFactory, ResolverMeta, ResolverOptions, ResolverOptionsWithExtensions, ResolverOptionsWithParent, ResolverPayload, ResolvingFields, ResolvingFieldsOptions, ResolvingOptions, symbols_d_exports as SYMBOLS, SchemaWeaver, StandardSchemaV1, Subscription, SubscriptionChainFactory, SubscriptionFactory, SubscriptionFactoryWithChain, SubscriptionNeedResolve, SubscriptionOptions, ToExecutorProps, ValueOf, WeaverConfig, WeaverContext, applyMiddlewares, assignContextMap, capitalize, collectName, collectNames, createField, createInputParser, createMutation, createQuery, createSubscription, deepMerge, defaultSubscriptionResolve, ensureInputObjectType, ensureInputType, ensureInterfaceType, field, filterMiddlewares, getCacheType, getDeepResolvingFields, getFieldOptions, getGraphQLArgumentConfig, getGraphQLType, getMemoizationMap, getOperationOptions, getResolvingFields, getStandardValue, getSubscriptionOptions, initWeaverContext, inputToArgs, isOnlyMemoryPayload, isSchemaVendorWeaver, isSilk, listSilk, loom, mapValue, markErrorLocation, markLocation, meta, mutation, nonNullSilk, notNullish, nullableSilk, onlyMemoization, parseInputValue, parseResolvingFields, parseSilk, pascalCase, provideWeaverContext, query, resolver, screamingSnakeCase, silk, subscription, toArguments, toFieldMap, toObjMap, tryIn, weave, weaverContext };
package/dist/index.js CHANGED
@@ -55,11 +55,11 @@ var WeaverContext = class WeaverContext {
55
55
  };
56
56
  aliasCounters = {};
57
57
  aliasMap = /* @__PURE__ */ new WeakMap();
58
- setAlias(namedType, alias) {
58
+ setAlias(namedType, fieldName, parent) {
59
59
  if (namedType.name === AUTO_ALIASING) WeaverContext.autoAliasTypes.add(namedType);
60
60
  if (!WeaverContext.autoAliasTypes.has(namedType)) return namedType.name;
61
61
  const aliases = this.ensureAliasStore(namedType);
62
- if (alias) aliases.add(alias);
62
+ if (fieldName) parent ? aliases.push([fieldName, parent]) : aliases.push(fieldName);
63
63
  return this.pickAlias(namedType, aliases);
64
64
  }
65
65
  /**
@@ -77,12 +77,12 @@ var WeaverContext = class WeaverContext {
77
77
  ensureAliasStore(namedType) {
78
78
  const existing = this.aliasMap.get(namedType);
79
79
  if (existing) return existing;
80
- const aliases = /* @__PURE__ */ new Set();
80
+ const aliases = [];
81
81
  this.aliasMap.set(namedType, aliases);
82
82
  Object.defineProperty(namedType, "name", {
83
83
  get: () => this.pickAlias(namedType, aliases),
84
84
  set: (value) => {
85
- aliases.add(value);
85
+ aliases.push(value);
86
86
  },
87
87
  enumerable: true,
88
88
  configurable: true
@@ -93,12 +93,19 @@ var WeaverContext = class WeaverContext {
93
93
  const best = this.reduceAliases(aliases);
94
94
  if (best && best !== AUTO_ALIASING) return best;
95
95
  const fallback = this.createFallbackAlias(namedType);
96
- aliases.add(fallback);
96
+ aliases.push(fallback);
97
97
  return this.reduceAliases(aliases) ?? fallback;
98
98
  }
99
99
  reduceAliases(aliases) {
100
+ const stringAliases = aliases.filter((alias) => typeof alias === "string");
101
+ const tupleAliases = aliases.filter((alias) => Array.isArray(alias));
100
102
  let best;
101
- for (const alias of aliases) if (best === void 0 || WeaverContext.higherPriorityThan(alias, best) < 0) best = alias;
103
+ for (const alias of stringAliases) if (best === void 0 || WeaverContext.higherPriorityThan(alias, best) < 0) best = alias;
104
+ if (typeof best === "string") return best;
105
+ for (const [fieldName, parent] of tupleAliases) {
106
+ const alias = parent.name + fieldName;
107
+ if (best === void 0 || WeaverContext.higherPriorityThan(alias, best) < 0) best = alias;
108
+ }
102
109
  return best;
103
110
  }
104
111
  createFallbackAlias(namedType) {
@@ -1485,7 +1492,7 @@ var LoomObjectType = class extends GraphQLObjectType {
1485
1492
  return {
1486
1493
  ...extract(field$1),
1487
1494
  type: outputType,
1488
- args: inputToArgs(field$1["~meta"].input, { fieldName: parentName(this.name) + fieldName }),
1495
+ args: inputToArgs(field$1["~meta"].input, { fieldName }),
1489
1496
  resolve,
1490
1497
  ...subscribe ? { subscribe } : {}
1491
1498
  };
@@ -1609,27 +1616,25 @@ const OPERATION_OBJECT_NAMES = new Set([
1609
1616
  ]);
1610
1617
  function getCacheType(gqlType, options = {}) {
1611
1618
  const context = options.weaverContext ?? weaverContext;
1612
- const getAlias = () => {
1613
- if (!options.fieldName || !options.parent) return;
1614
- return parentName(options.parent.name) + pascalCase(options.fieldName);
1615
- };
1616
1619
  if (gqlType instanceof LoomObjectType) return gqlType;
1620
+ const parent = excludeOperationObject(options.parent);
1621
+ const fieldName = options.fieldName ? pascalCase(options.fieldName) : void 0;
1617
1622
  if (isObjectType(gqlType)) {
1618
1623
  const gqlObject = context.loomObjectMap?.get(gqlType);
1619
1624
  if (gqlObject != null) {
1620
- context.setAlias(gqlObject, getAlias());
1625
+ context.setAlias(gqlObject, fieldName, parent);
1621
1626
  return gqlObject;
1622
1627
  }
1623
1628
  const loomObject = new LoomObjectType(gqlType, options);
1624
1629
  context.loomObjectMap?.set(gqlType, loomObject);
1625
- context.setAlias(loomObject, getAlias());
1630
+ context.setAlias(loomObject, fieldName, parent);
1626
1631
  return loomObject;
1627
1632
  } else if (isListType(gqlType)) return new GraphQLList(getCacheType(gqlType.ofType, options));
1628
1633
  else if (isNonNullType(gqlType)) return new GraphQLNonNull(getCacheType(gqlType.ofType, options));
1629
1634
  else if (isUnionType(gqlType)) {
1630
1635
  const existing = context.loomUnionMap?.get(gqlType);
1631
1636
  if (existing != null) {
1632
- context.setAlias(existing, getAlias());
1637
+ context.setAlias(existing, fieldName, parent);
1633
1638
  return existing;
1634
1639
  }
1635
1640
  const config = gqlType.toConfig();
@@ -1641,17 +1646,18 @@ function getCacheType(gqlType, options = {}) {
1641
1646
  }))
1642
1647
  });
1643
1648
  context.loomUnionMap?.set(gqlType, unionType);
1644
- context.setAlias(unionType, getAlias());
1649
+ context.setAlias(unionType, fieldName, parent);
1645
1650
  return unionType;
1646
1651
  } else if (isEnumType(gqlType) || isInterfaceType(gqlType) || isScalarType(gqlType)) {
1647
- context.setAlias(gqlType, getAlias());
1652
+ context.setAlias(gqlType, fieldName, parent);
1648
1653
  return gqlType;
1649
1654
  }
1650
1655
  return gqlType;
1651
1656
  }
1652
- function parentName(name) {
1653
- if (OPERATION_OBJECT_NAMES.has(name)) name = "";
1654
- return name;
1657
+ function excludeOperationObject(object) {
1658
+ if (object == null) return void 0;
1659
+ if (OPERATION_OBJECT_NAMES.has(object.name)) return void 0;
1660
+ return object;
1655
1661
  }
1656
1662
 
1657
1663
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gqloom/core",
3
- "version": "0.14.2",
3
+ "version": "0.14.4",
4
4
  "description": "Create GraphQL schema and resolvers with TypeScript.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",