@soda-gql/core 0.10.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/dist/_internal.cjs +5 -0
  3. package/dist/_internal.d.cts +28 -0
  4. package/dist/_internal.d.cts.map +1 -0
  5. package/dist/_internal.d.ts +28 -0
  6. package/dist/_internal.d.ts.map +1 -0
  7. package/dist/_internal.js +3 -0
  8. package/dist/adapter.cjs +1 -1
  9. package/dist/adapter.d.cts +2 -2
  10. package/dist/adapter.d.ts +2 -2
  11. package/dist/adapter.js +1 -1
  12. package/dist/context-transformer-CYVYoqXM.cjs +58 -0
  13. package/dist/context-transformer-CYVYoqXM.cjs.map +1 -0
  14. package/dist/context-transformer-sAzKGoyJ.js +34 -0
  15. package/dist/context-transformer-sAzKGoyJ.js.map +1 -0
  16. package/dist/{index-DaREzuQm.d.ts → index-BcA2XPEk.d.ts} +201 -196
  17. package/dist/index-BcA2XPEk.d.ts.map +1 -0
  18. package/dist/{index-DnLzk2bC.d.cts → index-Bj60NxMb.d.cts} +1 -1
  19. package/dist/{index-DnLzk2bC.d.cts.map → index-Bj60NxMb.d.cts.map} +1 -1
  20. package/dist/{index-ChwPP6wc.d.cts → index-CatAewXz.d.cts} +201 -196
  21. package/dist/index-CatAewXz.d.cts.map +1 -0
  22. package/dist/{index-CnQ5XVCf.d.ts → index-DbANHktR.d.ts} +1 -1
  23. package/dist/index-DbANHktR.d.ts.map +1 -0
  24. package/dist/index.cjs +91 -91
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +4 -4
  27. package/dist/index.d.ts +4 -4
  28. package/dist/index.js +92 -91
  29. package/dist/index.js.map +1 -1
  30. package/dist/runtime.d.cts +2 -2
  31. package/dist/runtime.d.cts.map +1 -1
  32. package/dist/runtime.d.ts +2 -2
  33. package/dist/runtime.d.ts.map +1 -1
  34. package/dist/{schema-builder-CJe30s_R.d.ts → schema-builder-B5zSZzZO.d.ts} +2 -2
  35. package/dist/{schema-builder-CJe30s_R.d.ts.map → schema-builder-B5zSZzZO.d.ts.map} +1 -1
  36. package/dist/{schema-builder-D2ay11cE.cjs → schema-builder-DGxUr6K-.cjs} +1 -1
  37. package/dist/{schema-builder-D2ay11cE.cjs.map → schema-builder-DGxUr6K-.cjs.map} +1 -1
  38. package/dist/{schema-builder-CwRmtxHx.d.cts → schema-builder-YC3vPw7X.d.cts} +2 -2
  39. package/dist/{schema-builder-CwRmtxHx.d.cts.map → schema-builder-YC3vPw7X.d.cts.map} +1 -1
  40. package/dist/{schema-builder-C9Qj5zQg.js → schema-builder-oVVErGOB.js} +1 -1
  41. package/dist/{schema-builder-C9Qj5zQg.js.map → schema-builder-oVVErGOB.js.map} +1 -1
  42. package/package.json +8 -1
  43. package/dist/index-ChwPP6wc.d.cts.map +0 -1
  44. package/dist/index-CnQ5XVCf.d.ts.map +0 -1
  45. package/dist/index-DaREzuQm.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { At as ConstValue, B as UnionMemberName, C as AnyFieldName, D as InferInputKind, Dt as InputDepthOverrides, F as OperationType, H as AnyVarRef, I as PickTypeSpecifierByFieldName, K as VarRef, L as ResolveInputProfileFromMeta, Mt as FieldPath, N as ObjectFieldRecord, O as InferInputProfile, S as AllInputTypeNames, T as AnyTypeName, U as AnyVarRefBrand, X as AnyDefaultValue, _ as FragmentMetadataBuilder, _t as PrimitiveTypeProfile, a as DefaultMetadataAdapter, at as OutputEnumSpecifier, bt as GetSignature, c as ExtractAdapterTypes, ct as OutputScalarSpecifier, ft as OutputTypenameSpecifier, gt as ObjectTypeProfile, ht as GetModifiedType, i as DefaultAdapter, it as InputTypeSpecifiers, k as InferOutputProfile, mt as GetConstAssignableType, n as AnyAdapter, nt as InputTypeKind, ot as OutputInferrableTypeSpecifier, p as OperationDocumentTransformer, pt as OutputUnionSpecifier, r as AnyMetadataAdapter, rt as InputTypeSpecifier, s as DocumentTransformer, st as OutputObjectSpecifier, t as Adapter, ut as OutputTypeSpecifier, vt as TypeProfile, w as AnyGraphqlSchema, xt as TypeModifier, y as MetadataBuilder, yt as ApplyTypeModifier } from "./index-CnQ5XVCf.js";
1
+ import { At as ConstValue, B as UnionMemberName, C as AnyFieldName, D as InferInputKind, Dt as InputDepthOverrides, F as OperationType, H as AnyVarRef, I as PickTypeSpecifierByFieldName, K as VarRef, L as ResolveInputProfileFromMeta, Mt as FieldPath, N as ObjectFieldRecord, O as InferInputProfile, S as AllInputTypeNames, T as AnyTypeName, U as AnyVarRefBrand, X as AnyDefaultValue, _ as FragmentMetadataBuilder, _t as PrimitiveTypeProfile, a as DefaultMetadataAdapter, at as OutputEnumSpecifier, bt as GetSignature, c as ExtractAdapterTypes, ct as OutputScalarSpecifier, ft as OutputTypenameSpecifier, gt as ObjectTypeProfile, ht as GetModifiedType, i as DefaultAdapter, it as InputTypeSpecifiers, k as InferOutputProfile, mt as GetConstAssignableType, n as AnyAdapter, nt as InputTypeKind, ot as OutputInferrableTypeSpecifier, p as OperationDocumentTransformer, pt as OutputUnionSpecifier, r as AnyMetadataAdapter, rt as InputTypeSpecifier, s as DocumentTransformer, st as OutputObjectSpecifier, t as Adapter, ut as OutputTypeSpecifier, vt as TypeProfile, w as AnyGraphqlSchema, xt as TypeModifier, y as MetadataBuilder, yt as ApplyTypeModifier } from "./index-DbANHktR.js";
2
2
  import { ConstValueNode, NamedTypeNode, OperationTypeNode, TypeNode, ValueNode, VariableDefinitionNode } from "graphql";
3
3
  import { TypedDocumentNode } from "@graphql-typed-document-node/core";
4
4
 
@@ -225,7 +225,7 @@ type FieldSelectionTemplateOf<TSchema extends AnyGraphqlSchema, TTypeName$1 exte
225
225
  union: AnyNestedUnion;
226
226
  } : never)> : never;
227
227
  /** Resolve the data shape produced by a set of field selections. */
228
- type InferFields<TSchema extends AnyGraphqlSchema, TFields$1 extends AnyFields> = { [_ in TSchema["label"]]: { [TAliasName in keyof TFields$1]: InferField<TSchema, TFields$1[TAliasName]> } & {} }[TSchema["label"]];
228
+ type InferFields<TSchema extends AnyGraphqlSchema, TFields extends AnyFields> = { [_ in TSchema["label"]]: { [TAliasName in keyof TFields]: InferField<TSchema, TFields[TAliasName]> } & {} }[TSchema["label"]];
229
229
  /** Resolve the data shape for a single field reference, including nested objects/unions. */
230
230
  type InferField<TSchema extends AnyGraphqlSchema, TSelection extends AnyFieldSelection> = (TSelection extends {
231
231
  type: infer TSpecifier extends OutputObjectSpecifier;
@@ -238,20 +238,37 @@ type InferField<TSchema extends AnyGraphqlSchema, TSelection extends AnyFieldSel
238
238
  } ? GetModifiedType<InferOutputProfile<TSchema, TSpecifier>, TSpecifier["modifier"]> : never);
239
239
  //#endregion
240
240
  //#region packages/core/src/composer/build-document.d.ts
241
+ /**
242
+ * Context for determining if a value should be output as an enum.
243
+ * Contains the schema for looking up nested input types and the current type specifier.
244
+ */
245
+ type EnumLookup = {
246
+ schema: AnyGraphqlSchema;
247
+ /** Type specifier for the current value. null means enum detection is skipped. */
248
+ typeSpecifier: InputTypeSpecifier | null;
249
+ };
241
250
  /**
242
251
  * Converts an assignable input value to a GraphQL AST ValueNode.
243
252
  *
244
253
  * Handles primitives, arrays, objects, and variable references.
245
254
  * Returns null for undefined values (field is omitted).
255
+ *
256
+ * @param value - The value to convert
257
+ * @param enumLookup - Context for enum detection. String values will be output
258
+ * as Kind.ENUM if typeSpecifier indicates an enum type.
246
259
  */
247
- declare const buildArgumentValue: (value: AnyAssignableInputValue) => ValueNode | null;
260
+ declare const buildArgumentValue: (value: AnyAssignableInputValue, enumLookup: EnumLookup) => ValueNode | null;
248
261
  /**
249
262
  * Converts a constant value to a GraphQL AST ConstValueNode.
250
263
  *
251
264
  * Unlike `buildArgumentValue`, this only handles literal values
252
265
  * (no variable references). Used for default values.
266
+ *
267
+ * @param value - The constant value to convert
268
+ * @param enumLookup - Context for enum detection. String values will be output
269
+ * as Kind.ENUM if typeSpecifier indicates an enum type.
253
270
  */
254
- declare const buildConstValueNode: (value: ConstValue) => ConstValueNode | null;
271
+ declare const buildConstValueNode: (value: ConstValue, enumLookup: EnumLookup) => ConstValueNode | null;
255
272
  /**
256
273
  * Wraps a named type with modifiers (non-null, list).
257
274
  *
@@ -276,15 +293,16 @@ declare const buildOperationTypeNode: (operation: OperationType) => OperationTyp
276
293
  * a GraphQL document AST. The result can be used with any GraphQL
277
294
  * client that supports TypedDocumentNode.
278
295
  *
279
- * @param options - Operation configuration (name, type, variables, fields)
296
+ * @param options - Operation configuration (name, type, variables, fields, schema)
280
297
  * @returns TypedDocumentNode with inferred input/output types
281
298
  */
282
- declare const buildDocument: <TSchema extends AnyGraphqlSchema, TFields$1 extends AnyFields, TVarDefinitions extends InputTypeSpecifiers>(options: {
299
+ declare const buildDocument: <TSchema extends AnyGraphqlSchema, TFields extends AnyFields, TVarDefinitions extends InputTypeSpecifiers>(options: {
283
300
  operationName: string;
284
301
  operationType: OperationType;
285
302
  variables: TVarDefinitions;
286
- fields: TFields$1;
287
- }) => TypedDocumentNode<InferFields<TSchema, TFields$1>, ConstAssignableInput<TSchema, TVarDefinitions>>;
303
+ fields: TFields;
304
+ schema: TSchema;
305
+ }) => TypedDocumentNode<InferFields<TSchema, TFields>, ConstAssignableInput<TSchema, TVarDefinitions>>;
288
306
  //#endregion
289
307
  //#region packages/core/src/utils/type-utils.d.ts
290
308
  type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never;
@@ -479,7 +497,7 @@ declare const empty: () => EmptyObject;
479
497
  * tooling `f`/`fields`/`_` aliases provide ergonomic access to GraphQL fields
480
498
  * while preserving the original schema information for inference.
481
499
  */
482
- type FieldsBuilder<TSchema extends AnyGraphqlSchema, TTypeName$1 extends keyof TSchema["object"] & string, TVariableDefinitions extends InputTypeSpecifiers, TFields$1 extends AnyFields> = (tools: NoInfer<FieldsBuilderTools<TSchema, TTypeName$1, TVariableDefinitions>>) => TFields$1;
500
+ type FieldsBuilder<TSchema extends AnyGraphqlSchema, TTypeName$1 extends keyof TSchema["object"] & string, TVariableDefinitions extends InputTypeSpecifiers, TFields extends AnyFields> = (tools: NoInfer<FieldsBuilderTools<TSchema, TTypeName$1, TVariableDefinitions>>) => TFields;
483
501
  /**
484
502
  * Tools provided to field builder callbacks.
485
503
  * - `f`: Field selection factories for the current type
@@ -493,7 +511,7 @@ type FieldsBuilderTools<TSchema extends AnyGraphqlSchema, TTypeName$1 extends ke
493
511
  * Builder for nested object field selections.
494
512
  * Used when a field returns an object type requiring sub-selections.
495
513
  */
496
- type NestedObjectFieldsBuilder<TSchema extends AnyGraphqlSchema, TTypeName$1 extends keyof TSchema["object"] & string, TFields$1 extends AnyNestedObject> = (tools: NoInfer<NestedObjectFieldsBuilderTools<TSchema, TTypeName$1>>) => TFields$1;
514
+ type NestedObjectFieldsBuilder<TSchema extends AnyGraphqlSchema, TTypeName$1 extends keyof TSchema["object"] & string, TFields extends AnyNestedObject> = (tools: NoInfer<NestedObjectFieldsBuilderTools<TSchema, TTypeName$1>>) => TFields;
497
515
  /**
498
516
  * Tools for nested object builders (no variable access).
499
517
  * @internal
@@ -651,7 +669,7 @@ declare abstract class GqlElement<TDefinition extends object, TInfer extends obj
651
669
  /**
652
670
  * Type alias for any Fragment instance.
653
671
  */
654
- type AnyFragment = Fragment<string, any, AnyFields, any, string | undefined>;
672
+ type AnyFragment = Fragment<string, any, AnyFields, any>;
655
673
  /**
656
674
  * Type inference metadata for fragments.
657
675
  * Access via `typeof fragment.$infer`.
@@ -664,12 +682,12 @@ type FragmentInferMeta<TVariables, TOutput extends object> = {
664
682
  * Internal artifact shape produced by fragment evaluation.
665
683
  * @internal
666
684
  */
667
- interface FragmentArtifact<TTypeName$1 extends string, TVariables extends Partial<AnyAssignableInput> | void, TFields$1 extends Partial<AnyFields>, TKey$1 extends string | undefined = undefined> {
685
+ interface FragmentArtifact<TTypeName$1 extends string, TVariables extends Partial<AnyAssignableInput> | void, TFields extends Partial<AnyFields>> {
668
686
  readonly typename: TTypeName$1;
669
- readonly key: TKey$1;
687
+ readonly key: string | undefined;
670
688
  readonly schemaLabel: string;
671
689
  readonly variableDefinitions: InputTypeSpecifiers;
672
- readonly spread: (variables: TVariables) => TFields$1;
690
+ readonly spread: (variables: TVariables) => TFields;
673
691
  }
674
692
  declare const __FRAGMENT_BRAND__: unique symbol;
675
693
  /**
@@ -682,15 +700,14 @@ declare const __FRAGMENT_BRAND__: unique symbol;
682
700
  * @template TVariables - Variables required when spreading
683
701
  * @template TFields - The selected fields structure
684
702
  * @template TOutput - Inferred output type from selected fields
685
- * @template TKey - Optional unique key for prebuilt type lookup
686
703
  */
687
- declare class Fragment<TTypeName$1 extends string, TVariables extends Partial<AnyAssignableInput> | void, TFields$1 extends Partial<AnyFields>, TOutput extends object, TKey$1 extends string | undefined = undefined> extends GqlElement<FragmentArtifact<TTypeName$1, TVariables, TFields$1, TKey$1>, FragmentInferMeta<TVariables, TOutput>> implements FragmentArtifact<TTypeName$1, TVariables, TFields$1, TKey$1> {
704
+ declare class Fragment<TTypeName$1 extends string, TVariables extends Partial<AnyAssignableInput> | void, TFields extends Partial<AnyFields>, TOutput extends object> extends GqlElement<FragmentArtifact<TTypeName$1, TVariables, TFields>, FragmentInferMeta<TVariables, TOutput>> implements FragmentArtifact<TTypeName$1, TVariables, TFields> {
688
705
  private readonly [__FRAGMENT_BRAND__];
689
706
  private constructor();
690
707
  /** The GraphQL type name this fragment selects from. */
691
708
  get typename(): TTypeName$1;
692
709
  /** Optional unique key for prebuilt type lookup. */
693
- get key(): TKey$1;
710
+ get key(): string | undefined;
694
711
  /** The schema label this fragment belongs to. */
695
712
  get schemaLabel(): string;
696
713
  /** Variable definitions for this fragment. */
@@ -699,23 +716,23 @@ declare class Fragment<TTypeName$1 extends string, TVariables extends Partial<An
699
716
  * Spreads this fragment's fields into a parent selection.
700
717
  * Pass variables if the fragment defines any.
701
718
  */
702
- get spread(): (variables: TVariables) => TFields$1;
719
+ get spread(): (variables: TVariables) => TFields;
703
720
  /**
704
721
  * Creates a new Fragment instance.
705
722
  * Prefer using the `gql(({ fragment }) => ...)` API instead.
706
723
  * @internal
707
724
  */
708
- static create<TSchema extends AnyGraphqlSchema, TTypeName$1 extends keyof TSchema["object"] & string, TVariableDefinitions extends InputTypeSpecifiers, TFields$1 extends AnyFields, TKey$1 extends string | undefined = undefined>(define: () => {
725
+ static create<TSchema extends AnyGraphqlSchema, TTypeName$1 extends keyof TSchema["object"] & string, TVariableDefinitions extends InputTypeSpecifiers, TFields extends AnyFields>(define: () => {
709
726
  typename: TTypeName$1;
710
- key: TKey$1;
727
+ key: string | undefined;
711
728
  schemaLabel: TSchema["label"];
712
729
  variableDefinitions: TVariableDefinitions;
713
- spread: (variables: OptionalArg<AssignableInput<TSchema, TVariableDefinitions>>) => TFields$1;
714
- }): Fragment<TTypeName$1, OptionalArg<AssignableInput<TSchema, TVariableDefinitions>>, TFields$1 & {
730
+ spread: (variables: OptionalArg<AssignableInput<TSchema, TVariableDefinitions>>) => TFields;
731
+ }): Fragment<TTypeName$1, OptionalArg<AssignableInput<TSchema, TVariableDefinitions>>, TFields & {
715
732
  [key: symbol]: never;
716
- }, InferFields<TSchema, TFields$1> & {
733
+ }, InferFields<TSchema, TFields> & {
717
734
  [key: symbol]: never;
718
- }, TKey$1>;
735
+ }>;
719
736
  }
720
737
  //#endregion
721
738
  //#region packages/core/src/types/element/operation.d.ts
@@ -726,7 +743,7 @@ type AnyOperation = AnyOperationOf<"query"> | AnyOperationOf<"mutation"> | AnyOp
726
743
  /**
727
744
  * Type alias for an Operation of a specific type.
728
745
  */
729
- type AnyOperationOf<TOperationType$1 extends OperationType> = Operation<TOperationType$1, string, string[], any, AnyFields, any>;
746
+ type AnyOperationOf<TOperationType extends OperationType> = Operation<TOperationType, string, string[], any, AnyFields, any>;
730
747
  /**
731
748
  * Type inference metadata for operations.
732
749
  * Access via `typeof operation.$infer`.
@@ -740,12 +757,12 @@ declare const __OPERATION_BRAND__: unique symbol;
740
757
  * Internal artifact shape produced by operation evaluation.
741
758
  * @internal
742
759
  */
743
- type OperationArtifact<TOperationType$1 extends OperationType, TOperationName$1 extends string, TVariableNames$1 extends string[], TVariables extends AnyConstAssignableInput, TFields$1 extends Partial<AnyFields>, TData extends object> = {
744
- readonly operationType: TOperationType$1;
745
- readonly operationName: TOperationName$1;
760
+ type OperationArtifact<TOperationType extends OperationType, TOperationName extends string, TVariableNames extends string[], TVariables extends AnyConstAssignableInput, TFields extends Partial<AnyFields>, TData extends object> = {
761
+ readonly operationType: TOperationType;
762
+ readonly operationName: TOperationName;
746
763
  readonly schemaLabel: string;
747
- readonly variableNames: TVariableNames$1;
748
- readonly documentSource: () => TFields$1;
764
+ readonly variableNames: TVariableNames;
765
+ readonly documentSource: () => TFields;
749
766
  readonly document: TypedDocumentNode<TData, TVariables>;
750
767
  readonly metadata?: unknown;
751
768
  };
@@ -762,22 +779,22 @@ type OperationArtifact<TOperationType$1 extends OperationType, TOperationName$1
762
779
  * @template TFields - Selected fields structure
763
780
  * @template TData - Inferred response data type
764
781
  */
765
- declare class Operation<TOperationType$1 extends OperationType, TOperationName$1 extends string, TVariableNames$1 extends string[], TVariables extends AnyConstAssignableInput, TFields$1 extends Partial<AnyFields>, TData extends object> extends GqlElement<OperationArtifact<TOperationType$1, TOperationName$1, TVariableNames$1, TVariables, TFields$1, TData>, OperationInferMeta<TVariables, TData>> implements OperationArtifact<TOperationType$1, TOperationName$1, TVariableNames$1, TVariables, TFields$1, TData> {
782
+ declare class Operation<TOperationType extends OperationType, TOperationName extends string, TVariableNames extends string[], TVariables extends AnyConstAssignableInput, TFields extends Partial<AnyFields>, TData extends object> extends GqlElement<OperationArtifact<TOperationType, TOperationName, TVariableNames, TVariables, TFields, TData>, OperationInferMeta<TVariables, TData>> implements OperationArtifact<TOperationType, TOperationName, TVariableNames, TVariables, TFields, TData> {
766
783
  private readonly [__OPERATION_BRAND__];
767
784
  private constructor();
768
785
  /** The operation type: 'query', 'mutation', or 'subscription'. */
769
- get operationType(): TOperationType$1;
786
+ get operationType(): TOperationType;
770
787
  /** The unique name of this operation. */
771
- get operationName(): TOperationName$1;
788
+ get operationName(): TOperationName;
772
789
  /** The schema label this operation belongs to. */
773
790
  get schemaLabel(): string;
774
791
  /** List of variable names defined for this operation. */
775
- get variableNames(): TVariableNames$1;
792
+ get variableNames(): TVariableNames;
776
793
  /**
777
794
  * Returns the field selections. Used for document reconstruction.
778
795
  * @internal
779
796
  */
780
- get documentSource(): () => TFields$1;
797
+ get documentSource(): () => TFields;
781
798
  /** The TypedDocumentNode for use with GraphQL clients. */
782
799
  get document(): TypedDocumentNode<TData, TVariables>;
783
800
  /** Custom metadata attached to this operation, if any. */
@@ -787,23 +804,23 @@ declare class Operation<TOperationType$1 extends OperationType, TOperationName$1
787
804
  * Prefer using the `gql(({ query }) => ...)` API instead.
788
805
  * @internal
789
806
  */
790
- static create<TSchema extends AnyGraphqlSchema, TOperationType$1 extends OperationType, TOperationName$1 extends string, TVariableDefinitions extends InputTypeSpecifiers, TFields$1 extends AnyFields>(define: (context: GqlElementContext | null) => {
791
- operationType: TOperationType$1;
792
- operationName: TOperationName$1;
807
+ static create<TSchema extends AnyGraphqlSchema, TOperationType extends OperationType, TOperationName extends string, TVariableDefinitions extends InputTypeSpecifiers, TFields extends AnyFields>(define: (context: GqlElementContext | null) => {
808
+ operationType: TOperationType;
809
+ operationName: TOperationName;
793
810
  schemaLabel: TSchema["label"];
794
811
  variableNames: (keyof TVariableDefinitions & string)[];
795
- documentSource: () => TFields$1;
796
- document: TypedDocumentNode<InferFields<TSchema, TFields$1>, ConstAssignableInput<TSchema, TVariableDefinitions>>;
812
+ documentSource: () => TFields;
813
+ document: TypedDocumentNode<InferFields<TSchema, TFields>, ConstAssignableInput<TSchema, TVariableDefinitions>>;
797
814
  metadata?: unknown;
798
815
  } | Promise<{
799
- operationType: TOperationType$1;
800
- operationName: TOperationName$1;
816
+ operationType: TOperationType;
817
+ operationName: TOperationName;
801
818
  schemaLabel: TSchema["label"];
802
819
  variableNames: (keyof TVariableDefinitions & string)[];
803
- documentSource: () => TFields$1;
804
- document: TypedDocumentNode<InferFields<TSchema, TFields$1>, ConstAssignableInput<TSchema, TVariableDefinitions>>;
820
+ documentSource: () => TFields;
821
+ document: TypedDocumentNode<InferFields<TSchema, TFields>, ConstAssignableInput<TSchema, TVariableDefinitions>>;
805
822
  metadata?: unknown;
806
- }>): Operation<TOperationType$1, TOperationName$1, (keyof TVariableDefinitions & string)[], ConstAssignableInput<TSchema, TVariableDefinitions>, TFields$1, InferFields<TSchema, TFields$1>>;
823
+ }>): Operation<TOperationType, TOperationName, (keyof TVariableDefinitions & string)[], ConstAssignableInput<TSchema, TVariableDefinitions>, TFields, InferFields<TSchema, TFields>>;
807
824
  }
808
825
  //#endregion
809
826
  //#region packages/core/src/composer/fields-builder.d.ts
@@ -851,13 +868,13 @@ declare const createVarRefs: <TSchema extends AnyGraphqlSchema, TVarDefinitions
851
868
  * Used by codegen to generate explicit fragment builder types instead of
852
869
  * expensive mapped types. This improves IDE performance for large schemas.
853
870
  */
854
- type FragmentBuilderFor<TSchema extends AnyGraphqlSchema, TTypeName$1 extends keyof TSchema["object"] & string, TAdapter extends AnyMetadataAdapter = DefaultMetadataAdapter> = <TFields$1 extends AnyFields, TVarDefinitions extends InputTypeSpecifiers = {}, TKey$1 extends string | undefined = undefined>(options: {
871
+ type FragmentBuilderFor<TSchema extends AnyGraphqlSchema, TTypeName$1 extends keyof TSchema["object"] & string, TAdapter extends AnyMetadataAdapter = DefaultMetadataAdapter> = <TFields extends AnyFields, TVarDefinitions extends InputTypeSpecifiers = {}>(options: {
855
872
  /** Optional unique key for prebuilt type lookup. */
856
- key?: TKey$1;
873
+ key?: string;
857
874
  variables?: TVarDefinitions;
858
875
  metadata?: FragmentMetadataBuilder<ReturnType<typeof createVarRefs<TSchema, TVarDefinitions>>, ExtractAdapterTypes<TAdapter>["fragmentMetadata"]>;
859
- fields: FieldsBuilder<TSchema, TTypeName$1, TVarDefinitions, TFields$1>;
860
- }) => ReturnType<typeof Fragment.create<TSchema, TTypeName$1, TVarDefinitions, TFields$1, TKey$1>>;
876
+ fields: FieldsBuilder<TSchema, TTypeName$1, TVarDefinitions, TFields>;
877
+ }) => ReturnType<typeof Fragment.create<TSchema, TTypeName$1, TVarDefinitions, TFields>>;
861
878
  /**
862
879
  * Creates fragment builder functions for all object types in the schema.
863
880
  *
@@ -870,16 +887,16 @@ type FragmentBuilderFor<TSchema extends AnyGraphqlSchema, TTypeName$1 extends ke
870
887
  *
871
888
  * @internal Used by `createGqlElementComposer`
872
889
  */
873
- declare const createGqlFragmentComposers: <TSchema extends AnyGraphqlSchema, TAdapter extends AnyMetadataAdapter = DefaultMetadataAdapter>(schema: NoInfer<TSchema>, _adapter?: TAdapter) => { readonly [TTypeName in keyof TSchema["object"]]: TTypeName extends string ? <TFields$1 extends AnyFields, TVarDefinitions extends InputTypeSpecifiers = {}, TKey$1 extends string | undefined = undefined>(options: {
874
- key?: TKey$1 | undefined;
890
+ declare const createGqlFragmentComposers: <TSchema extends AnyGraphqlSchema, TAdapter extends AnyMetadataAdapter = DefaultMetadataAdapter>(schema: NoInfer<TSchema>, _adapter?: TAdapter) => { readonly [TTypeName in keyof TSchema["object"]]: TTypeName extends string ? <TFields extends AnyFields, TVarDefinitions extends InputTypeSpecifiers = {}>(options: {
891
+ key?: string;
875
892
  variables?: TVarDefinitions | undefined;
876
893
  metadata?: FragmentMetadataBuilder<DeclaredVariables<TSchema, TVarDefinitions>, ExtractAdapterTypes<TAdapter>["fragmentMetadata"]> | undefined;
877
- fields: FieldsBuilder<TSchema, TTypeName, TVarDefinitions, TFields$1>;
878
- }) => Fragment<TTypeName, OptionalArg<AssignableInput<TSchema, TVarDefinitions>>, TFields$1 & {
894
+ fields: FieldsBuilder<TSchema, TTypeName, TVarDefinitions, TFields>;
895
+ }) => Fragment<TTypeName, OptionalArg<AssignableInput<TSchema, TVarDefinitions>>, TFields & {
879
896
  [key: symbol]: never;
880
- }, InferFields<TSchema, TFields$1> & {
897
+ }, InferFields<TSchema, TFields> & {
881
898
  [key: symbol]: never;
882
- }, TKey$1> : never };
899
+ }> : never };
883
900
  //#endregion
884
901
  //#region packages/core/src/composer/fragment-usage-context.d.ts
885
902
  /**
@@ -1174,36 +1191,61 @@ type GqlElementComposerOptions<TSchema extends AnyGraphqlSchema, TDirectiveMetho
1174
1191
  declare const createGqlElementComposer: <TSchema extends AnyGraphqlSchema, TFragmentBuilders, TDirectiveMethods extends StandardDirectives, TAdapter extends AnyAdapter = DefaultAdapter>(schema: NoInfer<TSchema>, options: GqlElementComposerOptions<NoInfer<TSchema>, NoInfer<TDirectiveMethods>, NoInfer<TAdapter>>) => GqlElementComposerWithSchema<{
1175
1192
  fragment: TFragmentBuilders;
1176
1193
  query: {
1177
- operation: <TOperationName$1 extends string, TFields$1 extends AnyFields, TVarDefinitions extends InputTypeSpecifiers = {}, TOperationMetadata = unknown>(options: {
1178
- name: TOperationName$1;
1194
+ operation: <TOperationName extends string, TFields extends AnyFields, TVarDefinitions extends InputTypeSpecifiers = {}, TOperationMetadata = unknown>(options: {
1195
+ name: TOperationName;
1179
1196
  variables?: TVarDefinitions | undefined;
1180
1197
  metadata?: MetadataBuilder<DeclaredVariables<TSchema, TVarDefinitions>, TOperationMetadata, ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["aggregatedFragmentMetadata"], ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["schemaLevel"]> | undefined;
1181
- fields: FieldsBuilder<TSchema, TSchema["operations"]["query"] & keyof TSchema["object"] & string, TVarDefinitions, TFields$1>;
1198
+ fields: FieldsBuilder<TSchema, TSchema["operations"]["query"] & keyof TSchema["object"] & string, TVarDefinitions, TFields>;
1182
1199
  transformDocument?: OperationDocumentTransformer<TOperationMetadata> | undefined;
1183
- }) => Operation<"query", TOperationName$1, (keyof TVarDefinitions & string)[], ConstAssignableInput<TSchema, TVarDefinitions>, TFields$1, InferFields<TSchema, TFields$1>>;
1200
+ }) => Operation<"query", TOperationName, (keyof TVarDefinitions & string)[], ConstAssignableInput<TSchema, TVarDefinitions>, TFields, InferFields<TSchema, TFields>>;
1184
1201
  };
1185
1202
  mutation: {
1186
- operation: <TOperationName$1 extends string, TFields$1 extends AnyFields, TVarDefinitions extends InputTypeSpecifiers = {}, TOperationMetadata = unknown>(options: {
1187
- name: TOperationName$1;
1203
+ operation: <TOperationName extends string, TFields extends AnyFields, TVarDefinitions extends InputTypeSpecifiers = {}, TOperationMetadata = unknown>(options: {
1204
+ name: TOperationName;
1188
1205
  variables?: TVarDefinitions | undefined;
1189
1206
  metadata?: MetadataBuilder<DeclaredVariables<TSchema, TVarDefinitions>, TOperationMetadata, ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["aggregatedFragmentMetadata"], ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["schemaLevel"]> | undefined;
1190
- fields: FieldsBuilder<TSchema, TSchema["operations"]["mutation"] & keyof TSchema["object"] & string, TVarDefinitions, TFields$1>;
1207
+ fields: FieldsBuilder<TSchema, TSchema["operations"]["mutation"] & keyof TSchema["object"] & string, TVarDefinitions, TFields>;
1191
1208
  transformDocument?: OperationDocumentTransformer<TOperationMetadata> | undefined;
1192
- }) => Operation<"mutation", TOperationName$1, (keyof TVarDefinitions & string)[], ConstAssignableInput<TSchema, TVarDefinitions>, TFields$1, InferFields<TSchema, TFields$1>>;
1209
+ }) => Operation<"mutation", TOperationName, (keyof TVarDefinitions & string)[], ConstAssignableInput<TSchema, TVarDefinitions>, TFields, InferFields<TSchema, TFields>>;
1193
1210
  };
1194
1211
  subscription: {
1195
- operation: <TOperationName$1 extends string, TFields$1 extends AnyFields, TVarDefinitions extends InputTypeSpecifiers = {}, TOperationMetadata = unknown>(options: {
1196
- name: TOperationName$1;
1212
+ operation: <TOperationName extends string, TFields extends AnyFields, TVarDefinitions extends InputTypeSpecifiers = {}, TOperationMetadata = unknown>(options: {
1213
+ name: TOperationName;
1197
1214
  variables?: TVarDefinitions | undefined;
1198
1215
  metadata?: MetadataBuilder<DeclaredVariables<TSchema, TVarDefinitions>, TOperationMetadata, ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["aggregatedFragmentMetadata"], ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["schemaLevel"]> | undefined;
1199
- fields: FieldsBuilder<TSchema, TSchema["operations"]["subscription"] & keyof TSchema["object"] & string, TVarDefinitions, TFields$1>;
1216
+ fields: FieldsBuilder<TSchema, TSchema["operations"]["subscription"] & keyof TSchema["object"] & string, TVarDefinitions, TFields>;
1200
1217
  transformDocument?: OperationDocumentTransformer<TOperationMetadata> | undefined;
1201
- }) => Operation<"subscription", TOperationName$1, (keyof TVarDefinitions & string)[], ConstAssignableInput<TSchema, TVarDefinitions>, TFields$1, InferFields<TSchema, TFields$1>>;
1218
+ }) => Operation<"subscription", TOperationName, (keyof TVarDefinitions & string)[], ConstAssignableInput<TSchema, TVarDefinitions>, TFields, InferFields<TSchema, TFields>>;
1202
1219
  };
1203
1220
  $var: VarBuilder<TSchema>;
1204
1221
  $dir: TDirectiveMethods;
1205
1222
  $colocate: <TEntries extends ColocatedEntries>(entries: TEntries) => ColocatedFields<TEntries>;
1206
1223
  } & ExtractHelpers<TAdapter>, TSchema>;
1224
+ /**
1225
+ * Abstract Context type for prebuilt composers.
1226
+ *
1227
+ * Provides minimal structure while allowing PrebuiltTypeRegistry to resolve
1228
+ * actual types. Used by prebuilt module to avoid heavy schema type inference.
1229
+ *
1230
+ * Type safety in prebuilt comes from `ResolvePrebuiltElement`, not from
1231
+ * the Context type.
1232
+ */
1233
+ type AnyGqlContext = {
1234
+ readonly fragment: Record<string, unknown>;
1235
+ readonly query: {
1236
+ operation: (...args: unknown[]) => AnyOperation;
1237
+ };
1238
+ readonly mutation: {
1239
+ operation: (...args: unknown[]) => AnyOperation;
1240
+ };
1241
+ readonly subscription: {
1242
+ operation: (...args: unknown[]) => AnyOperation;
1243
+ };
1244
+ readonly $var: unknown;
1245
+ readonly $dir: StandardDirectives;
1246
+ readonly $colocate: unknown;
1247
+ readonly [key: string]: unknown;
1248
+ };
1207
1249
  //#endregion
1208
1250
  //#region packages/core/src/composer/operation.d.ts
1209
1251
  /**
@@ -1222,136 +1264,13 @@ declare const createGqlElementComposer: <TSchema extends AnyGraphqlSchema, TFrag
1222
1264
  *
1223
1265
  * @internal Used by `createGqlElementComposer`
1224
1266
  */
1225
- declare const createOperationComposerFactory: <TSchema extends AnyGraphqlSchema, TAdapter extends AnyMetadataAdapter = DefaultMetadataAdapter>(schema: NoInfer<TSchema>, adapter?: TAdapter, transformDocument?: DocumentTransformer<ExtractAdapterTypes<TAdapter>["schemaLevel"], ExtractAdapterTypes<TAdapter>["aggregatedFragmentMetadata"]>) => <TOperationType$1 extends OperationType>(operationType: TOperationType$1) => <TOperationName$1 extends string, TFields$1 extends AnyFields, TVarDefinitions extends InputTypeSpecifiers = {}, TOperationMetadata = unknown>(options: {
1226
- name: TOperationName$1;
1267
+ declare const createOperationComposerFactory: <TSchema extends AnyGraphqlSchema, TAdapter extends AnyMetadataAdapter = DefaultMetadataAdapter>(schema: NoInfer<TSchema>, adapter?: TAdapter, transformDocument?: DocumentTransformer<ExtractAdapterTypes<TAdapter>["schemaLevel"], ExtractAdapterTypes<TAdapter>["aggregatedFragmentMetadata"]>) => <TOperationType extends OperationType>(operationType: TOperationType) => <TOperationName extends string, TFields extends AnyFields, TVarDefinitions extends InputTypeSpecifiers = {}, TOperationMetadata = unknown>(options: {
1268
+ name: TOperationName;
1227
1269
  variables?: TVarDefinitions;
1228
1270
  metadata?: MetadataBuilder<ReturnType<typeof createVarRefs<TSchema, TVarDefinitions>>, TOperationMetadata, ExtractAdapterTypes<TAdapter>["aggregatedFragmentMetadata"], ExtractAdapterTypes<TAdapter>["schemaLevel"]>;
1229
- fields: FieldsBuilder<TSchema, TSchema["operations"][TOperationType$1] & keyof TSchema["object"] & string, TVarDefinitions, TFields$1>;
1271
+ fields: FieldsBuilder<TSchema, TSchema["operations"][TOperationType] & keyof TSchema["object"] & string, TVarDefinitions, TFields>;
1230
1272
  transformDocument?: OperationDocumentTransformer<TOperationMetadata>;
1231
- }) => Operation<TOperationType$1, TOperationName$1, (keyof TVarDefinitions & string)[], ConstAssignableInput<TSchema, TVarDefinitions>, TFields$1, InferFields<TSchema, TFields$1>>;
1232
- //#endregion
1233
- //#region packages/core/src/prebuilt/types.d.ts
1234
- /**
1235
- * Type definitions for prebuilt type system.
1236
- *
1237
- * These types enable looking up pre-computed types from a registry
1238
- * instead of relying on complex type inference that may be lost
1239
- * when bundling with tools like tsdown.
1240
- *
1241
- * @module
1242
- */
1243
- /**
1244
- * Registry mapping fragment/operation keys to their inferred types.
1245
- * Generated by the builder and used by prebuilt composers.
1246
- */
1247
- type PrebuiltTypeRegistry = {
1248
- readonly fragments: {
1249
- readonly [key: string]: {
1250
- readonly input: unknown;
1251
- readonly output: object;
1252
- };
1253
- };
1254
- readonly operations: {
1255
- readonly [key: string]: {
1256
- readonly input: object;
1257
- readonly output: object;
1258
- };
1259
- };
1260
- };
1261
- /**
1262
- * Empty registry type for when no prebuilt types are available.
1263
- */
1264
- type EmptyPrebuiltTypeRegistry = {
1265
- readonly fragments: Record<string, never>;
1266
- readonly operations: Record<string, never>;
1267
- };
1268
- /**
1269
- * Extract the input type for a fragment from the registry.
1270
- */
1271
- type PrebuiltFragmentInput<TRegistry extends PrebuiltTypeRegistry, TKey$1 extends keyof TRegistry["fragments"] & string> = TRegistry["fragments"][TKey$1]["input"];
1272
- /**
1273
- * Extract the output type for a fragment from the registry.
1274
- */
1275
- type PrebuiltFragmentOutput<TRegistry extends PrebuiltTypeRegistry, TKey$1 extends keyof TRegistry["fragments"] & string> = TRegistry["fragments"][TKey$1]["output"];
1276
- /**
1277
- * Extract the input type for an operation from the registry.
1278
- */
1279
- type PrebuiltOperationInput<TRegistry extends PrebuiltTypeRegistry, TKey$1 extends keyof TRegistry["operations"] & string> = TRegistry["operations"][TKey$1]["input"];
1280
- /**
1281
- * Extract the output type for an operation from the registry.
1282
- */
1283
- type PrebuiltOperationOutput<TRegistry extends PrebuiltTypeRegistry, TKey$1 extends keyof TRegistry["operations"] & string> = TRegistry["operations"][TKey$1]["output"];
1284
- /**
1285
- * Check if a key exists in the fragment registry.
1286
- */
1287
- type HasPrebuiltFragment<TRegistry extends PrebuiltTypeRegistry, TKey$1 extends string> = TKey$1 extends keyof TRegistry["fragments"] ? true : false;
1288
- /**
1289
- * Check if a key exists in the operation registry.
1290
- */
1291
- type HasPrebuiltOperation<TRegistry extends PrebuiltTypeRegistry, TKey$1 extends string> = TKey$1 extends keyof TRegistry["operations"] ? true : false;
1292
- //#endregion
1293
- //#region packages/core/src/composer/prebuilt-composer.d.ts
1294
- /**
1295
- * Resolves the output type for a prebuilt element.
1296
- *
1297
- * For Operations: Looks up by operation name in the registry
1298
- * For Fragments: Looks up by fragment key in the registry
1299
- * Falls back to the element's original type if not found in registry
1300
- */
1301
- type ResolvePrebuiltElement<TElement, TPrebuilt extends PrebuiltTypeRegistry> = TElement extends Operation<infer TOperationType extends OperationType, infer TOperationName extends string, infer TVariableNames extends string[], any, infer TFields extends Partial<AnyFields>, any> ? TOperationName extends keyof TPrebuilt["operations"] ? Operation<TOperationType, TOperationName, TVariableNames, TPrebuilt["operations"][TOperationName]["input"] & AnyConstAssignableInput, TFields, TPrebuilt["operations"][TOperationName]["output"] & object> : TElement : TElement extends Fragment<infer TTypeName extends string, any, infer TFields extends Partial<AnyFields>, any, infer TKey extends string | undefined> ? TKey extends keyof TPrebuilt["fragments"] ? Fragment<TTypeName, TPrebuilt["fragments"][TKey]["input"] extends infer TInput ? TInput extends AnyAssignableInput ? Partial<TInput> : void : void, TFields, TPrebuilt["fragments"][TKey]["output"] & object, TKey> : TElement : TElement;
1302
- /**
1303
- * Prebuilt element composer that resolves types from a registry.
1304
- */
1305
- type PrebuiltGqlElementComposer<TContext, TPrebuilt extends PrebuiltTypeRegistry> = <TResult extends AnyFragment | Operation<OperationType, string, string[], AnyConstAssignableInput, AnyFields, object>>(composeElement: (context: TContext) => TResult) => ResolvePrebuiltElement<TResult, TPrebuilt>;
1306
- /**
1307
- * Prebuilt element composer with schema access.
1308
- *
1309
- * Extends the prebuilt composer function with a `$schema` property that provides
1310
- * runtime access to the schema definition.
1311
- */
1312
- type PrebuiltGqlElementComposerWithSchema<TContext, TPrebuilt extends PrebuiltTypeRegistry, TSchema extends AnyGraphqlSchema> = PrebuiltGqlElementComposer<TContext, TPrebuilt> & {
1313
- /**
1314
- * The GraphQL schema definition used by this composer.
1315
- */
1316
- readonly $schema: TSchema;
1317
- };
1318
- /**
1319
- * Creates a prebuilt GQL element composer for a given schema.
1320
- *
1321
- * This composer has the same runtime behavior as `createGqlElementComposer`,
1322
- * but the returned elements have their types resolved from the PrebuiltTypeRegistry
1323
- * instead of using complex type inference.
1324
- *
1325
- * Use this when bundling with tools like tsdown that may lose type information.
1326
- *
1327
- * @param schema - The GraphQL schema definition
1328
- * @param options - Configuration including input type methods and optional adapter
1329
- * @returns Prebuilt element composer function
1330
- *
1331
- * @example
1332
- * ```typescript
1333
- * // Generated by codegen in prebuilt/index.ts
1334
- * import type { PrebuiltTypes } from "./types";
1335
- *
1336
- * const gql = createPrebuiltGqlElementComposer<
1337
- * Schema,
1338
- * PrebuiltTypes,
1339
- * FragmentBuilders,
1340
- * DirectiveMethods,
1341
- * Context
1342
- * >(schema, { inputTypeMethods });
1343
- *
1344
- * // Types are resolved from PrebuiltTypes registry
1345
- * const GetUser = gql(({ query }) =>
1346
- * query.operation({
1347
- * name: "GetUser",
1348
- * fields: ({ f }) => ({ ...f.user({ id: "1" })(({ f }) => ({ ...f.id() })) }),
1349
- * })
1350
- * );
1351
- * // GetUser.$infer.output is PrebuiltTypes["operations"]["GetUser"]["output"]
1352
- * ```
1353
- */
1354
- declare const createPrebuiltGqlElementComposer: <TSchema extends AnyGraphqlSchema, TPrebuilt extends PrebuiltTypeRegistry, TFragmentBuilders, TDirectiveMethods extends StandardDirectives, TContext, TAdapter extends AnyAdapter = DefaultAdapter>(schema: NoInfer<TSchema>, options: GqlElementComposerOptions<NoInfer<TSchema>, NoInfer<TDirectiveMethods>, NoInfer<TAdapter>>) => PrebuiltGqlElementComposerWithSchema<TContext, TPrebuilt, TSchema>;
1273
+ }) => Operation<TOperationType, TOperationName, (keyof TVarDefinitions & string)[], ConstAssignableInput<TSchema, TVarDefinitions>, TFields, InferFields<TSchema, TFields>>;
1355
1274
  //#endregion
1356
1275
  //#region packages/core/src/prebuilt/type-calculator.d.ts
1357
1276
  /**
@@ -1491,6 +1410,92 @@ declare const generateInputType: (schema: AnyGraphqlSchema, variableDefinitions:
1491
1410
  */
1492
1411
  declare const generateInputTypeFromSpecifiers: (schema: AnyGraphqlSchema, specifiers: InputTypeSpecifiers, options?: GenerateInputObjectTypeOptions) => string;
1493
1412
  //#endregion
1413
+ //#region packages/core/src/prebuilt/types.d.ts
1414
+ /**
1415
+ * Type definitions for prebuilt type system.
1416
+ *
1417
+ * These types enable looking up pre-computed types from a registry
1418
+ * instead of relying on complex type inference that may be lost
1419
+ * when bundling with tools like tsdown.
1420
+ *
1421
+ * @module
1422
+ */
1423
+ /**
1424
+ * Registry mapping fragment/operation keys to their inferred types.
1425
+ * Generated by the builder and used by prebuilt composers.
1426
+ */
1427
+ type PrebuiltTypeRegistry = {
1428
+ readonly fragments: {
1429
+ readonly [key: string]: {
1430
+ readonly input: unknown;
1431
+ readonly output: object;
1432
+ };
1433
+ };
1434
+ readonly operations: {
1435
+ readonly [key: string]: {
1436
+ readonly input: object;
1437
+ readonly output: object;
1438
+ };
1439
+ };
1440
+ };
1441
+ /**
1442
+ * Empty registry type for when no prebuilt types are available.
1443
+ */
1444
+ type EmptyPrebuiltTypeRegistry = {
1445
+ readonly fragments: Record<string, never>;
1446
+ readonly operations: Record<string, never>;
1447
+ };
1448
+ /**
1449
+ * Extract the input type for a fragment from the registry.
1450
+ */
1451
+ type PrebuiltFragmentInput<TRegistry extends PrebuiltTypeRegistry, TKey extends keyof TRegistry["fragments"] & string> = TRegistry["fragments"][TKey]["input"];
1452
+ /**
1453
+ * Extract the output type for a fragment from the registry.
1454
+ */
1455
+ type PrebuiltFragmentOutput<TRegistry extends PrebuiltTypeRegistry, TKey extends keyof TRegistry["fragments"] & string> = TRegistry["fragments"][TKey]["output"];
1456
+ /**
1457
+ * Extract the input type for an operation from the registry.
1458
+ */
1459
+ type PrebuiltOperationInput<TRegistry extends PrebuiltTypeRegistry, TKey extends keyof TRegistry["operations"] & string> = TRegistry["operations"][TKey]["input"];
1460
+ /**
1461
+ * Extract the output type for an operation from the registry.
1462
+ */
1463
+ type PrebuiltOperationOutput<TRegistry extends PrebuiltTypeRegistry, TKey extends keyof TRegistry["operations"] & string> = TRegistry["operations"][TKey]["output"];
1464
+ /**
1465
+ * Check if a key exists in the fragment registry.
1466
+ */
1467
+ type HasPrebuiltFragment<TRegistry extends PrebuiltTypeRegistry, TKey extends string> = TKey extends keyof TRegistry["fragments"] ? true : false;
1468
+ /**
1469
+ * Check if a key exists in the operation registry.
1470
+ */
1471
+ type HasPrebuiltOperation<TRegistry extends PrebuiltTypeRegistry, TKey extends string> = TKey extends keyof TRegistry["operations"] ? true : false;
1472
+ /**
1473
+ * Branded error type for missing prebuilt registry entries.
1474
+ *
1475
+ * This type intentionally produces a clear error message at compile time
1476
+ * when an operation or fragment is not found in the PrebuiltTypeRegistry.
1477
+ * Instead of silently falling back to inferred types, this forces users
1478
+ * to ensure all elements are properly registered via typegen.
1479
+ */
1480
+ type PrebuiltEntryNotFound<TKey extends string, TKind extends "fragment" | "operation"> = {
1481
+ readonly __error: "PREBUILT_ENTRY_NOT_FOUND";
1482
+ readonly __message: `${TKind} "${TKey}" not found in PrebuiltTypeRegistry. Run 'soda-gql typegen' to generate prebuilt types.`;
1483
+ readonly __key: TKey;
1484
+ readonly __kind: TKind;
1485
+ };
1486
+ /**
1487
+ * Branded error type for unrecognized element types in prebuilt resolution.
1488
+ *
1489
+ * This type is returned when ResolvePrebuiltElement receives a type that
1490
+ * is neither Operation nor Fragment. This should not happen in normal usage,
1491
+ * but provides a clear error message for debugging if it does.
1492
+ */
1493
+ type PrebuiltUnknownElement<TElement> = {
1494
+ readonly __error: "PREBUILT_UNKNOWN_ELEMENT";
1495
+ readonly __message: "Element type not recognized. Expected Operation or Fragment.";
1496
+ readonly __element: TElement;
1497
+ };
1498
+ //#endregion
1494
1499
  //#region packages/core/src/utils/hidden.d.ts
1495
1500
  declare const hidden: <T>() => (() => T);
1496
1501
  type Hidden<T> = () => T;
@@ -1498,5 +1503,5 @@ type Hidden<T> = () => T;
1498
1503
  //#region packages/core/src/utils/wrap-by-key.d.ts
1499
1504
  declare function wrapByKey<TName$1 extends string, TValue$1>(name: TName$1, value: TValue$1): { [K in TName$1]: TValue$1 };
1500
1505
  //#endregion
1501
- export { createFieldFactories as $, buildOperationTypeNode as $t, FragmentBuildersAll as A, AttachmentShape as At, VarBuilder as B, createStandardDirectives as Bt, PrebuiltFragmentInput as C, AnyDirectiveRef as Cn, NestedObjectFieldsBuilderTools as Ct, PrebuiltTypeRegistry as D, DirectiveRefInner as Dn, OptionalArg as Dt, PrebuiltOperationOutput as E, DirectiveRef as En, IfOmittable as Et, InputTypeMethod as F, DirectiveBuilder as Ft, createVarMethodFactory as G, createColocateHelper as Gt, VarSpecifier as H, ColocateHelper as Ht, InputTypeMethods as I, DirectiveMethod as It, withFragmentUsageCollection as J, Tuple as Jt, FragmentUsageRecord as K, StripFunctions as Kt, ResolveTypeFromMeta as L, StandardDirectives as Lt, GqlElementComposerOptions as M, AttachmentsTupleToIntersection as Mt, GqlElementComposerWithSchema as N, AnyDirectiveMethod as Nt, createOperationComposerFactory as O, SwitchIfOmittable as Ot, createGqlElementComposer as P, DirectiveArgValue as Pt, createVarRefs as Q, buildDocument as Qt, SchemaAwareGetNameAt as R, createDirectiveBuilder as Rt, HasPrebuiltOperation as S, GetAssignableType as Sn, NestedObjectFieldsBuilder as St, PrebuiltOperationInput as T, DirectiveLocation as Tn, EmptyObject as Tt, createVarBuilder as U, ColocatedEntries as Ut, VarBuilderMethods as V, isDirectiveRef as Vt, createVarMethod as W, ColocatedFields as Wt, createGqlFragmentComposers as X, buildArgumentValue as Xt, FragmentBuilderFor as Y, UnionToIntersection as Yt, createVarAssignments as Z, buildConstValueNode as Zt, PrebuiltGqlElementComposerWithSchema as _, AnyConstDirectiveAttachments as _n, FieldSelectionFactoryPrimitiveReturn as _t, TypeFormatters as a, AnyNestedUnion as an, Fragment as at, EmptyPrebuiltTypeRegistry as b, ConstAssignableInput as bn, FieldsBuilder as bt, calculateFieldsType as c, InferFields as cn, GqlElementAttachment as ct, generateInputTypeFromSpecifiers as d, AnyAssignableInputValue as dn, AnyFieldSelectionFactory as dt, buildWithTypeModifier as en, AnyOperation as et, getEnumType as f, AnyAssigningInput as fn, AnyFieldSelectionFactoryReturn as ft, PrebuiltGqlElementComposer as g, FieldArgumentValue as gn, FieldSelectionFactoryObjectReturn as gt, graphqlTypeToTypeScript as h, DeclaredVariables as hn, FieldSelectionFactoryFieldArguments as ht, GenerateInputObjectTypeOptions as i, AnyNestedObject as in, AnyFragment as it, GqlElementComposer as j, AttachmentToProperty as jt, ExtractMetadataAdapter as k, empty as kt, generateInputObjectType as l, AnyDirectiveAttachments as ln, GqlElementContext as lt, getScalarOutputType as m, AssignableInputByFieldName as mn, FieldSelectionFactory as mt, Hidden as n, AnyFieldSelection as nn, Operation as nt, applyTypeModifier as o, FieldSelectionTemplateOf as on, FragmentInferMeta as ot, getScalarInputType as p, AssignableInput as pn, FieldSelectionFactories as pt, recordFragmentUsage as q, StripSymbols as qt, hidden as r, AnyFields as rn, OperationInferMeta as rt, calculateFieldType as s, InferField as sn, GqlElement as st, wrapByKey as t, AbstractFieldSelection as tn, AnyOperationOf as tt, generateInputType as u, AnyAssignableInput as un, GqlElementDefinitionFactory as ut, ResolvePrebuiltElement as v, AnyConstAssignableInput as vn, FieldSelectionFactoryReturn as vt, PrebuiltFragmentOutput as w, AnyDirectiveRefBrand as wn, NestedUnionFieldsBuilder as wt, HasPrebuiltFragment as x, ConstAssignableInputValue as xn, FieldsBuilderTools as xt, createPrebuiltGqlElementComposer as y, AnyConstAssignableInputValue as yn, FieldSelectionFactoryUnionReturn as yt, SchemaAwareGetValueAt as z, createDirectiveMethod as zt };
1502
- //# sourceMappingURL=index-DaREzuQm.d.ts.map
1506
+ export { AnyOperation as $, buildOperationTypeNode as $t, GqlElementComposer as A, AttachmentToProperty as At, VarBuilderMethods as B, isDirectiveRef as Bt, getScalarInputType as C, AnyDirectiveRef as Cn, NestedUnionFieldsBuilder as Ct, AnyGqlContext as D, DirectiveRefInner as Dn, SwitchIfOmittable as Dt, createOperationComposerFactory as E, DirectiveRef as En, OptionalArg as Et, InputTypeMethods as F, DirectiveMethod as Ft, FragmentUsageRecord as G, StripFunctions as Gt, createVarBuilder as H, ColocatedEntries as Ht, ResolveTypeFromMeta as I, StandardDirectives as It, FragmentBuilderFor as J, UnionToIntersection as Jt, recordFragmentUsage as K, StripSymbols as Kt, SchemaAwareGetNameAt as L, createDirectiveBuilder as Lt, GqlElementComposerWithSchema as M, AnyDirectiveMethod as Mt, createGqlElementComposer as N, DirectiveArgValue as Nt, ExtractMetadataAdapter as O, empty as Ot, InputTypeMethod as P, DirectiveBuilder as Pt, createFieldFactories as Q, buildDocument as Qt, SchemaAwareGetValueAt as R, createDirectiveMethod as Rt, getEnumType as S, GetAssignableType as Sn, NestedObjectFieldsBuilderTools as St, graphqlTypeToTypeScript as T, DirectiveLocation as Tn, IfOmittable as Tt, createVarMethod as U, ColocatedFields as Ut, VarSpecifier as V, ColocateHelper as Vt, createVarMethodFactory as W, createColocateHelper as Wt, createVarAssignments as X, buildArgumentValue as Xt, createGqlFragmentComposers as Y, EnumLookup as Yt, createVarRefs as Z, buildConstValueNode as Zt, calculateFieldType as _, AnyConstDirectiveAttachments as _n, FieldSelectionFactoryReturn as _t, HasPrebuiltFragment as a, AnyNestedUnion as an, FragmentInferMeta as at, generateInputType as b, ConstAssignableInput as bn, FieldsBuilderTools as bt, PrebuiltFragmentInput as c, InferFields as cn, GqlElementContext as ct, PrebuiltOperationOutput as d, AnyAssignableInputValue as dn, AnyFieldSelectionFactoryReturn as dt, buildWithTypeModifier as en, AnyOperationOf as et, PrebuiltTypeRegistry as f, AnyAssigningInput as fn, FieldSelectionFactories as ft, applyTypeModifier as g, FieldArgumentValue as gn, FieldSelectionFactoryPrimitiveReturn as gt, TypeFormatters as h, DeclaredVariables as hn, FieldSelectionFactoryObjectReturn as ht, EmptyPrebuiltTypeRegistry as i, AnyNestedObject as in, Fragment as it, GqlElementComposerOptions as j, AttachmentsTupleToIntersection as jt, FragmentBuildersAll as k, AttachmentShape as kt, PrebuiltFragmentOutput as l, AnyDirectiveAttachments as ln, GqlElementDefinitionFactory as lt, GenerateInputObjectTypeOptions as m, AssignableInputByFieldName as mn, FieldSelectionFactoryFieldArguments as mt, Hidden as n, AnyFieldSelection as nn, OperationInferMeta as nt, HasPrebuiltOperation as o, FieldSelectionTemplateOf as on, GqlElement as ot, PrebuiltUnknownElement as p, AssignableInput as pn, FieldSelectionFactory as pt, withFragmentUsageCollection as q, Tuple as qt, hidden as r, AnyFields as rn, AnyFragment as rt, PrebuiltEntryNotFound as s, InferField as sn, GqlElementAttachment as st, wrapByKey as t, AbstractFieldSelection as tn, Operation as tt, PrebuiltOperationInput as u, AnyAssignableInput as un, AnyFieldSelectionFactory as ut, calculateFieldsType as v, AnyConstAssignableInput as vn, FieldSelectionFactoryUnionReturn as vt, getScalarOutputType as w, AnyDirectiveRefBrand as wn, EmptyObject as wt, generateInputTypeFromSpecifiers as x, ConstAssignableInputValue as xn, NestedObjectFieldsBuilder as xt, generateInputObjectType as y, AnyConstAssignableInputValue as yn, FieldsBuilder as yt, VarBuilder as z, createStandardDirectives as zt };
1507
+ //# sourceMappingURL=index-BcA2XPEk.d.ts.map