@soda-gql/core 0.13.2 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +39 -39
  2. package/dist/adapter.cjs +1 -3
  3. package/dist/adapter.cjs.map +1 -1
  4. package/dist/adapter.d.cts +3 -5
  5. package/dist/adapter.d.cts.map +1 -1
  6. package/dist/adapter.d.ts +3 -5
  7. package/dist/adapter.d.ts.map +1 -1
  8. package/dist/adapter.js +1 -3
  9. package/dist/adapter.js.map +1 -1
  10. package/dist/{index-PnGDsBZE.d.cts → index-Bdt5dpFG.d.cts} +26 -5
  11. package/dist/{index-PnGDsBZE.d.cts.map → index-Bdt5dpFG.d.cts.map} +1 -1
  12. package/dist/{index-8FNIWzv-.d.ts → index-CRWc3q9X.d.cts} +292 -598
  13. package/dist/index-CRWc3q9X.d.cts.map +1 -0
  14. package/dist/{index-CcqI7_ms.d.ts → index-D1T79XaT.d.ts} +26 -5
  15. package/dist/{index-CcqI7_ms.d.ts.map → index-D1T79XaT.d.ts.map} +1 -1
  16. package/dist/{index-DTUPt4z4.d.cts → index-DJ-yqsXz.d.ts} +292 -598
  17. package/dist/index-DJ-yqsXz.d.ts.map +1 -0
  18. package/dist/index.cjs +422 -495
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +9 -4
  21. package/dist/index.d.cts.map +1 -1
  22. package/dist/index.d.ts +9 -4
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +416 -491
  25. package/dist/index.js.map +1 -1
  26. package/dist/runtime.d.cts +2 -2
  27. package/dist/runtime.d.ts +2 -2
  28. package/dist/{schema-builder-B0DcWTQ-.d.ts → schema-builder-DTinHI5s.d.ts} +2 -2
  29. package/dist/{schema-builder-B0DcWTQ-.d.ts.map → schema-builder-DTinHI5s.d.ts.map} +1 -1
  30. package/dist/{schema-builder-C7bceM7O.d.cts → schema-builder-DfdeJY7k.d.cts} +2 -2
  31. package/dist/{schema-builder-C7bceM7O.d.cts.map → schema-builder-DfdeJY7k.d.cts.map} +1 -1
  32. package/package.json +1 -1
  33. package/dist/index-8FNIWzv-.d.ts.map +0 -1
  34. package/dist/index-DTUPt4z4.d.cts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { $ as PrimitiveTypeProfile, C as AnyFieldName, Ct as DeferredInputSpecifier, D as InferInputKind, Dt as DeferredOutputSpecifier, Et as DeferredOutputInferrableSpecifier, F as OperationType, Ft as InputTypeSpecifiers, H as AnyVarRef, Jt as ApplyTypeModifier, K as VarRef, Kt as VarSpecifier, L as ResolveInputProfileFromMeta, N as ObjectFieldRecord, Nt as InputTypeKind, O as InferInputProfile, Q as ObjectTypeProfile, Qt as ConstValue, S as AllInputTypeNames, T as AnyTypeName, Tt as DeferredOutputFieldWithArgs, U as AnyVarRefBrand, Vt as OutputTypeKind, X as GetConstAssignableType, Xt as TypeModifier, Yt as GetSignature, Z as GetModifiedType, a as DefaultMetadataAdapter, at as InputDepthOverrides, c as ExtractAdapterTypes, dt as GetSpecKind, en as FieldPath, et as TypeProfile, ft as GetSpecModifier, i as DefaultAdapter, k as InferOutputProfile, n as AnyAdapter, p as OperationDocumentTransformer, pt as GetSpecName, qt as VariableDefinitions, r as AnyMetadataAdapter, s as DocumentTransformer, t as Adapter, ut as GetSpecDefaultValue, w as AnyGraphqlSchema, xt as CreatableInputTypeKind, y as MetadataBuilder, yt as AnyDefaultValue } from "./index-CcqI7_ms.js";
1
+ import { $ as ObjectTypeProfile, $t as ConstValue, A as InferOutputProfile, Dt as DeferredOutputInferrableSpecifier, E as AnyTypeName, Et as DeferredOutputFieldWithArgs, Ht as OutputTypeKind, I as OperationType, It as InputTypeSpecifiers, Jt as VariableDefinitions, K as NestedValueElement, Ot as DeferredOutputSpecifier, Pt as InputTypeKind, Q as GetModifiedType, R as ResolveInputProfileFromMeta, S as VarRefTools, T as AnyGraphqlSchema, U as AnyVarRef, W as AnyVarRefBrand, Xt as GetSignature, Yt as ApplyTypeModifier, Z as GetConstAssignableType, Zt as TypeModifier, a as DefaultMetadataAdapter, bt as AnyDefaultValue, c as ExtractAdapterTypes, dt as GetSpecDefaultValue, et as PrimitiveTypeProfile, ft as GetSpecKind, i as DefaultAdapter, k as InferInputProfile, n as AnyAdapter, ot as InputDepthOverrides, p as OperationDocumentTransformer, pt as GetSpecModifier, q as VarRef, qt as VarSpecifier, r as AnyMetadataAdapter, s as DocumentTransformer, t as Adapter, tn as FieldPath, tt as TypeProfile, w as AnyFieldName, wt as DeferredInputSpecifier, y as MetadataBuilder } from "./index-Bdt5dpFG.cjs";
2
2
  import * as graphql0 from "graphql";
3
3
  import { ConstDirectiveNode, ConstValueNode, DocumentNode, EnumValueDefinitionNode, FieldDefinitionNode, InputValueDefinitionNode, NamedTypeNode, OperationTypeNode, SelectionSetNode, TypeNode, ValueNode, VariableDefinitionNode } from "graphql";
4
4
  import { TypedDocumentNode } from "@graphql-typed-document-node/core";
@@ -142,19 +142,14 @@ type AnyConstAssignableInput = {
142
142
  };
143
143
  type IsOptional$1<TSpecifier$1 extends DeferredInputSpecifier> = GetSpecModifier<TSpecifier$1> extends `${string}?` ? true : GetSpecDefaultValue<TSpecifier$1> extends AnyDefaultValue ? true : false;
144
144
  type IsOptionalVarSpec$1<TSpec$1 extends VarSpecifier> = TSpec$1["modifier"] extends `${string}?` ? true : TSpec$1["defaultValue"] extends AnyDefaultValue ? true : false;
145
- type ConstAssignableInput<TSchema$1 extends AnyGraphqlSchema, TSpecifiers extends InputTypeSpecifiers> = { readonly [K in keyof TSpecifiers as IsOptional$1<TSpecifiers[K]> extends true ? K : never]+?: ConstAssignableInputValue<TSchema$1, TSpecifiers[K]> } & { readonly [K in keyof TSpecifiers as IsOptional$1<TSpecifiers[K]> extends false ? K : never]-?: ConstAssignableInputValue<TSchema$1, TSpecifiers[K]> };
145
+ type ConstAssignableInput<TSchema extends AnyGraphqlSchema, TSpecifiers extends InputTypeSpecifiers> = { readonly [K in keyof TSpecifiers as IsOptional$1<TSpecifiers[K]> extends true ? K : never]+?: ConstAssignableInputValue<TSchema, TSpecifiers[K]> } & { readonly [K in keyof TSpecifiers as IsOptional$1<TSpecifiers[K]> extends false ? K : never]-?: ConstAssignableInputValue<TSchema, TSpecifiers[K]> };
146
146
  /**
147
147
  * Constant-only assignable input type for operation variables.
148
148
  * Works with VariableDefinitions (VarSpecifier objects) instead of deferred strings.
149
149
  */
150
- type ConstAssignableInputFromVarDefs<TSchema$1 extends AnyGraphqlSchema, TVarDefs extends VariableDefinitions> = { readonly [K in keyof TVarDefs as IsOptionalVarSpec$1<TVarDefs[K]> extends true ? K : never]+?: ConstAssignableInputValueFromVarSpec<TSchema$1, TVarDefs[K]> } & { readonly [K in keyof TVarDefs as IsOptionalVarSpec$1<TVarDefs[K]> extends false ? K : never]-?: ConstAssignableInputValueFromVarSpec<TSchema$1, TVarDefs[K]> };
151
- type ConstAssignableInputValue<TSchema$1 extends AnyGraphqlSchema, TSpecifier$1 extends DeferredInputSpecifier> = GetConstAssignableType<InferInputProfile<TSchema$1, TSpecifier$1>> & {};
152
- type ConstAssignableInputValueFromVarSpec<TSchema$1 extends AnyGraphqlSchema, TSpec$1 extends VarSpecifier> = GetConstAssignableType<ResolveInputProfileFromMeta<TSchema$1, TSpec$1["name"], TSpec$1["kind"], TSpec$1["modifier"]>> & {};
153
- //#endregion
154
- //#region packages/core/src/types/schema/const-directives.d.ts
155
- type AnyConstDirectiveAttachments = {
156
- readonly [key: string]: AnyConstAssignableInputValue;
157
- };
150
+ type ConstAssignableInputFromVarDefs<TSchema extends AnyGraphqlSchema, TVarDefs extends VariableDefinitions> = { readonly [K in keyof TVarDefs as IsOptionalVarSpec$1<TVarDefs[K]> extends true ? K : never]+?: ConstAssignableInputValueFromVarSpec<TSchema, TVarDefs[K]> } & { readonly [K in keyof TVarDefs as IsOptionalVarSpec$1<TVarDefs[K]> extends false ? K : never]-?: ConstAssignableInputValueFromVarSpec<TSchema, TVarDefs[K]> };
151
+ type ConstAssignableInputValue<TSchema extends AnyGraphqlSchema, TSpecifier$1 extends DeferredInputSpecifier> = GetConstAssignableType<InferInputProfile<TSchema, TSpecifier$1>> & {};
152
+ type ConstAssignableInputValueFromVarSpec<TSchema extends AnyGraphqlSchema, TSpec$1 extends VarSpecifier> = GetConstAssignableType<ResolveInputProfileFromMeta<TSchema, TSpec$1["name"], TSpec$1["kind"], TSpec$1["modifier"]>> & {};
158
153
  //#endregion
159
154
  //#region packages/core/src/types/fragment/assignable-input.d.ts
160
155
  type AnyAssignableInputValue = ConstValue | AnyVarRef | {
@@ -168,29 +163,29 @@ type AnyAssigningInput = {
168
163
  };
169
164
  type IsOptional<TSpecifier$1 extends DeferredInputSpecifier> = GetSpecModifier<TSpecifier$1> extends `${string}?` ? true : GetSpecDefaultValue<TSpecifier$1> extends AnyDefaultValue ? true : false;
170
165
  type IsOptionalVarSpec<TSpec$1 extends VarSpecifier> = TSpec$1["modifier"] extends `${string}?` ? true : TSpec$1["defaultValue"] extends AnyDefaultValue ? true : false;
171
- type AssignableInput<TSchema$1 extends AnyGraphqlSchema, TSpecifiers extends InputTypeSpecifiers> = { readonly [K in keyof TSpecifiers as IsOptional<TSpecifiers[K]> extends true ? K : never]+?: FieldArgumentValue<TSchema$1, TSpecifiers[K]> } & { readonly [K in keyof TSpecifiers as IsOptional<TSpecifiers[K]> extends false ? K : never]-?: FieldArgumentValue<TSchema$1, TSpecifiers[K]> };
166
+ type AssignableInput<TSchema extends AnyGraphqlSchema, TSpecifiers extends InputTypeSpecifiers> = { readonly [K in keyof TSpecifiers as IsOptional<TSpecifiers[K]> extends true ? K : never]+?: FieldArgumentValue<TSchema, TSpecifiers[K]> } & { readonly [K in keyof TSpecifiers as IsOptional<TSpecifiers[K]> extends false ? K : never]-?: FieldArgumentValue<TSchema, TSpecifiers[K]> };
172
167
  /**
173
168
  * Assignable input type for fragment/operation variables.
174
169
  * Works with VariableDefinitions (VarSpecifier objects) instead of deferred strings.
175
170
  */
176
- type AssignableInputFromVarDefs<TSchema$1 extends AnyGraphqlSchema, TVarDefs extends VariableDefinitions> = { readonly [K in keyof TVarDefs as IsOptionalVarSpec<TVarDefs[K]> extends true ? K : never]+?: FragmentVariableValue<TSchema$1, TVarDefs[K]> } & { readonly [K in keyof TVarDefs as IsOptionalVarSpec<TVarDefs[K]> extends false ? K : never]-?: FragmentVariableValue<TSchema$1, TVarDefs[K]> };
171
+ type AssignableInputFromVarDefs<TSchema extends AnyGraphqlSchema, TVarDefs extends VariableDefinitions> = { readonly [K in keyof TVarDefs as IsOptionalVarSpec<TVarDefs[K]> extends true ? K : never]+?: FragmentVariableValue<TSchema, TVarDefs[K]> } & { readonly [K in keyof TVarDefs as IsOptionalVarSpec<TVarDefs[K]> extends false ? K : never]-?: FragmentVariableValue<TSchema, TVarDefs[K]> };
177
172
  /**
178
173
  * Fragment variable value type using VarSpecifier properties.
179
174
  */
180
- type FragmentVariableValue<TSchema$1 extends AnyGraphqlSchema, TSpec$1 extends VarSpecifier> = GetAssignableType<ResolveInputProfileFromMeta<TSchema$1, TSpec$1["name"], TSpec$1["kind"], TSpec$1["modifier"]>>;
175
+ type FragmentVariableValue<TSchema extends AnyGraphqlSchema, TSpec$1 extends VarSpecifier> = GetAssignableType<ResolveInputProfileFromMeta<TSchema, TSpec$1["name"], TSpec$1["kind"], TSpec$1["modifier"]>>;
181
176
  /**
182
177
  * Field argument value type using typeName + kind for VarRef comparison.
183
178
  * Uses GetAssignableType which derives typeName + kind from the profile.
184
179
  * This name appears in TypeScript error messages when argument types don't match.
185
180
  */
186
- type FieldArgumentValue<TSchema$1 extends AnyGraphqlSchema, TSpecifier$1 extends DeferredInputSpecifier> = GetAssignableType<InferInputProfile<TSchema$1, TSpecifier$1>>;
181
+ type FieldArgumentValue<TSchema extends AnyGraphqlSchema, TSpecifier$1 extends DeferredInputSpecifier> = GetAssignableType<InferInputProfile<TSchema, TSpecifier$1>>;
187
182
  /**
188
183
  * Declared variables record for an operation or fragment.
189
184
  * Maps variable names to their VarRef types with proper branding.
190
185
  * This name appears in TypeScript error messages when variable access fails.
191
186
  */
192
- type DeclaredVariables<TSchema$1 extends AnyGraphqlSchema, TVarDefs extends VariableDefinitions> = { readonly [K in keyof TVarDefs]-?: VarRef<TypeProfile.DeclaredVariableType<ResolveInputProfileFromMeta<TSchema$1, TVarDefs[K]["name"], TVarDefs[K]["kind"], TVarDefs[K]["modifier"]>>> };
193
- type AssignableInputByFieldName<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"], TFieldName$1 extends keyof TSchema$1["object"][TTypeName]["fields"]> = AssignableInput<TSchema$1, TSchema$1["object"][TTypeName]["fields"][TFieldName$1]["arguments"]>;
187
+ type DeclaredVariables<TSchema extends AnyGraphqlSchema, TVarDefs extends VariableDefinitions> = { readonly [K in keyof TVarDefs]-?: VarRef<TypeProfile.DeclaredVariableType<ResolveInputProfileFromMeta<TSchema, TVarDefs[K]["name"], TVarDefs[K]["kind"], TVarDefs[K]["modifier"]>>> };
188
+ type AssignableInputByFieldName<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"], TFieldName extends keyof TSchema["object"][TTypeName]["fields"]> = AssignableInput<TSchema, TSchema["object"][TTypeName]["fields"][TFieldName]["arguments"]>;
194
189
  //#endregion
195
190
  //#region packages/core/src/types/fragment/directives.d.ts
196
191
  /**
@@ -226,11 +221,20 @@ type AnyNestedObjectExtended = {
226
221
  readonly [alias: string]: AnyFieldValue;
227
222
  };
228
223
  /**
229
- * Nested selection produced when resolving a union field. Supports shorthand syntax.
230
- * Maps union member type names to their field selections.
224
+ * Wrapper for a single union member's selection within a union field.
225
+ * Carries both the member's field selections and any directives applied
226
+ * to the inline fragment (e.g., `... on Article @defer { id }`).
227
+ */
228
+ type UnionMemberSelection<TFields$1 extends AnyNestedObjectExtended = AnyNestedObjectExtended, TDirectives extends AnyDirectiveAttachments = AnyDirectiveAttachments> = {
229
+ readonly fields: TFields$1;
230
+ readonly directives: TDirectives;
231
+ };
232
+ /**
233
+ * Nested selection produced when resolving a union field.
234
+ * Maps union member type names to their wrapped field selections with directives.
231
235
  */
232
236
  type AnyNestedUnion = {
233
- readonly [typeName: string]: AnyNestedObjectExtended | undefined;
237
+ readonly [typeName: string]: UnionMemberSelection | undefined;
234
238
  };
235
239
  /**
236
240
  * Structured union selection with explicit __typename flag.
@@ -251,9 +255,9 @@ type AnyFields = {
251
255
  *
252
256
  * Supports shorthand syntax in nested object selections via AnyNestedObjectExtended.
253
257
  */
254
- type AbstractFieldSelection<TTypeName extends AnyTypeName, TFieldName$1 extends AnyFieldName, TSpecifier$1 extends DeferredOutputFieldWithArgs, TArgs extends AnyAssignableInput, TDirectives extends AnyDirectiveAttachments, TObject extends AnyNestedObjectExtended | null, TUnionSelections extends AnyNestedUnion | null, TUnionTypename extends boolean> = {
258
+ type AbstractFieldSelection<TTypeName extends AnyTypeName, TFieldName extends AnyFieldName, TSpecifier$1 extends DeferredOutputFieldWithArgs, TArgs extends AnyAssignableInput, TDirectives extends AnyDirectiveAttachments, TObject extends AnyNestedObjectExtended | null, TUnionSelections extends AnyNestedUnion | null, TUnionTypename extends boolean> = {
255
259
  readonly parent: TTypeName;
256
- readonly field: TFieldName$1;
260
+ readonly field: TFieldName;
257
261
  readonly type: TSpecifier$1;
258
262
  readonly args: TArgs;
259
263
  readonly directives: TDirectives;
@@ -261,9 +265,9 @@ type AbstractFieldSelection<TTypeName extends AnyTypeName, TFieldName$1 extends
261
265
  readonly union: TUnionSelections extends AnyNestedUnion ? UnionSelection<TUnionSelections, TUnionTypename> : null;
262
266
  };
263
267
  /** Convenience alias to obtain a typed field reference from the schema. */
264
- type FieldSelectionTemplateOf<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string, TFieldName$1 extends keyof TSchema$1["object"][TTypeName]["fields"] & string, TRef extends DeferredOutputFieldWithArgs = TSchema$1["object"][TTypeName]["fields"][TFieldName$1]> = AbstractFieldSelection<TTypeName, TFieldName$1, TRef, AssignableInputByFieldName<TSchema$1, TTypeName, TFieldName$1>, AnyDirectiveAttachments, GetSpecKind<TRef["spec"]> extends "object" ? AnyNestedObjectExtended : null, GetSpecKind<TRef["spec"]> extends "union" ? AnyNestedUnion : null, boolean>;
268
+ type FieldSelectionTemplateOf<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string, TFieldName extends keyof TSchema["object"][TTypeName]["fields"] & string, TRef extends DeferredOutputFieldWithArgs = TSchema["object"][TTypeName]["fields"][TFieldName]> = AbstractFieldSelection<TTypeName, TFieldName, TRef, AssignableInputByFieldName<TSchema, TTypeName, TFieldName>, AnyDirectiveAttachments, GetSpecKind<TRef["spec"]> extends "object" ? AnyNestedObjectExtended : null, GetSpecKind<TRef["spec"]> extends "union" ? AnyNestedUnion : null, boolean>;
265
269
  /** Resolve the data shape produced by a set of field selections. */
266
- type InferFields<TSchema$1 extends AnyGraphqlSchema, TFields$1 extends AnyFields> = { [_ in TSchema$1["label"]]: { [TAliasName in keyof TFields$1]: InferField<TSchema$1, TFields$1[TAliasName]> } & {} }[TSchema$1["label"]];
270
+ type InferFields<TSchema extends AnyGraphqlSchema, TFields$1 extends AnyFields> = { [_ in TSchema["label"]]: { [TAliasName in keyof TFields$1]: InferField<TSchema, TFields$1[TAliasName]> } & {} }[TSchema["label"]];
267
271
  /**
268
272
  * Remove index signature from a type, keeping only literal string keys.
269
273
  * This is needed for inferring union selections where we want to iterate over explicit member keys.
@@ -273,24 +277,24 @@ type RemoveIndexSignature<T> = { [K in keyof T as string extends K ? never : K]:
273
277
  * Infer union type with __typename for all members when __typename: true is set.
274
278
  * Selected members get their fields + __typename, unselected members get only __typename.
275
279
  */
276
- type InferUnionWithTypename<TSchema$1 extends AnyGraphqlSchema, TUnionName$1 extends keyof TSchema$1["union"] & string, TSelections extends AnyNestedUnion, TSelectionsClean = RemoveIndexSignature<TSelections>> = { [TTypename in keyof TSchema$1["union"][TUnionName$1]["types"] & string]: TTypename extends keyof TSelectionsClean ? TSelectionsClean[TTypename] extends infer TFields extends AnyNestedObjectExtended ? InferFieldsExtended<TSchema$1, TTypename & (keyof TSchema$1["object"] & string), TFields> & {
280
+ type InferUnionWithTypename<TSchema extends AnyGraphqlSchema, TUnionName$1 extends keyof TSchema["union"] & string, TSelections extends AnyNestedUnion, TSelectionsClean = RemoveIndexSignature<TSelections>> = { [TTypename in keyof TSchema["union"][TUnionName$1]["types"] & string]: TTypename extends keyof TSelectionsClean ? TSelectionsClean[TTypename] extends UnionMemberSelection<infer TFields extends AnyNestedObjectExtended> ? InferFieldsExtended<TSchema, TTypename & (keyof TSchema["object"] & string), TFields> & {
277
281
  readonly __typename: TTypename;
278
282
  } : {
279
283
  readonly __typename: TTypename;
280
284
  } : {
281
285
  readonly __typename: TTypename;
282
- } }[keyof TSchema$1["union"][TUnionName$1]["types"] & string];
286
+ } }[keyof TSchema["union"][TUnionName$1]["types"] & string];
283
287
  /**
284
288
  * Infer union type without __typename catch-all (original behavior).
285
289
  * Only includes members that have explicit selections.
286
290
  */
287
- type InferUnionWithoutTypename<TSchema$1 extends AnyGraphqlSchema, TSelections extends AnyNestedUnion, TSelectionsClean = RemoveIndexSignature<TSelections>> = { [TTypename in keyof TSelectionsClean]: TSelectionsClean[TTypename] extends infer TFields extends AnyNestedObjectExtended ? InferFieldsExtended<TSchema$1, TTypename & (keyof TSchema$1["object"] & string), TFields> : never }[keyof TSelectionsClean];
291
+ type InferUnionWithoutTypename<TSchema extends AnyGraphqlSchema, TSelections extends AnyNestedUnion, TSelectionsClean = RemoveIndexSignature<TSelections>> = { [TTypename in keyof TSelectionsClean]: TSelectionsClean[TTypename] extends UnionMemberSelection<infer TFields extends AnyNestedObjectExtended> ? InferFieldsExtended<TSchema, TTypename & (keyof TSchema["object"] & string), TFields> : never }[keyof TSelectionsClean];
288
292
  /** Resolve the data shape for a single field reference, including nested objects/unions. */
289
- type InferField<TSchema$1 extends AnyGraphqlSchema, TSelection extends AnyFieldSelection> = TSelection["type"]["spec"] extends infer TSpec extends DeferredOutputSpecifier ? (TSpec extends `o|${infer TName extends string}|${string}` ? TSelection extends {
293
+ type InferField<TSchema extends AnyGraphqlSchema, TSelection extends AnyFieldSelection> = TSelection["type"]["spec"] extends infer TSpec extends DeferredOutputSpecifier ? (TSpec extends `o|${infer TName extends string}|${string}` ? TSelection extends {
290
294
  object: infer TNested extends AnyNestedObjectExtended;
291
- } ? ApplyTypeModifier<InferFieldsExtended<TSchema$1, TName, TNested>, GetSpecModifier<TSpec>> : never : never) | (TSpec extends `u|${infer TUnionName extends keyof TSchema$1["union"] & string}|${string}` ? TSelection extends {
295
+ } ? ApplyTypeModifier<InferFieldsExtended<TSchema, TName, TNested>, GetSpecModifier<TSpec>> : never : never) | (TSpec extends `u|${infer TUnionName extends keyof TSchema["union"] & string}|${string}` ? TSelection extends {
292
296
  union: infer TUnion extends AnyUnionSelection;
293
- } ? ApplyTypeModifier<TUnion["__typename"] extends true ? InferUnionWithTypename<TSchema$1, TUnionName, TUnion["selections"]> : InferUnionWithoutTypename<TSchema$1, TUnion["selections"]>, GetSpecModifier<TSpec>> : never : never) | (TSpec extends DeferredOutputInferrableSpecifier ? GetModifiedType<InferOutputProfile<TSchema$1, TSpec>, GetSpecModifier<TSpec>> : never) : never;
297
+ } ? ApplyTypeModifier<TUnion["__typename"] extends true ? InferUnionWithTypename<TSchema, TUnionName, TUnion["selections"]> : InferUnionWithoutTypename<TSchema, TUnion["selections"]>, GetSpecModifier<TSpec>> : never : never) | (TSpec extends DeferredOutputInferrableSpecifier ? GetModifiedType<InferOutputProfile<TSchema, TSpec>, GetSpecModifier<TSpec>> : never) : never;
294
298
  /**
295
299
  * Shorthand value for scalar/enum fields without args or directives.
296
300
  * Only `true` is valid - use factory syntax for args/directives.
@@ -315,26 +319,26 @@ type RequiredKeys<T> = { [K in keyof T]-?: {} extends Pick<T, K> ? never : K }[k
315
319
  /**
316
320
  * Check if a field has no required arguments.
317
321
  */
318
- type HasNoRequiredArgs<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string, TFieldName$1 extends keyof TSchema$1["object"][TTypeName]["fields"] & string> = keyof RequiredKeys<AssignableInputByFieldName<TSchema$1, TTypeName, TFieldName$1>> extends never ? true : false;
322
+ type HasNoRequiredArgs<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string, TFieldName extends keyof TSchema["object"][TTypeName]["fields"] & string> = keyof RequiredKeys<AssignableInputByFieldName<TSchema, TTypeName, TFieldName>> extends never ? true : false;
319
323
  /**
320
324
  * Validate that shorthand `true` is only used for fields without required arguments.
321
325
  * Fields with required arguments must use factory syntax.
322
326
  */
323
- type ValidateShorthand<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string, TFieldName$1 extends string, TValue$1> = TValue$1 extends true ? TFieldName$1 extends keyof TSchema$1["object"][TTypeName]["fields"] & string ? HasNoRequiredArgs<TSchema$1, TTypeName, TFieldName$1> extends true ? true : never : never : TValue$1;
327
+ type ValidateShorthand<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string, TFieldName extends string, TValue$1> = TValue$1 extends true ? TFieldName extends keyof TSchema["object"][TTypeName]["fields"] & string ? HasNoRequiredArgs<TSchema, TTypeName, TFieldName> extends true ? true : never : never : TValue$1;
324
328
  /**
325
329
  * Infer the output type for a scalar/enum field by looking up the schema.
326
330
  * Used for shorthand syntax where field type info is not embedded in the value.
327
331
  */
328
- type InferScalarFieldByName<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string, TFieldName$1 extends keyof TSchema$1["object"][TTypeName]["fields"]> = TSchema$1["object"][TTypeName]["fields"][TFieldName$1] extends infer TSpecifier extends DeferredOutputInferrableSpecifier ? GetModifiedType<InferOutputProfile<TSchema$1, TSpecifier>, GetSpecModifier<TSpecifier>> : never;
332
+ type InferScalarFieldByName<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string, TFieldName extends keyof TSchema["object"][TTypeName]["fields"]> = TSchema["object"][TTypeName]["fields"][TFieldName] extends infer TSpecifier extends DeferredOutputInferrableSpecifier ? GetModifiedType<InferOutputProfile<TSchema, TSpecifier>, GetSpecModifier<TSpecifier>> : never;
329
333
  /**
330
334
  * Infer the output type for a single field value (shorthand or factory return).
331
335
  */
332
- type InferFieldValue<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string, TFieldKey extends string, TValue$1> = TValue$1 extends true ? TFieldKey extends keyof TSchema$1["object"][TTypeName]["fields"] & string ? ValidateShorthand<TSchema$1, TTypeName, TFieldKey, TValue$1> extends true ? InferScalarFieldByName<TSchema$1, TTypeName, TFieldKey> : never : never : TValue$1 extends AnyFieldSelection ? InferField<TSchema$1, TValue$1> : never;
336
+ type InferFieldValue<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string, TFieldKey extends string, TValue$1> = TValue$1 extends true ? TFieldKey extends keyof TSchema["object"][TTypeName]["fields"] & string ? ValidateShorthand<TSchema, TTypeName, TFieldKey, TValue$1> extends true ? InferScalarFieldByName<TSchema, TTypeName, TFieldKey> : never : never : TValue$1 extends AnyFieldSelection ? InferField<TSchema, TValue$1> : never;
333
337
  /**
334
338
  * Infer fields with shorthand support.
335
339
  * Requires TTypeName to look up field types when value is shorthand (true).
336
340
  */
337
- type InferFieldsExtended<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string, TFields$1 extends AnyFieldsExtended> = { [_ in TSchema$1["label"]]: { [K in keyof TFields$1]: InferFieldValue<TSchema$1, TTypeName, K & string, TFields$1[K]> } & {} }[TSchema$1["label"]];
341
+ type InferFieldsExtended<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string, TFields$1 extends AnyFieldsExtended> = { [_ in TSchema["label"]]: { [K in keyof TFields$1]: InferFieldValue<TSchema, TTypeName, K & string, TFields$1[K]> } & {} }[TSchema["label"]];
338
342
  //#endregion
339
343
  //#region packages/core/src/utils/deferred-specifier-parser.d.ts
340
344
  type ParsedInputSpecifier = {
@@ -411,25 +415,12 @@ declare const buildConstValueNode: (value: ConstValue, enumLookup: EnumLookup) =
411
415
  * followed by `[]?` or `[]!` pairs for lists.
412
416
  *
413
417
  * @example
414
- * - `"!"` `String!`
415
- * - `"?"` `String`
416
- * - `"![]!"` `[String!]!`
417
- * - `"?[]?"` `[String]`
418
+ * - `"!"` -> `String!`
419
+ * - `"?"` -> `String`
420
+ * - `"![]!"` -> `[String!]!`
421
+ * - `"?[]?"` -> `[String]`
418
422
  */
419
423
  declare const buildWithTypeModifier: (modifier: TypeModifier, buildType: () => NamedTypeNode) => TypeNode;
420
- /**
421
- * VarSpecifier shape from $var() at runtime.
422
- * Operation variables use structured objects, not deferred strings.
423
- */
424
- type AnyVarSpecifier = {
425
- kind: "scalar" | "enum" | "input";
426
- name: string;
427
- modifier: TypeModifier;
428
- defaultValue: null | {
429
- default: ConstValue;
430
- };
431
- directives: Record<string, unknown>;
432
- };
433
424
  /**
434
425
  * Converts an operation type string to a GraphQL AST OperationTypeNode.
435
426
  */
@@ -444,14 +435,15 @@ declare const buildOperationTypeNode: (operation: OperationType) => OperationTyp
444
435
  * @param options - Operation configuration (name, type, variables, fields, schema)
445
436
  * @returns TypedDocumentNode with inferred input/output types
446
437
  */
447
- declare const buildDocument: <TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string, TFields$1 extends AnyFieldsExtended, TVarDefinitions$1 extends VariableDefinitions>(options: {
438
+ declare const buildDocument: <TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string, TFields$1 extends AnyFieldsExtended, TVarDefinitions extends VariableDefinitions>(options: {
448
439
  operationName: string;
449
440
  operationType: OperationType;
450
441
  operationTypeName: TTypeName;
451
- variables: TVarDefinitions$1;
442
+ variableDefinitionNodes?: readonly VariableDefinitionNode[];
443
+ variables: TVarDefinitions;
452
444
  fields: TFields$1;
453
- schema: TSchema$1;
454
- }) => TypedDocumentNode<InferFieldsExtended<TSchema$1, TTypeName, TFields$1>, ConstAssignableInputFromVarDefs<TSchema$1, TVarDefinitions$1>>;
445
+ schema: TSchema;
446
+ }) => TypedDocumentNode<any, any>;
455
447
  //#endregion
456
448
  //#region packages/core/src/utils/type-utils.d.ts
457
449
  type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never;
@@ -480,13 +472,13 @@ type ColocatedFields<TEntries extends ColocatedEntries> = UnionToIntersection<{
480
472
  * @example
481
473
  * ```typescript
482
474
  * // In operation definition
483
- * query.operation({
484
- * name: "GetData",
485
- * fields: ({ $ }) => $colocate({
486
- * userCard: userCardFragment.spread({ userId: $.userId }),
487
- * posts: postsFragment.spread({ userId: $.userId }),
475
+ * query("GetData")({
476
+ * variables: `($userId: ID!)`,
477
+ * fields: ({ f, $ }) => $colocate({
478
+ * userCard: { ...f("user", { id: $.userId })(() => ({ ...userCardFragment.spread() })) },
479
+ * posts: { ...f("posts", { userId: $.userId })(() => ({ ...postsFragment.spread() })) },
488
480
  * }),
489
- * });
481
+ * })({});
490
482
  *
491
483
  * // In parser definition (same labels)
492
484
  * createExecutionResultParser({
@@ -498,6 +490,53 @@ type ColocatedFields<TEntries extends ColocatedEntries> = UnionToIntersection<{
498
490
  declare const createColocateHelper: () => <TEntries extends ColocatedEntries>(entries: TEntries) => ColocatedFields<TEntries>;
499
491
  type ColocateHelper = ReturnType<typeof createColocateHelper>;
500
492
  //#endregion
493
+ //#region packages/core/src/composer/fields-builder.d.ts
494
+ /** Builder callback for top-level field selections (has $ variable access) */
495
+ type FieldsBuilder<TFields$1 extends AnyFieldsExtended = AnyFieldsExtended> = (tools: {
496
+ f: FieldAccessorFunction;
497
+ $: Readonly<Record<string, AnyVarRef>>;
498
+ }) => TFields$1;
499
+ /** Builder callback for nested object field selections (no $ access) */
500
+ type NestedObjectFieldsBuilder<TFields$1 extends AnyFieldsExtended = AnyFieldsExtended> = (tools: {
501
+ f: FieldAccessorFunction;
502
+ }) => TFields$1;
503
+ /** Builder for union type selections with per-member field definitions */
504
+ type NestedUnionFieldsBuilder = {
505
+ [typeName: string]: NestedObjectFieldsBuilder | undefined;
506
+ } & {
507
+ __typename?: true;
508
+ };
509
+ /**
510
+ * Type-erased return from field accessor.
511
+ * The actual runtime shape is a function: for scalar/enum fields it takes no args,
512
+ * for object fields it takes a NestedObjectFieldsBuilder, for union fields a NestedUnionFieldsBuilder.
513
+ * This type preserves enough structure so that nested `({ f })` callbacks infer `f` properly.
514
+ */
515
+ /**
516
+ * Type-erased return from field accessor.
517
+ * For object fields: accepts NestedObjectFieldsBuilder (typed `{ f }` callback).
518
+ * For union fields and scalar thunks: uses catch-all signature.
519
+ */
520
+ type AnyFieldAccessorReturn = ((nest: NestedObjectFieldsBuilder) => any) & ((...args: any[]) => any);
521
+ /** Function-call field accessor: f("fieldName", args, extras) */
522
+ type FieldAccessorFunction = (fieldName: string, fieldArgs?: AnyFieldSelection["args"] | null | void, extras?: {
523
+ alias?: string;
524
+ directives?: AnyDirectiveRef[];
525
+ }) => AnyFieldAccessorReturn;
526
+ /**
527
+ * Creates a field accessor function for a given object type.
528
+ *
529
+ * Returns a function f("fieldName", args, extras) for building field selections.
530
+ * Factories are cached per schema+type to avoid recreation.
531
+ *
532
+ * @param schema - The GraphQL schema definition
533
+ * @param typeName - The object type name to create factories for
534
+ * @returns FieldAccessorFunction for building field selections
535
+ *
536
+ * @internal Used by operation and fragment composers
537
+ */
538
+ declare const createFieldFactories: <TSchema extends AnyGraphqlSchema>(schema: TSchema, typeName: string) => FieldAccessorFunction;
539
+ //#endregion
501
540
  //#region packages/core/src/types/element/attachment-types.d.ts
502
541
  /**
503
542
  * Shape constraint for attachment objects used in type utilities.
@@ -527,209 +566,13 @@ type AttachmentToProperty<TAttachment> = TAttachment extends {
527
566
  */
528
567
  type AttachmentsTupleToIntersection<TAttachments extends readonly AttachmentShape[]> = TAttachments extends readonly [infer First extends AttachmentShape, ...infer Rest extends readonly AttachmentShape[]] ? AttachmentToProperty<First> & AttachmentsTupleToIntersection<Rest> : unknown;
529
568
  //#endregion
530
- //#region packages/core/src/utils/empty-object.d.ts
531
- declare const __EMPTY_SYMBOL__: unique symbol;
532
- type EmptyObject = {
533
- readonly [__EMPTY_SYMBOL__]: never;
534
- };
535
- type IsEmpty<T> = keyof T extends never ? true : false;
536
- type IsOmittable<T> = {} extends T ? true : false;
537
- type IfOmittable<TTarget, TType> = IsOmittable<TTarget> extends true ? TType : never;
538
- type SwitchIfOmittable<TTarget, TTrue, TFalse> = IsOmittable<TTarget> extends true ? TTrue : TFalse;
539
- /**
540
- * Make argument optional based on type structure:
541
- * - Empty object (no keys) → void (must omit)
542
- * - All-optional object → T | void (can omit or provide)
543
- * - Has required fields → T (must provide)
544
- */
545
- type OptionalArg<T> = IsEmpty<T> extends true ? void : IsOmittable<T> extends true ? T | void : T;
546
- declare const empty: () => EmptyObject;
547
- //#endregion
548
- //#region packages/core/src/types/element/fields-builder.d.ts
549
- /**
550
- * Builder signature exposed to userland `model` and `slice` helpers. The
551
- * tooling `f`/`fields`/`_` aliases provide ergonomic access to GraphQL fields
552
- * while preserving the original schema information for inference.
553
- *
554
- * Supports both shorthand syntax (`id: true`) and factory syntax (`...f.id()`).
555
- */
556
- type FieldsBuilder<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string, TVariableDefinitions extends VariableDefinitions, TFields$1 extends AnyFieldsExtended> = (tools: NoInfer<FieldsBuilderTools<TSchema$1, TTypeName, TVariableDefinitions>>) => TFields$1;
557
- /**
558
- * Tools provided to field builder callbacks.
559
- * - `f`: Field selection factories for the current type
560
- * - `$`: Variable references for the current scope
561
- */
562
- type FieldsBuilderTools<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string, TVariableDefinitions extends VariableDefinitions> = {
563
- f: FieldSelectionFactories<TSchema$1, TTypeName>;
564
- $: DeclaredVariables<TSchema$1, TVariableDefinitions>;
565
- };
566
- /**
567
- * Builder for nested object field selections.
568
- * Used when a field returns an object type requiring sub-selections.
569
- *
570
- * Supports both shorthand syntax (`id: true`) and factory syntax (`...f.id()`).
571
- */
572
- type NestedObjectFieldsBuilder<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string, TFields$1 extends AnyFieldsExtended> = (tools: NoInfer<NestedObjectFieldsBuilderTools<TSchema$1, TTypeName>>) => TFields$1;
573
- /**
574
- * Tools for nested object builders (no variable access).
575
- * @internal
576
- */
577
- type NestedObjectFieldsBuilderTools<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string> = {
578
- f: FieldSelectionFactories<TSchema$1, TTypeName>;
579
- };
580
- /**
581
- * Builder for union type selections with per-member field definitions.
582
- * Supports shorthand syntax (`id: true`) within each member's field builder.
583
- * Use `__typename: true` to enable catch-all __typename discrimination for all union members.
584
- *
585
- * Note: The mapped type only includes union member names. The __typename flag is added via
586
- * intersection. TUnionFields will NOT capture __typename - use direct input inspection instead.
587
- */
588
- type NestedUnionFieldsBuilder<TSchema$1 extends AnyGraphqlSchema, TMemberName extends string, TUnionFields extends AnyNestedUnion> = { [TTypename in keyof TUnionFields & TMemberName]?: NestedObjectFieldsBuilder<TSchema$1, TTypename, NonNullable<TUnionFields[TTypename]> & AnyFieldsExtended> } & {
589
- __typename?: true;
590
- };
591
- /** Map each field to a factory capable of emitting fully-typed references. */
592
- type FieldSelectionFactories<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string> = { [TFieldName in keyof ObjectFieldRecord<TSchema$1, TTypeName> & string]: FieldSelectionFactory<TSchema$1, FieldSelectionTemplateOf<TSchema$1, TTypeName, TFieldName>> };
593
- /**
594
- * Type-erased field selection factory.
595
- * @internal
596
- */
597
- type AnyFieldSelectionFactory = <TAlias extends string | null = null>(fieldArgs: AnyAssignableInput | void, extras?: {
598
- alias?: TAlias;
599
- directives?: AnyDirectiveRef[];
600
- }) => AnyFieldSelectionFactoryReturn<TAlias>;
601
- /**
602
- * Factory function for creating a typed field selection.
603
- * Accepts field arguments and optional alias/directives.
604
- */
605
- type FieldSelectionFactory<TSchema$1 extends AnyGraphqlSchema, TSelection extends AnyFieldSelection> = <TAlias extends string | null = null>(fieldArgs: TSelection["args"] | IfOmittable<TSelection["args"], void | null>, extras?: {
606
- alias?: TAlias;
607
- directives?: AnyDirectiveRef[];
608
- }) => FieldSelectionFactoryReturn<TSchema$1, TSelection, TAlias>;
609
- /** Deferred specifier pattern for object types: o|{name}|{modifier} */
610
- type ObjectSpecifierPattern = `o|${string}|${string}`;
611
- /** Deferred specifier pattern for union types: u|{name}|{modifier} */
612
- type UnionSpecifierPattern = `u|${string}|${string}`;
613
- /** Deferred specifier pattern for primitive types (scalar, enum): s|{name}|{modifier} or e|{name}|{modifier} */
614
- type PrimitiveSpecifierPattern = `s|${string}|${string}` | `e|${string}|${string}`;
615
- /** Helper to extract spec from field type */
616
- type GetFieldTypeSpec<T> = T extends {
617
- spec: infer S;
618
- } ? S : never;
619
- type AnyFieldSelectionFactoryReturn<TAlias extends string | null> = FieldSelectionFactoryReturn<AnyGraphqlSchema, AnyFieldSelection & {
620
- type: {
621
- spec: ObjectSpecifierPattern;
622
- };
623
- }, TAlias> | FieldSelectionFactoryReturn<AnyGraphqlSchema, AnyFieldSelection & {
624
- type: {
625
- spec: UnionSpecifierPattern;
626
- };
627
- }, TAlias> | FieldSelectionFactoryReturn<AnyGraphqlSchema, AnyFieldSelection & {
628
- type: {
629
- spec: PrimitiveSpecifierPattern;
630
- };
631
- }, TAlias>;
632
- type FieldSelectionFactoryReturn<TSchema$1 extends AnyGraphqlSchema, TSelection extends AnyFieldSelection, TAlias extends string | null> = GetFieldTypeSpec<TSelection["type"]> extends ObjectSpecifierPattern ? FieldSelectionFactoryObjectReturn<TSchema$1, TSelection & {
633
- type: {
634
- spec: ObjectSpecifierPattern;
635
- };
636
- }, TAlias> : GetFieldTypeSpec<TSelection["type"]> extends UnionSpecifierPattern ? FieldSelectionFactoryUnionReturn<TSchema$1, TSelection & {
637
- type: {
638
- spec: UnionSpecifierPattern;
639
- };
640
- }, TAlias> : GetFieldTypeSpec<TSelection["type"]> extends PrimitiveSpecifierPattern ? FieldSelectionFactoryPrimitiveReturn<TSelection & {
641
- type: {
642
- spec: PrimitiveSpecifierPattern;
643
- };
644
- }, TAlias> : never;
645
- type FieldSelectionFactoryObjectReturn<TSchema$1 extends AnyGraphqlSchema, TSelection extends AnyFieldSelection & {
646
- type: {
647
- spec: ObjectSpecifierPattern;
648
- };
649
- }, TAlias extends string | null> = <TNested$1 extends AnyFieldsExtended>(nest: NestedObjectFieldsBuilder<TSchema$1, GetSpecName<TSelection["type"]["spec"]> & keyof TSchema$1["object"] & string, TNested$1>) => { [_ in TAlias extends null ? TSelection["field"] : TAlias]: AbstractFieldSelection<TSelection["parent"], TSelection["field"], TSelection["type"], TSelection["args"], TSelection["directives"], TNested$1, null, false> };
650
- /**
651
- * Remove __typename key from a type to get pure selections.
652
- */
653
- type OmitTypename<T> = { [K in keyof T as K extends "__typename" ? never : K]: T[K] };
654
- /**
655
- * Detect if T has __typename: true (not optional or missing).
656
- * Uses a pattern that checks if the property is exactly `true` after removing index signatures.
657
- */
658
- type InferTypenameFlag<T> = "__typename" extends keyof T ? (T["__typename"] extends true ? true : false) : false;
659
- /**
660
- * Constraint for union builder input that allows member builders and optional __typename.
661
- */
662
- type UnionBuilderInputConstraint<TSchema$1 extends AnyGraphqlSchema, TMemberName extends string> = { [K in TMemberName]?: NestedObjectFieldsBuilder<TSchema$1, K, AnyFieldsExtended> } & {
663
- __typename?: true;
664
- };
665
- type FieldSelectionFactoryUnionReturn<TSchema$1 extends AnyGraphqlSchema, TSelection extends AnyFieldSelection & {
666
- type: {
667
- spec: UnionSpecifierPattern;
668
- };
669
- }, TAlias extends string | null, TMemberName extends string = UnionMemberNameFromDeferred<TSchema$1, TSelection["type"]["spec"]>> = <TInput extends UnionBuilderInputConstraint<TSchema$1, TMemberName>>(nest: TInput) => { [_ in TAlias extends null ? TSelection["field"] : TAlias]: AbstractFieldSelection<TSelection["parent"], TSelection["field"], TSelection["type"], TSelection["args"], TSelection["directives"], null, OmitTypename<TInput> & AnyNestedUnion, InferTypenameFlag<TInput>> };
670
- /** Helper to get union member names from a deferred union specifier */
671
- type UnionMemberNameFromDeferred<TSchema$1 extends AnyGraphqlSchema, TSpecifier$1 extends DeferredOutputSpecifier> = GetSpecName<TSpecifier$1> extends keyof TSchema$1["union"] ? Extract<keyof TSchema$1["union"][GetSpecName<TSpecifier$1>]["types"], string> : never;
672
- type FieldSelectionFactoryPrimitiveReturn<TSelection extends AnyFieldSelection & {
673
- type: {
674
- spec: PrimitiveSpecifierPattern;
675
- };
676
- }, TAlias extends string | null> = { [_ in TAlias extends null ? TSelection["field"] : TAlias]: AbstractFieldSelection<TSelection["parent"], TSelection["field"], TSelection["type"], TSelection["args"], TSelection["directives"], null, null, false> };
677
- type FieldSelectionFactoryFieldArguments<TFieldSelectionTemplate extends AnyFieldSelection> = TFieldSelectionTemplate["args"] | IfOmittable<TFieldSelectionTemplate["args"], void | null>;
678
- //#endregion
679
569
  //#region packages/core/src/types/element/compat-spec.d.ts
680
- /**
681
- * Specification for a compat operation, storing unevaluated fieldsBuilder.
682
- * Created by `query.compat()`, `mutation.compat()`, `subscription.compat()`.
683
- *
684
- * The fieldsBuilder is stored unevaluated and will be evaluated when
685
- * `extend()` is called to create the final Operation.
686
- *
687
- * @template TSchema - The GraphQL schema type
688
- * @template TOperationType - The operation type ('query' | 'mutation' | 'subscription')
689
- * @template TOperationName - The operation name literal type
690
- * @template TVarDefinitions - The variable definitions type
691
- * @template TFields - The fields type returned by the fieldsBuilder
692
- *
693
- * @example
694
- * ```typescript
695
- * // This is created internally by query.compat()
696
- * const spec: CompatSpec<Schema, 'query', 'GetUser', { userId: VarSpec }, Fields> = {
697
- * schema,
698
- * operationType: 'query',
699
- * operationName: 'GetUser',
700
- * variables: { userId: varSpec },
701
- * fieldsBuilder: ({ f, $ }) => ({ ...f.user({ id: $.userId })(...) }),
702
- * };
703
- * ```
704
- */
705
- type CompatSpec<TSchema$1 extends AnyGraphqlSchema, TOperationType$1 extends OperationType, TOperationName$1 extends string, TVarDefinitions$1 extends VariableDefinitions, TFields$1 extends AnyFields> = {
706
- readonly schema: TSchema$1;
707
- readonly operationType: TOperationType$1;
708
- readonly operationName: TOperationName$1;
709
- readonly variables: TVarDefinitions$1;
710
- readonly fieldsBuilder: FieldsBuilder<TSchema$1, TSchema$1["operations"][TOperationType$1] & keyof TSchema$1["object"] & string, TVarDefinitions$1, TFields$1>;
711
- };
712
- /**
713
- * Type alias for any CompatSpec instance.
714
- */
715
- type AnyCompatSpec = CompatSpec<AnyGraphqlSchema, OperationType, string, VariableDefinitions, AnyFields>;
716
- /**
717
- * Extracts type information from a CompatSpec.
718
- * Used by extend() to infer types from the compat operation.
719
- */
720
- type ExtractCompatSpec<T> = T extends CompatSpec<infer TSchema, infer TOperationType, infer TOperationName, infer TVarDefinitions, infer TFields> ? {
721
- schema: TSchema;
722
- operationType: TOperationType;
723
- operationName: TOperationName;
724
- variables: TVarDefinitions;
725
- fields: TFields;
726
- } : never;
727
570
  /**
728
571
  * Specification for a tagged template compat operation.
729
572
  * Stores raw GraphQL source string instead of fieldsBuilder callback.
730
573
  * Created by `query.compat\`...\``, `mutation.compat\`...\``, `subscription.compat\`...\``.
731
574
  *
732
- * Unlike {@link CompatSpec}, this type is not generic — tagged template compat
575
+ * This type is not generic — tagged template compat
733
576
  * does not carry type-level field or variable information. Types come from typegen.
734
577
  *
735
578
  * The graphqlSource is stored raw (unparsed). Parsing happens inside extend()
@@ -741,16 +584,6 @@ type TemplateCompatSpec = {
741
584
  readonly operationName: string;
742
585
  readonly graphqlSource: string;
743
586
  };
744
- /**
745
- * Type guard to distinguish TemplateCompatSpec from CompatSpec at runtime.
746
- * Uses structural discrimination (presence of `graphqlSource` field).
747
- */
748
- declare const isTemplateCompatSpec: (spec: AnyCompatSpec | TemplateCompatSpec) => spec is TemplateCompatSpec;
749
- /**
750
- * Union type for specs that extend() can accept.
751
- * Includes both callback builder compat specs and tagged template compat specs.
752
- */
753
- type AnyExtendableSpec = AnyCompatSpec | TemplateCompatSpec;
754
587
  //#endregion
755
588
  //#region packages/core/src/types/element/lazy-evaluator.d.ts
756
589
  /**
@@ -920,6 +753,24 @@ declare class GqlDefine<TValue$1> extends GqlElement<DefineArtifact<TValue$1>, D
920
753
  static create<TValue$1>(factory: () => TValue$1 | Promise<TValue$1>): GqlDefine<TValue$1>;
921
754
  }
922
755
  //#endregion
756
+ //#region packages/core/src/utils/empty-object.d.ts
757
+ declare const __EMPTY_SYMBOL__: unique symbol;
758
+ type EmptyObject = {
759
+ readonly [__EMPTY_SYMBOL__]: never;
760
+ };
761
+ type IsEmpty<T> = keyof T extends never ? true : false;
762
+ type IsOmittable<T> = {} extends T ? true : false;
763
+ type IfOmittable<TTarget, TType> = IsOmittable<TTarget> extends true ? TType : never;
764
+ type SwitchIfOmittable<TTarget, TTrue, TFalse> = IsOmittable<TTarget> extends true ? TTrue : TFalse;
765
+ /**
766
+ * Make argument optional based on type structure:
767
+ * - Empty object (no keys) → void (must omit)
768
+ * - All-optional object → T | void (can omit or provide)
769
+ * - Has required fields → T (must provide)
770
+ */
771
+ type OptionalArg<T> = IsEmpty<T> extends true ? void : IsOmittable<T> extends true ? T | void : T;
772
+ declare const empty: () => EmptyObject;
773
+ //#endregion
923
774
  //#region packages/core/src/types/element/fragment.d.ts
924
775
  /**
925
776
  * Type alias for any Fragment instance.
@@ -948,7 +799,7 @@ declare const __FRAGMENT_BRAND__: unique symbol;
948
799
  /**
949
800
  * Represents a reusable GraphQL field selection on a specific type.
950
801
  *
951
- * Fragments are created via `gql(({ fragment }) => fragment.TypeName({ ... }))`.
802
+ * Fragments are created via `gql(({ fragment }) => fragment("Name", "TypeName")\`{ ... }\`())`.
952
803
  * Use `spread()` to include the fragment's fields in an operation.
953
804
  *
954
805
  * @template TTypeName - The GraphQL type this fragment selects from
@@ -977,15 +828,15 @@ declare class Fragment<TTypeName extends string, TVariables extends Partial<AnyA
977
828
  * Prefer using the `gql(({ fragment }) => ...)` API instead.
978
829
  * @internal
979
830
  */
980
- static create<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string, TVariableDefinitions extends VariableDefinitions, TFields$1 extends AnyFieldsExtended>(define: () => {
831
+ static create<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string, TVariableDefinitions extends VariableDefinitions, TFields$1 extends AnyFieldsExtended>(define: () => {
981
832
  typename: TTypeName;
982
833
  key: string | undefined;
983
- schemaLabel: TSchema$1["label"];
834
+ schemaLabel: TSchema["label"];
984
835
  variableDefinitions: TVariableDefinitions;
985
- spread: (...args: OptionalArg<AssignableInputFromVarDefs<TSchema$1, TVariableDefinitions>> extends void ? [] : [variables: OptionalArg<AssignableInputFromVarDefs<TSchema$1, TVariableDefinitions>>]) => TFields$1;
986
- }): Fragment<TTypeName, OptionalArg<AssignableInputFromVarDefs<TSchema$1, TVariableDefinitions>>, TFields$1 & {
836
+ spread: (...args: OptionalArg<AssignableInputFromVarDefs<TSchema, TVariableDefinitions>> extends void ? [] : [variables: OptionalArg<AssignableInputFromVarDefs<TSchema, TVariableDefinitions>>]) => TFields$1;
837
+ }): Fragment<TTypeName, OptionalArg<AssignableInputFromVarDefs<TSchema, TVariableDefinitions>>, TFields$1 & {
987
838
  [key: symbol]: never;
988
- }, InferFieldsExtended<TSchema$1, TTypeName, TFields$1> & {
839
+ }, InferFieldsExtended<TSchema, TTypeName, TFields$1> & {
989
840
  [key: symbol]: never;
990
841
  }>;
991
842
  }
@@ -998,7 +849,7 @@ type AnyOperation = AnyOperationOf<"query"> | AnyOperationOf<"mutation"> | AnyOp
998
849
  /**
999
850
  * Type alias for an Operation of a specific type.
1000
851
  */
1001
- type AnyOperationOf<TOperationType$1 extends OperationType> = Operation<TOperationType$1, string, string[], any, any, any>;
852
+ type AnyOperationOf<TOperationType extends OperationType> = Operation<TOperationType, string, string[], any, any, any>;
1002
853
  /**
1003
854
  * Type inference metadata for operations.
1004
855
  * Access via `typeof operation.$infer`.
@@ -1012,9 +863,9 @@ declare const __OPERATION_BRAND__: unique symbol;
1012
863
  * Internal artifact shape produced by operation evaluation.
1013
864
  * @internal
1014
865
  */
1015
- type OperationArtifact<TOperationType$1 extends OperationType, TOperationName$1 extends string, TVariableNames extends string[], TVariables extends Record<string, unknown>, TFields$1 extends Partial<AnyFieldsExtended>, TData extends object> = {
1016
- readonly operationType: TOperationType$1;
1017
- readonly operationName: TOperationName$1;
866
+ type OperationArtifact<TOperationType extends OperationType, TOperationName extends string, TVariableNames extends string[], TVariables extends Record<string, unknown>, TFields$1 extends Partial<AnyFieldsExtended>, TData extends object> = {
867
+ readonly operationType: TOperationType;
868
+ readonly operationName: TOperationName;
1018
869
  readonly schemaLabel: string;
1019
870
  readonly variableNames: TVariableNames;
1020
871
  readonly documentSource: () => TFields$1;
@@ -1024,7 +875,7 @@ type OperationArtifact<TOperationType$1 extends OperationType, TOperationName$1
1024
875
  /**
1025
876
  * Represents a GraphQL operation (query, mutation, or subscription).
1026
877
  *
1027
- * Operations are created via `gql(({ query }) => query.operation({ ... }))`.
878
+ * Operations are created via `gql(({ query }) => query("Name")\`{ ... }\`())`.
1028
879
  * Produces a TypedDocumentNode for type-safe execution with GraphQL clients.
1029
880
  *
1030
881
  * @template TOperationType - 'query' | 'mutation' | 'subscription'
@@ -1034,13 +885,13 @@ type OperationArtifact<TOperationType$1 extends OperationType, TOperationName$1
1034
885
  * @template TFields - Selected fields structure
1035
886
  * @template TData - Inferred response data type
1036
887
  */
1037
- declare class Operation<TOperationType$1 extends OperationType, TOperationName$1 extends string, TVariableNames extends string[], TVariables extends Record<string, unknown>, TFields$1 extends Partial<AnyFieldsExtended>, TData extends object> extends GqlElement<OperationArtifact<TOperationType$1, TOperationName$1, TVariableNames, TVariables, TFields$1, TData>, OperationInferMeta<TVariables, TData>> implements OperationArtifact<TOperationType$1, TOperationName$1, TVariableNames, TVariables, TFields$1, TData> {
888
+ declare class Operation<TOperationType extends OperationType, TOperationName extends string, TVariableNames extends string[], TVariables extends Record<string, unknown>, TFields$1 extends Partial<AnyFieldsExtended>, TData extends object> extends GqlElement<OperationArtifact<TOperationType, TOperationName, TVariableNames, TVariables, TFields$1, TData>, OperationInferMeta<TVariables, TData>> implements OperationArtifact<TOperationType, TOperationName, TVariableNames, TVariables, TFields$1, TData> {
1038
889
  private readonly [__OPERATION_BRAND__];
1039
890
  private constructor();
1040
891
  /** The operation type: 'query', 'mutation', or 'subscription'. */
1041
- get operationType(): TOperationType$1;
892
+ get operationType(): TOperationType;
1042
893
  /** The unique name of this operation. */
1043
- get operationName(): TOperationName$1;
894
+ get operationName(): TOperationName;
1044
895
  /** The schema label this operation belongs to. */
1045
896
  get schemaLabel(): string;
1046
897
  /** List of variable names defined for this operation. */
@@ -1059,51 +910,25 @@ declare class Operation<TOperationType$1 extends OperationType, TOperationName$1
1059
910
  * Prefer using the `gql(({ query }) => ...)` API instead.
1060
911
  * @internal
1061
912
  */
1062
- static create<TSchema$1 extends AnyGraphqlSchema, TOperationType$1 extends OperationType, TOperationName$1 extends string, TVariableDefinitions extends VariableDefinitions, TFields$1 extends AnyFieldsExtended>(define: (context: GqlElementContext | null) => {
1063
- operationType: TOperationType$1;
1064
- operationName: TOperationName$1;
1065
- schemaLabel: TSchema$1["label"];
913
+ static create<TSchema extends AnyGraphqlSchema, TOperationType extends OperationType, TOperationName extends string, TVariableDefinitions extends VariableDefinitions, TFields$1 extends AnyFieldsExtended>(define: (context: GqlElementContext | null) => {
914
+ operationType: TOperationType;
915
+ operationName: TOperationName;
916
+ schemaLabel: TSchema["label"];
1066
917
  variableNames: (keyof TVariableDefinitions & string)[];
1067
918
  documentSource: () => TFields$1;
1068
- document: TypedDocumentNode<InferFieldsExtended<TSchema$1, TSchema$1["operations"][TOperationType$1] & keyof TSchema$1["object"] & string, TFields$1>, ConstAssignableInputFromVarDefs<TSchema$1, TVariableDefinitions>>;
919
+ document: TypedDocumentNode<InferFieldsExtended<TSchema, TSchema["operations"][TOperationType] & keyof TSchema["object"] & string, TFields$1>, ConstAssignableInputFromVarDefs<TSchema, TVariableDefinitions>>;
1069
920
  metadata?: unknown;
1070
921
  } | Promise<{
1071
- operationType: TOperationType$1;
1072
- operationName: TOperationName$1;
1073
- schemaLabel: TSchema$1["label"];
922
+ operationType: TOperationType;
923
+ operationName: TOperationName;
924
+ schemaLabel: TSchema["label"];
1074
925
  variableNames: (keyof TVariableDefinitions & string)[];
1075
926
  documentSource: () => TFields$1;
1076
- document: TypedDocumentNode<InferFieldsExtended<TSchema$1, TSchema$1["operations"][TOperationType$1] & keyof TSchema$1["object"] & string, TFields$1>, ConstAssignableInputFromVarDefs<TSchema$1, TVariableDefinitions>>;
927
+ document: TypedDocumentNode<InferFieldsExtended<TSchema, TSchema["operations"][TOperationType] & keyof TSchema["object"] & string, TFields$1>, ConstAssignableInputFromVarDefs<TSchema, TVariableDefinitions>>;
1077
928
  metadata?: unknown;
1078
- }>): Operation<TOperationType$1, TOperationName$1, (keyof TVariableDefinitions & string)[], ConstAssignableInputFromVarDefs<TSchema$1, TVariableDefinitions>, TFields$1, InferFieldsExtended<TSchema$1, TSchema$1["operations"][TOperationType$1] & keyof TSchema$1["object"] & string, TFields$1>>;
929
+ }>): Operation<TOperationType, TOperationName, (keyof TVariableDefinitions & string)[], ConstAssignableInputFromVarDefs<TSchema, TVariableDefinitions>, TFields$1, InferFieldsExtended<TSchema, TSchema["operations"][TOperationType] & keyof TSchema["object"] & string, TFields$1>>;
1079
930
  }
1080
931
  //#endregion
1081
- //#region packages/core/src/composer/compat.d.ts
1082
- /**
1083
- * Options for creating a compat operation specification.
1084
- */
1085
- type CompatOptions<TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string, TOperationName$1 extends string, TVarDefinitions$1 extends VariableDefinitions, TFields$1 extends AnyFields> = {
1086
- /** The operation name */
1087
- name: TOperationName$1;
1088
- /** Optional variable definitions */
1089
- variables?: TVarDefinitions$1;
1090
- /** Field selection builder */
1091
- fields: FieldsBuilder<TSchema$1, TTypeName, TVarDefinitions$1, TFields$1>;
1092
- };
1093
- /**
1094
- * Creates a factory for composing compat operation specifications.
1095
- *
1096
- * Returns a function that creates a `GqlDefine<CompatSpec<...>>` storing
1097
- * the operation specification with unevaluated fieldsBuilder.
1098
- *
1099
- * @param schema - The GraphQL schema definition
1100
- * @param operationType - The operation type ('query' | 'mutation' | 'subscription')
1101
- * @returns Compat operation composer function
1102
- *
1103
- * @internal Used by `createGqlElementComposer`
1104
- */
1105
- declare const createCompatComposer: <TSchema$1 extends AnyGraphqlSchema, TOperationType$1 extends OperationType>(schema: NoInfer<TSchema$1>, operationType: TOperationType$1) => <TOperationName$1 extends string, TFields$1 extends AnyFields, TVarDefinitions$1 extends VariableDefinitions = {}>(options: CompatOptions<TSchema$1, TSchema$1["operations"][TOperationType$1] & keyof TSchema$1["object"] & string, TOperationName$1, TVarDefinitions$1, TFields$1>) => GqlDefine<CompatSpec<TSchema$1, TOperationType$1, TOperationName$1, TVarDefinitions$1, TFields$1>>;
1106
- //#endregion
1107
932
  //#region packages/core/src/composer/compat-tagged-template.d.ts
1108
933
  /** Tagged template function type for compat operations. */
1109
934
  type CompatTaggedTemplate = (strings: TemplateStringsArray, ...values: never[]) => GqlDefine<TemplateCompatSpec>;
@@ -1116,7 +941,7 @@ type CurriedCompatFunction = (operationName: string) => CompatTaggedTemplate;
1116
941
  * @param schema - The GraphQL schema definition
1117
942
  * @param operationType - The operation type (query, mutation, subscription)
1118
943
  */
1119
- declare const createCompatTaggedTemplate: <TSchema$1 extends AnyGraphqlSchema>(schema: TSchema$1, operationType: OperationType) => CurriedCompatFunction;
944
+ declare const createCompatTaggedTemplate: <TSchema extends AnyGraphqlSchema>(schema: TSchema, operationType: OperationType) => CurriedCompatFunction;
1120
945
  //#endregion
1121
946
  //#region packages/core/src/composer/directive-builder.d.ts
1122
947
  /**
@@ -1247,17 +1072,17 @@ declare const isDirectiveRef: (value: unknown) => value is AnyDirectiveRef;
1247
1072
  /**
1248
1073
  * Options for extending a compat spec into a full operation.
1249
1074
  */
1250
- type ExtendOptions<TSchema$1 extends AnyGraphqlSchema, TVarDefinitions$1 extends VariableDefinitions, TOperationMetadata, TAggregatedFragmentMetadata, TSchemaLevel> = {
1075
+ type ExtendOptions<_TSchema extends AnyGraphqlSchema, _TVarDefinitions extends VariableDefinitions, TOperationMetadata, TAggregatedFragmentMetadata, TSchemaLevel> = {
1251
1076
  /** Optional metadata builder */
1252
- metadata?: MetadataBuilder<DeclaredVariables<TSchema$1, TVarDefinitions$1>, TOperationMetadata, TAggregatedFragmentMetadata, TSchemaLevel>;
1077
+ metadata?: MetadataBuilder<Readonly<Record<string, AnyVarRef>>, TOperationMetadata, TAggregatedFragmentMetadata, TSchemaLevel>;
1253
1078
  /** Optional document transformer */
1254
1079
  transformDocument?: OperationDocumentTransformer<TOperationMetadata>;
1255
1080
  };
1256
1081
  /**
1257
1082
  * Creates a factory for extending compat specs into full operations.
1258
1083
  *
1259
- * The extend function takes a compat spec (created by `query.compat()`) and
1260
- * optional metadata/transformDocument options, then creates a full Operation.
1084
+ * The extend function takes a TemplateCompatSpec (created by `query.compat("Name")\`...\``)
1085
+ * and optional metadata/transformDocument options, then creates a full Operation.
1261
1086
  *
1262
1087
  * @param schema - The GraphQL schema definition
1263
1088
  * @param adapter - Optional metadata adapter for custom metadata handling
@@ -1266,22 +1091,7 @@ type ExtendOptions<TSchema$1 extends AnyGraphqlSchema, TVarDefinitions$1 extends
1266
1091
  *
1267
1092
  * @internal Used by `createGqlElementComposer`
1268
1093
  */
1269
- declare const createExtendComposer: <TSchema$1 extends AnyGraphqlSchema, TAdapter extends AnyMetadataAdapter = DefaultMetadataAdapter>(schema: NoInfer<TSchema$1>, adapter?: TAdapter, transformDocument?: DocumentTransformer<ExtractAdapterTypes<TAdapter>["schemaLevel"], ExtractAdapterTypes<TAdapter>["aggregatedFragmentMetadata"]>) => <TOperationType$1 extends OperationType, TOperationName$1 extends string, TVarDefinitions$1 extends VariableDefinitions, TFields$1 extends AnyFields, TOperationMetadata = unknown>(compat: GqlDefine<CompatSpec<TSchema$1, TOperationType$1, TOperationName$1, TVarDefinitions$1, TFields$1>> | GqlDefine<TemplateCompatSpec>, options?: ExtendOptions<TSchema$1, TVarDefinitions$1, TOperationMetadata, ExtractAdapterTypes<TAdapter>["aggregatedFragmentMetadata"], ExtractAdapterTypes<TAdapter>["schemaLevel"]>) => any;
1270
- //#endregion
1271
- //#region packages/core/src/composer/fields-builder.d.ts
1272
- /**
1273
- * Creates field selection factories for a given object type.
1274
- *
1275
- * Returns an object with a factory for each field defined on the type.
1276
- * Factories are cached per schema+type to avoid recreation.
1277
- *
1278
- * @param schema - The GraphQL schema definition
1279
- * @param typeName - The object type name to create factories for
1280
- * @returns Object mapping field names to their selection factories
1281
- *
1282
- * @internal Used by operation and fragment composers
1283
- */
1284
- declare const createFieldFactories: <TSchema$1 extends AnyGraphqlSchema, TTypeName extends keyof TSchema$1["object"] & string>(schema: TSchema$1, typeName: TTypeName) => FieldSelectionFactories<TSchema$1, TTypeName>;
1094
+ declare const createExtendComposer: <TSchema extends AnyGraphqlSchema, TAdapter extends AnyMetadataAdapter = DefaultMetadataAdapter>(schema: NoInfer<TSchema>, adapter?: TAdapter, transformDocument?: DocumentTransformer<ExtractAdapterTypes<TAdapter>["schemaLevel"], ExtractAdapterTypes<TAdapter>["aggregatedFragmentMetadata"]>) => <_TOperationType extends OperationType, _TOperationName extends string, TVarDefinitions extends VariableDefinitions, _TFields extends AnyFields, TOperationMetadata = unknown>(compat: GqlDefine<TemplateCompatSpec>, options?: ExtendOptions<TSchema, TVarDefinitions, TOperationMetadata, ExtractAdapterTypes<TAdapter>["aggregatedFragmentMetadata"], ExtractAdapterTypes<TAdapter>["schemaLevel"]>) => any;
1285
1095
  //#endregion
1286
1096
  //#region packages/core/src/graphql/schema-index.d.ts
1287
1097
  type OperationTypeNames = {
@@ -1336,37 +1146,53 @@ declare const createSchemaIndex: (document: DocumentNode) => SchemaIndex;
1336
1146
  type FragmentTemplateMetadataOptions = {
1337
1147
  metadata?: unknown | ((context: {
1338
1148
  $: Readonly<Record<string, unknown>>;
1149
+ $var: VarRefTools;
1339
1150
  }) => unknown | Promise<unknown>);
1340
1151
  };
1152
+ /** Context provided to operation metadata callbacks. */
1153
+ type OperationMetadataContext = {
1154
+ readonly $: Readonly<Record<string, any>>;
1155
+ readonly $var: VarRefTools;
1156
+ readonly document: graphql0.DocumentNode;
1157
+ readonly fragmentMetadata: any;
1158
+ readonly schemaLevel: any;
1159
+ };
1341
1160
  /** Options for operation TemplateResult resolution — receives full metadata pipeline context. */
1342
1161
  type OperationTemplateMetadataOptions = {
1343
- metadata?: unknown | ((context: {
1344
- $: Readonly<Record<string, unknown>>;
1345
- document: graphql0.DocumentNode;
1346
- fragmentMetadata: unknown;
1347
- schemaLevel: unknown;
1348
- }) => unknown | Promise<unknown>);
1162
+ metadata?: unknown;
1163
+ /** Optional per-operation document transformer */
1164
+ transformDocument?: OperationDocumentTransformer<unknown>;
1349
1165
  };
1350
1166
  /** @deprecated Use `FragmentTemplateMetadataOptions` or `OperationTemplateMetadataOptions` instead. */
1351
1167
  type TemplateResultMetadataOptions = FragmentTemplateMetadataOptions;
1352
1168
  /** Callable result from tagged template - resolves to Operation or Fragment. */
1353
1169
  type TemplateResult<TElement extends AnyOperationOf<OperationType> | AnyFragment, TOptions = (TElement extends AnyOperationOf<OperationType> ? OperationTemplateMetadataOptions : FragmentTemplateMetadataOptions)> = (options?: TOptions) => TElement;
1354
1170
  /** Tagged template function type for operations. */
1355
- type OperationTaggedTemplateFunction<TOperationType$1 extends OperationType = OperationType> = (strings: TemplateStringsArray, ...values: (AnyFragment | ((ctx: {
1171
+ type OperationTaggedTemplateFunction<TOperationType extends OperationType = OperationType> = (strings: TemplateStringsArray, ...values: (AnyFragment | ((ctx: {
1356
1172
  $: Readonly<Record<string, AnyVarRef>>;
1357
- }) => AnyFieldsExtended))[]) => TemplateResult<AnyOperationOf<TOperationType$1>>;
1358
- /** Curried operation function type: query("name")`($var: Type!) { fields }` */
1359
- type CurriedOperationFunction<TOperationType$1 extends OperationType = OperationType> = (operationName: string) => OperationTaggedTemplateFunction<TOperationType$1>;
1173
+ }) => AnyFieldsExtended))[]) => TemplateResult<AnyOperationOf<TOperationType>>;
1174
+ /** Options object for callback builder path */
1175
+ type OperationOptionsObject = {
1176
+ variables?: string;
1177
+ fields: FieldsBuilder;
1178
+ };
1179
+ /** Dispatch: tagged template OR options object */
1180
+ type OperationBuilderDispatch<TOperationType extends OperationType = OperationType> = OperationTaggedTemplateFunction<TOperationType> & ((options: OperationOptionsObject) => TemplateResult<AnyOperationOf<TOperationType>>);
1181
+ /** Curried operation function type: query("name")`($var: Type!) { fields }` or query("name")({ variables, fields }) */
1182
+ type CurriedOperationFunction<TOperationType extends OperationType = OperationType> = (operationName: string) => OperationBuilderDispatch<TOperationType>;
1360
1183
  /**
1361
- * Creates a curried tagged template function for a specific operation type.
1362
- * New API: `query("name")\`($var: Type!) { fields }\`` returns TemplateResult<Operation>.
1184
+ * Creates a curried function for a specific operation type.
1185
+ * Supports both tagged template and options object dispatch.
1186
+ *
1187
+ * Tagged template: `query("name")\`($var: Type!) { fields }\`` returns TemplateResult<Operation>.
1188
+ * Options object: `query("name")({ variables, fields })` returns TemplateResult<Operation>.
1363
1189
  *
1364
1190
  * @param schema - The GraphQL schema definition
1365
1191
  * @param operationType - The operation type (query, mutation, subscription)
1366
1192
  * @param metadataAdapter - Optional metadata adapter for metadata aggregation
1367
1193
  * @param adapterTransformDocument - Optional document transformer from adapter
1368
1194
  */
1369
- declare const createOperationTaggedTemplate: <TSchema$1 extends AnyGraphqlSchema, TOperationType$1 extends OperationType>(schema: TSchema$1, operationType: TOperationType$1, metadataAdapter?: AnyMetadataAdapter, adapterTransformDocument?: DocumentTransformer<any, any>) => CurriedOperationFunction<TOperationType$1>;
1195
+ declare const createOperationTaggedTemplate: <TSchema extends AnyGraphqlSchema, TOperationType extends OperationType>(schema: TSchema, operationType: TOperationType, metadataAdapter?: AnyMetadataAdapter, adapterTransformDocument?: DocumentTransformer<any, any>) => CurriedOperationFunction<TOperationType>;
1370
1196
  //#endregion
1371
1197
  //#region packages/core/src/composer/fragment-tagged-template.d.ts
1372
1198
  /** Tagged template function type for fragments. */
@@ -1400,7 +1226,7 @@ type CurriedFragmentFunction = (name: string, typeName: string) => FragmentTagge
1400
1226
  *
1401
1227
  * @param schema - The GraphQL schema definition
1402
1228
  */
1403
- declare function createFragmentTaggedTemplate<TSchema$1 extends AnyGraphqlSchema>(schema: TSchema$1): CurriedFragmentFunction;
1229
+ declare function createFragmentTaggedTemplate<TSchema extends AnyGraphqlSchema>(schema: TSchema): CurriedFragmentFunction;
1404
1230
  //#endregion
1405
1231
  //#region packages/core/src/composer/fragment-usage-context.d.ts
1406
1232
  /**
@@ -1433,155 +1259,6 @@ declare const withFragmentUsageCollection: <T>(fn: () => T) => {
1433
1259
  */
1434
1260
  declare const recordFragmentUsage: (record: FragmentUsageRecord) => void;
1435
1261
  //#endregion
1436
- //#region packages/core/src/composer/var-ref-tools.d.ts
1437
- /**
1438
- * Get the variable name from a VarRef.
1439
- * Throws if the VarRef contains a nested-value instead of a variable reference.
1440
- */
1441
- declare const getVarRefName: (varRef: AnyVarRef) => string;
1442
- /**
1443
- * Get the const value from a VarRef.
1444
- * Throws if the VarRef contains a variable reference instead of a nested-value,
1445
- * or if the nested-value contains any VarRef inside.
1446
- */
1447
- declare const getVarRefValue: (varRef: AnyVarRef) => ConstValue;
1448
- /**
1449
- * Path segment types for navigating nested values.
1450
- */
1451
- type PathSegment = string;
1452
- /**
1453
- * Gets the full path to a variable within a nested structure.
1454
- *
1455
- * Returns path segments starting with `$variableName` followed by
1456
- * property accesses within that variable's value.
1457
- *
1458
- * @example
1459
- * ```typescript
1460
- * getVariablePath($.filter, p => p.user.id)
1461
- * // Returns: ["$filter", "user", "id"]
1462
- * ```
1463
- */
1464
- declare const getVariablePath: <T, U>(varRef: VarRef<AnyVarRefBrand>, selector: (proxy: T) => U) => readonly PathSegment[];
1465
- //#endregion
1466
- //#region packages/core/src/composer/var-builder.d.ts
1467
- /**
1468
- * Type for the default value function for a variable.
1469
- */
1470
- type AssignableDefaultValue<TSchema$1 extends AnyGraphqlSchema, TKind extends CreatableInputTypeKind, TName$1 extends string, TModifier extends TypeModifier> = ConstAssignableInputValueFromVarSpec<TSchema$1, {
1471
- kind: TKind;
1472
- name: TName$1;
1473
- modifier: TModifier;
1474
- directives: {};
1475
- defaultValue: null;
1476
- }>;
1477
- /**
1478
- * Represents a variable definition with its type, modifier, and optional default.
1479
- *
1480
- * Created by `$var.TypeName("modifier", { default?: ... })` calls.
1481
- */
1482
- type GenericVarSpecifier<TKind extends CreatableInputTypeKind, TTypeName extends string, TModifier extends TypeModifier, TDefaultFn extends (() => unknown) | null, TDirectives extends AnyConstDirectiveAttachments> = {
1483
- kind: TKind;
1484
- name: TTypeName;
1485
- modifier: TModifier;
1486
- defaultValue: TDefaultFn extends null ? null : {
1487
- default: ReturnType<NonNullable<TDefaultFn>>;
1488
- };
1489
- directives: TDirectives;
1490
- };
1491
- /**
1492
- * Creates a factory function for generating schema-scoped variable methods.
1493
- * This ensures proper type inference for nested input objects by binding the schema type upfront.
1494
- *
1495
- * @example
1496
- * ```typescript
1497
- * const createMethod = createVarMethodFactory<typeof schema>();
1498
- * const inputTypeMethods = {
1499
- * Boolean: createMethod("scalar", "Boolean"),
1500
- * user_bool_exp: createMethod("input", "user_bool_exp"),
1501
- * } satisfies InputTypeMethods<typeof schema>;
1502
- * ```
1503
- */
1504
- declare const createVarMethodFactory: <TSchema$1 extends AnyGraphqlSchema>() => <TKind extends CreatableInputTypeKind, TTypeName extends AllInputTypeNames<TSchema$1>>(kind: TKind, typeName: TTypeName) => InputTypeMethod<TSchema$1, TKind, TTypeName>;
1505
- /**
1506
- * Type for a single input type method.
1507
- */
1508
- type InputTypeMethod<TSchema$1 extends AnyGraphqlSchema, TKind extends CreatableInputTypeKind, TTypeName extends string> = <const TModifier extends TypeModifier, const TDefaultFn extends (() => AssignableDefaultValue<TSchema$1, TKind, TTypeName, TModifier>) | null = null, const TDirectives extends AnyConstDirectiveAttachments = {}>(modifier: TModifier, extras?: {
1509
- default?: TDefaultFn & (() => AssignableDefaultValue<TSchema$1, TKind, TTypeName, TModifier>);
1510
- directives?: TDirectives;
1511
- }) => GenericVarSpecifier<TKind, TTypeName, TModifier, TDefaultFn, TDirectives>;
1512
- /**
1513
- * Type for all input type methods in a schema.
1514
- */
1515
- type InputTypeMethods<TSchema$1 extends AnyGraphqlSchema> = { [TName in AllInputTypeNames<TSchema$1>]: InputTypeMethod<TSchema$1, InferInputKind<TSchema$1, TName>, TName> };
1516
- /**
1517
- * Type for a wrapped variable method that includes the variable name in the result.
1518
- */
1519
- type WrappedVarMethod<TVarName extends string, TSchema$1 extends AnyGraphqlSchema, TKind extends CreatableInputTypeKind, TTypeName extends string> = <const TModifier extends TypeModifier, const TDefaultFn extends (() => AssignableDefaultValue<TSchema$1, TKind, TTypeName, TModifier>) | null = null, const TDirectives extends AnyConstDirectiveAttachments = {}>(modifier: TModifier, extras?: {
1520
- default?: TDefaultFn & (() => AssignableDefaultValue<TSchema$1, TKind, TTypeName, TModifier>);
1521
- directives?: TDirectives;
1522
- }) => { [K in TVarName]: GenericVarSpecifier<TKind, TTypeName, TModifier, TDefaultFn, TDirectives> };
1523
- /**
1524
- * Type for the variable builder methods for a specific variable name.
1525
- */
1526
- type VarBuilderMethods<TVarName extends string, TSchema$1 extends AnyGraphqlSchema> = { [TName in AllInputTypeNames<TSchema$1>]: WrappedVarMethod<TVarName, TSchema$1, InferInputKind<TSchema$1, TName>, TName> };
1527
- /**
1528
- * Variable builder function type.
1529
- *
1530
- * Call with a variable name to get type-specific methods.
1531
- * Also provides utilities for extracting values from VarRefs.
1532
- *
1533
- * @example
1534
- * ```typescript
1535
- * // In operation definition:
1536
- * variables: { userId: $var("userId").ID("!") }
1537
- *
1538
- * // In metadata builder:
1539
- * $var.getValueAt($.userId, p => p)
1540
- * ```
1541
- */
1542
- type VarBuilder<TSchema$1 extends AnyGraphqlSchema> = {
1543
- <TVarName extends string>(varName: TVarName): VarBuilderMethods<TVarName, TSchema$1>;
1544
- getName: typeof getVarRefName;
1545
- getValue: typeof getVarRefValue;
1546
- getNameAt: SchemaAwareGetNameAt<TSchema$1>;
1547
- getValueAt: SchemaAwareGetValueAt<TSchema$1>;
1548
- getVariablePath: typeof getVariablePath;
1549
- };
1550
- /**
1551
- * Resolves the TypeScript type from VarRef meta using schema.
1552
- * This is used for getValueAt/getNameAt with type structure resolution.
1553
- */
1554
- type ResolveTypeFromMeta<TSchema$1 extends AnyGraphqlSchema, TMeta extends AnyVarRefBrand> = TypeProfile.Type<ResolveInputProfileFromMeta<TSchema$1, TMeta["typeName"], TMeta["kind"], "!">>;
1555
- /**
1556
- * Schema-aware getValueAt type.
1557
- * Resolves type structure from schema using typeName + kind.
1558
- */
1559
- type SchemaAwareGetValueAt<TSchema$1 extends AnyGraphqlSchema> = <T extends AnyVarRefBrand, U>(varRef: VarRef<T>, selector: (proxy: ResolveTypeFromMeta<TSchema$1, T>) => U) => U;
1560
- /**
1561
- * Schema-aware getNameAt type.
1562
- * Resolves type structure from schema using typeName + kind.
1563
- */
1564
- type SchemaAwareGetNameAt<TSchema$1 extends AnyGraphqlSchema> = <T extends AnyVarRefBrand, U>(varRef: VarRef<T>, selector: (proxy: ResolveTypeFromMeta<TSchema$1, T>) => U) => string;
1565
- /**
1566
- * Type-erased input type methods for performance optimization.
1567
- * Uses permissive function signature to allow any generated inputTypeMethods.
1568
- * @internal
1569
- */
1570
- type AnyInputTypeMethods = Record<string, (...args: any[]) => unknown>;
1571
- /**
1572
- * Creates a variable builder using injected input type methods.
1573
- *
1574
- * The returned builder provides type-safe variable definition methods
1575
- * for all input types in the schema. Also includes utilities for
1576
- * extracting variable names and values from VarRefs.
1577
- *
1578
- * @param inputTypeMethods - Methods for each input type (from codegen)
1579
- * @returns Variable builder with methods for all input types
1580
- *
1581
- * @internal Used by `createGqlElementComposer`
1582
- */
1583
- declare const createVarBuilder: <TSchema$1 extends AnyGraphqlSchema>(inputTypeMethods: AnyInputTypeMethods) => VarBuilder<TSchema$1>;
1584
- //#endregion
1585
1262
  //#region packages/core/src/composer/gql-composer.d.ts
1586
1263
  /**
1587
1264
  * Function signature for composing GraphQL elements (fragments or operations).
@@ -1599,12 +1276,12 @@ type GqlElementComposer<TContext> = <TResult extends AnyFragment | AnyOperation
1599
1276
  * - Runtime schema introspection
1600
1277
  * - Debugging and tooling
1601
1278
  */
1602
- type GqlElementComposerWithSchema<TContext, TSchema$1 extends AnyGraphqlSchema> = GqlElementComposer<TContext> & {
1279
+ type GqlElementComposerWithSchema<TContext, TSchema extends AnyGraphqlSchema> = GqlElementComposer<TContext> & {
1603
1280
  /**
1604
1281
  * The GraphQL schema definition used by this composer.
1605
1282
  * Provides runtime access to schema types, operations, and metadata.
1606
1283
  */
1607
- readonly $schema: TSchema$1;
1284
+ readonly $schema: TSchema;
1608
1285
  };
1609
1286
  /**
1610
1287
  * Extracts the helpers type from an adapter.
@@ -1625,8 +1302,6 @@ type ExtractMetadataAdapter<TAdapter extends AnyAdapter> = TAdapter extends {
1625
1302
  type GqlElementComposerOptions<_TSchema extends AnyGraphqlSchema, TDirectiveMethods extends StandardDirectives, TAdapter extends AnyAdapter = DefaultAdapter> = {
1626
1303
  /** Optional adapter for custom helpers and metadata handling. */
1627
1304
  adapter?: TAdapter;
1628
- /** Methods for building variable type specifiers. */
1629
- inputTypeMethods: AnyInputTypeMethods;
1630
1305
  /** Optional custom directive methods (including schema-defined directives). */
1631
1306
  directiveMethods?: TDirectiveMethods;
1632
1307
  };
@@ -1636,71 +1311,41 @@ type GqlElementComposerOptions<_TSchema extends AnyGraphqlSchema, TDirectiveMeth
1636
1311
  * This is the main entry point for defining GraphQL operations and fragments.
1637
1312
  * The returned function provides a context with:
1638
1313
  * - `fragment`: Tagged template function for fragment definitions
1639
- * - `query/mutation/subscription`: Operation builders
1640
- * - `$var`: Variable definition helpers
1314
+ * - `query/mutation/subscription`: Operation builders (tagged template + options object + .compat)
1641
1315
  * - `$dir`: Field directive helpers (@skip, @include)
1642
1316
  * - `$colocate`: Fragment colocation utilities
1643
1317
  *
1644
1318
  * @param schema - The GraphQL schema definition
1645
- * @param options - Configuration including input type methods and optional adapter
1319
+ * @param options - Configuration including optional adapter
1646
1320
  * @returns Element composer function
1647
1321
  *
1648
1322
  * @example
1649
1323
  * ```typescript
1650
- * const gql = createGqlElementComposer(schema, { inputTypeMethods });
1651
- *
1652
- * const GetUser = gql(({ query, $var, $dir }) =>
1653
- * query.operation({
1654
- * name: "GetUser",
1655
- * variables: { showEmail: $var("showEmail").Boolean("!") },
1656
- * fields: ({ f, $ }) => ({
1657
- * ...f.user({ id: "1" })(({ f }) => ({
1658
- * ...f.name(),
1659
- * ...f.email({}, { directives: [$dir.skip({ if: $.showEmail })] }),
1660
- * })),
1661
- * }),
1662
- * })
1324
+ * const gql = createGqlElementComposer(schema, {});
1325
+ *
1326
+ * const GetUser = gql(({ query, $dir }) =>
1327
+ * query("GetUser")`($id: ID!) {
1328
+ * user(id: $id) { name email }
1329
+ * }`()
1663
1330
  * );
1664
1331
  * ```
1665
1332
  */
1666
- declare const createGqlElementComposer: <TSchema$1 extends AnyGraphqlSchema, TDirectiveMethods extends StandardDirectives, TAdapter extends AnyAdapter = DefaultAdapter>(schema: NoInfer<TSchema$1>, options: GqlElementComposerOptions<NoInfer<TSchema$1>, NoInfer<TDirectiveMethods>, NoInfer<TAdapter>>) => GqlElementComposerWithSchema<{
1333
+ declare const createGqlElementComposer: <TSchema extends AnyGraphqlSchema, TDirectiveMethods extends StandardDirectives, TAdapter extends AnyAdapter = DefaultAdapter>(schema: NoInfer<TSchema>, options: GqlElementComposerOptions<NoInfer<TSchema>, NoInfer<TDirectiveMethods>, NoInfer<TAdapter>>) => GqlElementComposerWithSchema<{
1667
1334
  fragment: CurriedFragmentFunction;
1668
1335
  query: CurriedOperationFunction<"query"> & {
1669
- operation: <TOperationName$1 extends string, TFields$1 extends AnyFieldsExtended, TVarDefinitions$1 extends VariableDefinitions = {}, TOperationMetadata = unknown>(options: {
1670
- name: TOperationName$1;
1671
- variables?: TVarDefinitions$1 | undefined;
1672
- metadata?: MetadataBuilder<DeclaredVariables<TSchema$1, TVarDefinitions$1>, TOperationMetadata, ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["aggregatedFragmentMetadata"], ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["schemaLevel"]> | undefined;
1673
- fields: FieldsBuilder<TSchema$1, TSchema$1["operations"]["query"] & keyof TSchema$1["object"] & string, TVarDefinitions$1, TFields$1>;
1674
- transformDocument?: OperationDocumentTransformer<TOperationMetadata> | undefined;
1675
- }) => Operation<"query", TOperationName$1, (keyof TVarDefinitions$1 & string)[], ConstAssignableInputFromVarDefs<TSchema$1, TVarDefinitions$1>, TFields$1, InferFieldsExtended<TSchema$1, TSchema$1["operations"]["query"] & keyof TSchema$1["object"] & string, TFields$1>>;
1676
1336
  compat: CurriedCompatFunction;
1677
1337
  };
1678
1338
  mutation: CurriedOperationFunction<"mutation"> & {
1679
- operation: <TOperationName$1 extends string, TFields$1 extends AnyFieldsExtended, TVarDefinitions$1 extends VariableDefinitions = {}, TOperationMetadata = unknown>(options: {
1680
- name: TOperationName$1;
1681
- variables?: TVarDefinitions$1 | undefined;
1682
- metadata?: MetadataBuilder<DeclaredVariables<TSchema$1, TVarDefinitions$1>, TOperationMetadata, ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["aggregatedFragmentMetadata"], ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["schemaLevel"]> | undefined;
1683
- fields: FieldsBuilder<TSchema$1, TSchema$1["operations"]["mutation"] & keyof TSchema$1["object"] & string, TVarDefinitions$1, TFields$1>;
1684
- transformDocument?: OperationDocumentTransformer<TOperationMetadata> | undefined;
1685
- }) => Operation<"mutation", TOperationName$1, (keyof TVarDefinitions$1 & string)[], ConstAssignableInputFromVarDefs<TSchema$1, TVarDefinitions$1>, TFields$1, InferFieldsExtended<TSchema$1, TSchema$1["operations"]["mutation"] & keyof TSchema$1["object"] & string, TFields$1>>;
1686
1339
  compat: CurriedCompatFunction;
1687
1340
  };
1688
1341
  subscription: CurriedOperationFunction<"subscription"> & {
1689
- operation: <TOperationName$1 extends string, TFields$1 extends AnyFieldsExtended, TVarDefinitions$1 extends VariableDefinitions = {}, TOperationMetadata = unknown>(options: {
1690
- name: TOperationName$1;
1691
- variables?: TVarDefinitions$1 | undefined;
1692
- metadata?: MetadataBuilder<DeclaredVariables<TSchema$1, TVarDefinitions$1>, TOperationMetadata, ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["aggregatedFragmentMetadata"], ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["schemaLevel"]> | undefined;
1693
- fields: FieldsBuilder<TSchema$1, TSchema$1["operations"]["subscription"] & keyof TSchema$1["object"] & string, TVarDefinitions$1, TFields$1>;
1694
- transformDocument?: OperationDocumentTransformer<TOperationMetadata> | undefined;
1695
- }) => Operation<"subscription", TOperationName$1, (keyof TVarDefinitions$1 & string)[], ConstAssignableInputFromVarDefs<TSchema$1, TVarDefinitions$1>, TFields$1, InferFieldsExtended<TSchema$1, TSchema$1["operations"]["subscription"] & keyof TSchema$1["object"] & string, TFields$1>>;
1696
1342
  compat: CurriedCompatFunction;
1697
1343
  };
1698
1344
  define: <TValue$1>(factory: () => TValue$1 | Promise<TValue$1>) => GqlDefine<TValue$1>;
1699
- extend: <TOperationType$1 extends OperationType, TOperationName$1 extends string, TVarDefinitions_1 extends VariableDefinitions, TFields_1 extends AnyFields, TOperationMetadata_1 = unknown>(compat: GqlDefine<TemplateCompatSpec> | GqlDefine<CompatSpec<TSchema$1, TOperationType$1, TOperationName$1, TVarDefinitions_1, TFields_1>>, options?: ExtendOptions<TSchema$1, TVarDefinitions_1, TOperationMetadata_1, ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["aggregatedFragmentMetadata"], ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["schemaLevel"]> | undefined) => any;
1700
- $var: VarBuilder<TSchema$1>;
1345
+ extend: <_TOperationType extends OperationType, _TOperationName extends string, TVarDefinitions extends VariableDefinitions, _TFields extends AnyFields, TOperationMetadata = unknown>(compat: GqlDefine<TemplateCompatSpec>, options?: ExtendOptions<TSchema, TVarDefinitions, TOperationMetadata, ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["aggregatedFragmentMetadata"], ExtractAdapterTypes<ExtractMetadataAdapter<TAdapter>>["schemaLevel"]> | undefined) => any;
1701
1346
  $dir: TDirectiveMethods;
1702
1347
  $colocate: <TEntries extends ColocatedEntries>(entries: TEntries) => ColocatedFields<TEntries>;
1703
- } & ExtractHelpers<TAdapter>, TSchema$1>;
1348
+ } & ExtractHelpers<TAdapter>, TSchema>;
1704
1349
  /**
1705
1350
  * Abstract Context type for prebuilt composers.
1706
1351
  *
@@ -1713,20 +1358,16 @@ declare const createGqlElementComposer: <TSchema$1 extends AnyGraphqlSchema, TDi
1713
1358
  type AnyGqlContext = {
1714
1359
  readonly fragment: (...args: unknown[]) => unknown;
1715
1360
  readonly query: ((...args: unknown[]) => unknown) & {
1716
- operation: (...args: unknown[]) => AnyOperation;
1717
1361
  compat: (...args: unknown[]) => AnyGqlDefine;
1718
1362
  };
1719
1363
  readonly mutation: ((...args: unknown[]) => unknown) & {
1720
- operation: (...args: unknown[]) => AnyOperation;
1721
1364
  compat: (...args: unknown[]) => AnyGqlDefine;
1722
1365
  };
1723
1366
  readonly subscription: ((...args: unknown[]) => unknown) & {
1724
- operation: (...args: unknown[]) => AnyOperation;
1725
1367
  compat: (...args: unknown[]) => AnyGqlDefine;
1726
1368
  };
1727
1369
  readonly define: <TValue$1>(factory: () => TValue$1 | Promise<TValue$1>) => GqlDefine<TValue$1>;
1728
1370
  readonly extend: (...args: unknown[]) => AnyOperation;
1729
- readonly $var: unknown;
1730
1371
  readonly $dir: StandardDirectives;
1731
1372
  readonly $colocate: unknown;
1732
1373
  readonly [key: string]: unknown;
@@ -1744,7 +1385,7 @@ type AnyGqlContext = {
1744
1385
  *
1745
1386
  * @internal
1746
1387
  */
1747
- declare const createVarAssignments: <TSchema$1 extends AnyGraphqlSchema, TVariableDefinitions extends VariableDefinitions>(definitions: TVariableDefinitions, providedValues: AnyAssignableInput | void) => DeclaredVariables<TSchema$1, TVariableDefinitions>;
1388
+ declare const createVarAssignments: <TVariableDefinitions extends VariableDefinitions>(definitions: TVariableDefinitions, providedValues: AnyAssignableInput | void) => Readonly<Record<string, AnyVarRef>>;
1748
1389
  /**
1749
1390
  * Creates variable references from variable definitions.
1750
1391
  *
@@ -1753,46 +1394,23 @@ declare const createVarAssignments: <TSchema$1 extends AnyGraphqlSchema, TVariab
1753
1394
  *
1754
1395
  * @internal
1755
1396
  */
1756
- declare const createVarRefs: <TSchema$1 extends AnyGraphqlSchema, TVarDefinitions$1 extends VariableDefinitions>(definitions: TVarDefinitions$1) => DeclaredVariables<TSchema$1, TVarDefinitions$1>;
1757
- //#endregion
1758
- //#region packages/core/src/composer/operation.d.ts
1759
- /**
1760
- * Creates a factory for composing GraphQL operations.
1761
- *
1762
- * Returns a curried function: first select operation type (query/mutation/subscription),
1763
- * then define the operation with name, variables, and fields.
1764
- *
1765
- * Handles metadata aggregation from fragments (sync or async) and builds
1766
- * the TypedDocumentNode automatically.
1767
- *
1768
- * @param schema - The GraphQL schema definition
1769
- * @param adapter - Optional metadata adapter for custom metadata handling
1770
- * @param transformDocument - Optional document transformer called after building
1771
- * @returns Operation type selector function
1772
- *
1773
- * @internal Used by `createGqlElementComposer`
1774
- */
1775
- declare const createOperationComposerFactory: <TSchema$1 extends AnyGraphqlSchema, TAdapter extends AnyMetadataAdapter = DefaultMetadataAdapter>(schema: NoInfer<TSchema$1>, adapter?: TAdapter, transformDocument?: DocumentTransformer<ExtractAdapterTypes<TAdapter>["schemaLevel"], ExtractAdapterTypes<TAdapter>["aggregatedFragmentMetadata"]>) => <TOperationType$1 extends OperationType>(operationType: TOperationType$1) => <TOperationName$1 extends string, TFields$1 extends AnyFieldsExtended, TVarDefinitions$1 extends VariableDefinitions = {}, TOperationMetadata = unknown>(options: {
1776
- name: TOperationName$1;
1777
- variables?: TVarDefinitions$1;
1778
- metadata?: MetadataBuilder<ReturnType<typeof createVarRefs<TSchema$1, TVarDefinitions$1>>, TOperationMetadata, ExtractAdapterTypes<TAdapter>["aggregatedFragmentMetadata"], ExtractAdapterTypes<TAdapter>["schemaLevel"]>;
1779
- fields: FieldsBuilder<TSchema$1, TSchema$1["operations"][TOperationType$1] & keyof TSchema$1["object"] & string, TVarDefinitions$1, TFields$1>;
1780
- transformDocument?: OperationDocumentTransformer<TOperationMetadata>;
1781
- }) => Operation<TOperationType$1, TOperationName$1, (keyof TVarDefinitions$1 & string)[], ConstAssignableInputFromVarDefs<TSchema$1, TVarDefinitions$1>, TFields$1, InferFieldsExtended<TSchema$1, TSchema$1["operations"][TOperationType$1] & keyof TSchema$1["object"] & string, TFields$1>>;
1397
+ declare const createVarRefs: <TVarDefinitions extends VariableDefinitions>(definitions: TVarDefinitions) => Readonly<Record<string, AnyVarRef>>;
1782
1398
  //#endregion
1783
1399
  //#region packages/core/src/composer/operation-core.d.ts
1784
1400
  /**
1785
1401
  * Shared base parameters for building an operation artifact.
1786
1402
  * @internal
1787
1403
  */
1788
- type OperationCoreParamsBase<TSchema$1 extends AnyGraphqlSchema, TOperationType$1 extends OperationType, TOperationName$1 extends string, TVarDefinitions$1 extends VariableDefinitions, TOperationMetadata, TAdapter extends AnyMetadataAdapter> = {
1789
- readonly schema: TSchema$1;
1790
- readonly operationType: TOperationType$1;
1791
- readonly operationTypeName: TSchema$1["operations"][TOperationType$1] & keyof TSchema$1["object"] & string;
1792
- readonly operationName: TOperationName$1;
1793
- readonly variables: TVarDefinitions$1;
1404
+ type OperationCoreParamsBase<TSchema extends AnyGraphqlSchema, TOperationType extends OperationType, TOperationName extends string, TVarDefinitions extends VariableDefinitions, TOperationMetadata, TAdapter extends AnyMetadataAdapter> = {
1405
+ readonly schema: TSchema;
1406
+ readonly operationType: TOperationType;
1407
+ readonly operationTypeName: TSchema["operations"][TOperationType] & keyof TSchema["object"] & string;
1408
+ readonly operationName: TOperationName;
1409
+ readonly variables: TVarDefinitions;
1410
+ /** Pre-parsed VariableDefinitionNode[] from tagged template or options object parser */
1411
+ readonly variableDefinitionNodes?: readonly VariableDefinitionNode[];
1794
1412
  readonly adapter: TAdapter;
1795
- readonly metadata?: MetadataBuilder<DeclaredVariables<TSchema$1, TVarDefinitions$1>, TOperationMetadata, ExtractAdapterTypes<TAdapter>["aggregatedFragmentMetadata"], ExtractAdapterTypes<TAdapter>["schemaLevel"]>;
1413
+ readonly metadata?: MetadataBuilder<Readonly<Record<string, AnyVarRef>>, TOperationMetadata, ExtractAdapterTypes<TAdapter>["aggregatedFragmentMetadata"], ExtractAdapterTypes<TAdapter>["schemaLevel"]>;
1796
1414
  readonly transformDocument?: OperationDocumentTransformer<TOperationMetadata>;
1797
1415
  readonly adapterTransformDocument?: DocumentTransformer<ExtractAdapterTypes<TAdapter>["schemaLevel"], ExtractAdapterTypes<TAdapter>["aggregatedFragmentMetadata"]>;
1798
1416
  };
@@ -1800,20 +1418,20 @@ type OperationCoreParamsBase<TSchema$1 extends AnyGraphqlSchema, TOperationType$
1800
1418
  * Parameters for building an operation artifact.
1801
1419
  * Uses `fieldsFactory` to evaluate fields and build document.
1802
1420
  *
1803
- * @internal Used by operation.ts, extend.ts, and operation-tagged-template.ts
1421
+ * @internal Used by extend.ts and operation-tagged-template.ts
1804
1422
  */
1805
- type OperationCoreParams<TSchema$1 extends AnyGraphqlSchema, TOperationType$1 extends OperationType, TOperationName$1 extends string, TVarDefinitions$1 extends VariableDefinitions, TFields$1 extends AnyFieldsExtended, TOperationMetadata, TAdapter extends AnyMetadataAdapter> = OperationCoreParamsBase<TSchema$1, TOperationType$1, TOperationName$1, TVarDefinitions$1, TOperationMetadata, TAdapter> & {
1806
- readonly fieldsFactory: FieldsBuilder<TSchema$1, TSchema$1["operations"][TOperationType$1] & keyof TSchema$1["object"] & string, TVarDefinitions$1, TFields$1>;
1423
+ type OperationCoreParams<TSchema extends AnyGraphqlSchema, TOperationType extends OperationType, TOperationName extends string, TVarDefinitions extends VariableDefinitions, TFields$1 extends AnyFieldsExtended, TOperationMetadata, TAdapter extends AnyMetadataAdapter> = OperationCoreParamsBase<TSchema, TOperationType, TOperationName, TVarDefinitions, TOperationMetadata, TAdapter> & {
1424
+ readonly fieldsFactory: FieldsBuilder<TFields$1>;
1807
1425
  };
1808
1426
  /**
1809
1427
  * Result type from buildOperationArtifact.
1810
1428
  * Matches the artifact shape expected by Operation.create().
1811
1429
  */
1812
- type OperationArtifactResult<TOperationType$1 extends OperationType, TOperationName$1 extends string, TVarDefinitions$1 extends VariableDefinitions, TFields$1 extends AnyFieldsExtended, TOperationMetadata> = {
1813
- readonly operationType: TOperationType$1;
1814
- readonly operationName: TOperationName$1;
1430
+ type OperationArtifactResult<TOperationType extends OperationType, TOperationName extends string, TVarDefinitions extends VariableDefinitions, TFields$1 extends AnyFieldsExtended, TOperationMetadata> = {
1431
+ readonly operationType: TOperationType;
1432
+ readonly operationName: TOperationName;
1815
1433
  readonly schemaLabel: string;
1816
- readonly variableNames: (keyof TVarDefinitions$1 & string)[];
1434
+ readonly variableNames: (keyof TVarDefinitions & string)[];
1817
1435
  readonly documentSource: () => TFields$1;
1818
1436
  readonly document: ReturnType<typeof buildDocument>;
1819
1437
  readonly metadata: TOperationMetadata | undefined;
@@ -1831,9 +1449,9 @@ type OperationArtifactResult<TOperationType$1 extends OperationType, TOperationN
1831
1449
  * @param params - Operation building parameters
1832
1450
  * @returns Operation artifact or Promise of artifact (if async metadata)
1833
1451
  *
1834
- * @internal Used by operation.ts, extend.ts, and operation-tagged-template.ts
1452
+ * @internal Used by extend.ts and operation-tagged-template.ts
1835
1453
  */
1836
- declare const buildOperationArtifact: <TSchema$1 extends AnyGraphqlSchema, TOperationType$1 extends OperationType, TOperationName$1 extends string, TVarDefinitions$1 extends VariableDefinitions, TFields$1 extends AnyFieldsExtended, TOperationMetadata, TAdapter extends AnyMetadataAdapter>(params: OperationCoreParams<TSchema$1, TOperationType$1, TOperationName$1, TVarDefinitions$1, TFields$1, TOperationMetadata, TAdapter>) => OperationArtifactResult<TOperationType$1, TOperationName$1, TVarDefinitions$1, TFields$1, TOperationMetadata> | Promise<OperationArtifactResult<TOperationType$1, TOperationName$1, TVarDefinitions$1, TFields$1, TOperationMetadata>>;
1454
+ declare const buildOperationArtifact: <TSchema extends AnyGraphqlSchema, TOperationType extends OperationType, TOperationName extends string, TVarDefinitions extends VariableDefinitions, TFields$1 extends AnyFieldsExtended, TOperationMetadata, TAdapter extends AnyMetadataAdapter>(params: OperationCoreParams<TSchema, TOperationType, TOperationName, TVarDefinitions, TFields$1, TOperationMetadata, TAdapter>) => OperationArtifactResult<TOperationType, TOperationName, TVarDefinitions, TFields$1, TOperationMetadata> | Promise<OperationArtifactResult<TOperationType, TOperationName, TVarDefinitions, TFields$1, TOperationMetadata>>;
1837
1455
  /**
1838
1456
  * Wraps a buildOperationArtifact call into an Operation.create() invocation,
1839
1457
  * handling both sync and async artifact results.
@@ -1842,7 +1460,81 @@ declare const buildOperationArtifact: <TSchema$1 extends AnyGraphqlSchema, TOper
1842
1460
  *
1843
1461
  * @internal Used by extend.ts and operation-tagged-template.ts
1844
1462
  */
1845
- declare const wrapArtifactAsOperation: <TOperationType$1 extends OperationType>(artifactFactory: () => OperationArtifactResult<TOperationType$1, string, VariableDefinitions, AnyFieldsExtended, unknown> | Promise<OperationArtifactResult<TOperationType$1, string, VariableDefinitions, AnyFieldsExtended, unknown>>) => AnyOperationOf<TOperationType$1>;
1463
+ declare const wrapArtifactAsOperation: <TOperationType extends OperationType>(artifactFactory: () => OperationArtifactResult<TOperationType, string, VariableDefinitions, AnyFieldsExtended, unknown> | Promise<OperationArtifactResult<TOperationType, string, VariableDefinitions, AnyFieldsExtended, unknown>>) => AnyOperationOf<TOperationType>;
1464
+ //#endregion
1465
+ //#region packages/core/src/composer/var-ref-tools.d.ts
1466
+ /**
1467
+ * Recursively checks if a NestedValue contains any VarRef.
1468
+ *
1469
+ * Used by getVarRefValue to determine if it's safe to return as ConstValue.
1470
+ * @internal
1471
+ */
1472
+ declare const hasVarRefInside: (value: NestedValueElement | unknown) => boolean;
1473
+ /**
1474
+ * Get the variable name from a VarRef.
1475
+ * Throws if the VarRef contains a nested-value instead of a variable reference.
1476
+ */
1477
+ declare const getVarRefName: (varRef: AnyVarRef) => string;
1478
+ /**
1479
+ * Get the const value from a VarRef.
1480
+ * Throws if the VarRef contains a variable reference instead of a nested-value,
1481
+ * or if the nested-value contains any VarRef inside.
1482
+ */
1483
+ declare const getVarRefValue: (varRef: AnyVarRef) => ConstValue;
1484
+ /**
1485
+ * Path segment types for navigating nested values.
1486
+ */
1487
+ type PathSegment = string;
1488
+ /**
1489
+ * Type-safe path builder function.
1490
+ * Used with getNameAt and getValueAt helpers.
1491
+ */
1492
+ type Selector<T, U> = (proxy: T) => U;
1493
+ /**
1494
+ * Get the variable name from a VarRef at a specific path.
1495
+ *
1496
+ * @param varRef - The VarRef containing a nested-value
1497
+ * @param selector - Path builder function, e.g., p => p.user.age
1498
+ * @returns The variable name at the specified path
1499
+ * @throws If path doesn't lead to a VarRef with type "variable"
1500
+ *
1501
+ * @example
1502
+ * const ref = createVarRefFromNestedValue({
1503
+ * user: { age: someVariableRef }
1504
+ * });
1505
+ * getNameAt(ref, p => p.user.age); // returns the variable name
1506
+ */
1507
+ declare const getNameAt: <T, U>(varRef: VarRef<AnyVarRefBrand>, selector: (proxy: T) => U) => string;
1508
+ /**
1509
+ * Get the const value from a nested-value VarRef at a specific path.
1510
+ *
1511
+ * @param varRef - The VarRef containing a nested-value
1512
+ * @param pathFn - Path builder function, e.g., p => p.user.name
1513
+ * @returns The const value at the specified path
1514
+ * @throws If path leads to a VarRef or if value contains VarRef inside
1515
+ *
1516
+ * @example
1517
+ * const ref = createVarRefFromNestedValue({
1518
+ * user: { name: "Alice", age: someVariableRef }
1519
+ * });
1520
+ * getValueAt(ref, p => p.user.name); // returns "Alice"
1521
+ */
1522
+ declare const getValueAt: <T, U>(varRef: VarRef<AnyVarRefBrand>, selector: (proxy: T) => U) => U;
1523
+ /**
1524
+ * Gets the full path to a variable within a nested structure.
1525
+ *
1526
+ * Returns path segments starting with `$variableName` followed by
1527
+ * property accesses within that variable's value.
1528
+ *
1529
+ * @example
1530
+ * ```typescript
1531
+ * getVariablePath($.filter, p => p.user.id)
1532
+ * // Returns: ["$filter", "user", "id"]
1533
+ * ```
1534
+ */
1535
+ declare const getVariablePath: <T, U>(varRef: VarRef<AnyVarRefBrand>, selector: (proxy: T) => U) => readonly PathSegment[];
1536
+ /** Pre-built tools object passed as `$var` in metadata builder callbacks. */
1537
+ declare const varRefTools: VarRefTools;
1846
1538
  //#endregion
1847
1539
  //#region packages/core/src/graphql/fragment-args-preprocessor.d.ts
1848
1540
  /**
@@ -2327,7 +2019,7 @@ declare const generateInputTypeFromSpecifiers: (schema: AnyGraphqlSchema, specif
2327
2019
  * Generate a TypeScript type string for input variables from VariableDefinitions.
2328
2020
  *
2329
2021
  * Unlike generateInputTypeFromSpecifiers which works with deferred specifier strings,
2330
- * this function works with VarSpecifier objects created by $var().
2022
+ * this function works with VarSpecifier objects from variable definitions.
2331
2023
  * Used for generating Fragment input types in prebuilt mode.
2332
2024
  *
2333
2025
  * @param schema - The GraphQL schema
@@ -2362,6 +2054,8 @@ type PrebuiltTypeRegistry = {
2362
2054
  readonly [key: string]: {
2363
2055
  readonly input: object;
2364
2056
  readonly output: object;
2057
+ readonly varTypes?: unknown;
2058
+ readonly fields?: unknown;
2365
2059
  };
2366
2060
  };
2367
2061
  };
@@ -2389,5 +2083,5 @@ type Hidden<T> = () => T;
2389
2083
  //#region packages/core/src/utils/wrap-by-key.d.ts
2390
2084
  declare function wrapByKey<TName$1 extends string, TValue$1>(name: TName$1, value: TValue$1): { [K in TName$1]: TValue$1 };
2391
2085
  //#endregion
2392
- export { ParsedSelection as $, FieldsBuilderTools as $n, FieldArgumentValue as $r, ObjectRecord as $t, getArgumentType as A, FragmentInferMeta as An, AbstractFieldSelection as Ar, VarBuilder as At, parseGraphqlSource as B, ExtractCompatSpec as Bn, InferField as Br, createFragmentTaggedTemplate as Bt, EnrichedFragment as C, createCompatComposer as Cn, buildDocument as Cr, AnyInputTypeMethods as Ct, TransformResult as D, OperationInferMeta as Dn, ParsedOutputSpecifier as Dr, ResolveTypeFromMeta as Dt, TransformOptions as E, Operation as En, ParsedInputSpecifier as Er, InputTypeMethods as Et, mergeModifiers as F, GqlElementContext as Fn, AnyNestedObject as Fr, recordFragmentUsage as Ft, ParseResultBase as G, FieldSelectionFactories as Gn, AnyDirectiveAttachments as Gr, OperationTaggedTemplateFunction as Gt, GraphqlAnalysisError as H, isTemplateCompatSpec as Hn, InferFieldsExtended as Hr, filterUnresolvedFragmentSpreads as Ht, mergeVariableUsages as I, GqlElementDefinitionFactory as In, AnyNestedObjectExtended as Ir, withFragmentUsageCollection as It, ParsedFragment as J, FieldSelectionFactoryObjectReturn as Jn, AnyAssigningInput as Jr, TemplateResultMetadataOptions as Jt, ParsedArgument as K, FieldSelectionFactory as Kn, AnyAssignableInput as Kr, OperationTemplateMetadataOptions as Kt, sortFragmentsByDependency as L, AnyCompatSpec as Ln, AnyNestedUnion as Lr, CurriedFragmentFunction as Lt, getInputFieldType as M, GqlDefine as Mn, AnyFieldValue as Mr, createVarBuilder as Mt, inferVariablesFromUsages as N, GqlElement as Nn, AnyFields as Nr, createVarMethodFactory as Nt, VariableUsage as O, AnyFragment as On, parseInputSpecifier as Or, SchemaAwareGetNameAt as Ot, isModifierAssignable as P, GqlElementAttachment as Pn, AnyFieldsExtended as Pr, FragmentUsageRecord as Pt, ParsedOperation as Q, FieldsBuilder as Qn, DeclaredVariables as Qr, InputRecord as Qt, transformParsedGraphql as R, AnyExtendableSpec as Rn, AnyUnionSelection as Rr, FragmentTaggedTemplateFunction as Rt, buildVarSpecifiers as S, CompatOptions as Sn, buildConstValueNode as Sr, createGqlElementComposer as St, EnrichedVariable as T, AnyOperationOf as Tn, buildWithTypeModifier as Tr, InputTypeMethod as Tt, InferredVariable as U, AnyFieldSelectionFactory as Un, ScalarShorthand as Ur, CurriedOperationFunction as Ut, parseTypeNode as V, TemplateCompatSpec as Vn, InferFields as Vr, extractFragmentVariables as Vt, ParseResult as W, AnyFieldSelectionFactoryReturn as Wn, UnionSelection as Wr, FragmentTemplateMetadataOptions as Wt, ParsedInlineFragment as X, FieldSelectionFactoryReturn as Xn, AssignableInputByFieldName as Xr, DirectiveRecord as Xt, ParsedFragmentSpread as Y, FieldSelectionFactoryPrimitiveReturn as Yn, AssignableInput as Yr, createOperationTaggedTemplate as Yt, ParsedObjectField as Z, FieldSelectionFactoryUnionReturn as Zn, AssignableInputFromVarDefs as Zr, EnumRecord as Zt, getScalarInputType as _, createTypedDirectiveMethod as _n, Tuple as _r, AnyGqlContext as _t, PrebuiltEntryNotFound as a, ConstAssignableInputFromVarDefs as ai, createFieldFactories as an, OptionalArg as ar, Result as at, BuiltVarSpecifier as b, CurriedCompatFunction as bn, EnumLookup as br, GqlElementComposerOptions as bt, TypeFormatters as c, GetAssignableType as ci, AnyDirectiveMethod as cn, AttachmentShape as cr, PreprocessResult as ct, calculateFieldsType as d, DirectiveArgumentSpecifier as di, DirectiveBuilder as dn, ColocateHelper as dr, OperationCoreParams as dt, FragmentVariableValue as ei, OperationTypeNames as en, NestedObjectFieldsBuilder as er, ParsedValue as et, generateInputObjectType as f, DirectiveLocation as fi, DirectiveMethod as fn, ColocatedEntries as fr, buildOperationArtifact as ft, getEnumType as g, TypeSystemDirectiveLocation as gi, createStandardDirectives as gn, StripSymbols as gr, createVarRefs as gt, generateInputTypeFromVarDefs as h, ExecutableDirectiveLocation as hi, createDirectiveMethod as hn, StripFunctions as hr, createVarAssignments as ht, AssertExtends as i, ConstAssignableInput as ii, createSchemaIndex as in, IfOmittable as ir, OkResult as it, getFieldReturnType as j, AnyGqlDefine as jn, AnyFieldSelection as jr, VarBuilderMethods as jt, collectVariableUsages as k, Fragment as kn, parseOutputSpecifier as kr, SchemaAwareGetValueAt as kt, applyTypeModifier as l, AnyDirectiveRef as li, DirectiveArgValue as ln, AttachmentToProperty as lr, preprocessFragmentArgs as lt, generateInputTypeFromSpecifiers as m, DirectiveRefInner as mi, createDirectiveBuilder as mn, createColocateHelper as mr, createOperationComposerFactory as mt, Hidden as n, AnyConstAssignableInput as ni, SchemaIndex as nn, NestedUnionFieldsBuilder as nr, TypeInfo as nt, PrebuiltTypeRegistry as o, ConstAssignableInputValue as oi, ExtendOptions as on, SwitchIfOmittable as or, err as ot, generateInputType as p, DirectiveRef as pi, StandardDirectives as pn, ColocatedFields as pr, wrapArtifactAsOperation as pt, ParsedFieldSelection as q, FieldSelectionFactoryFieldArguments as qn, AnyAssignableInputValue as qr, TemplateResult as qt, hidden as r, AnyConstAssignableInputValue as ri, UnionRecord as rn, EmptyObject as rr, ErrResult as rt, GenerateInputObjectTypeOptions as s, ConstAssignableInputValueFromVarSpec as si, createExtendComposer as sn, empty as sr, ok as st, wrapByKey as t, AnyConstDirectiveAttachments as ti, ScalarRecord as tn, NestedObjectFieldsBuilderTools as tr, ParsedVariable as tt, calculateFieldType as u, AnyDirectiveRefBrand as ui, DirectiveArgumentSpecifiers as un, AttachmentsTupleToIntersection as ur, OperationArtifactResult as ut, getScalarOutputType as v, isDirectiveRef as vn, UnionToIntersection as vr, ExtractMetadataAdapter as vt, EnrichedOperation as w, AnyOperation as wn, buildOperationTypeNode as wr, GenericVarSpecifier as wt, buildVarSpecifier as x, createCompatTaggedTemplate as xn, buildArgumentValue as xr, GqlElementComposerWithSchema as xt, graphqlTypeToTypeScript as y, CompatTaggedTemplate as yn, AnyVarSpecifier as yr, GqlElementComposer as yt, createSchemaIndexFromSchema as z, CompatSpec as zn, FieldSelectionTemplateOf as zr, buildFieldsFromSelectionSet as zt };
2393
- //# sourceMappingURL=index-8FNIWzv-.d.ts.map
2086
+ export { ParsedSelection as $, StripSymbols as $n, ObjectRecord as $t, getArgumentType as A, OptionalArg as An, AnyAssignableInputValue as Ar, createGqlElementComposer as At, parseGraphqlSource as B, AttachmentShape as Bn, ConstAssignableInput as Br, CurriedOperationFunction as Bt, EnrichedFragment as C, Operation as Cn, InferFields as Cr, createVarAssignments as Ct, TransformResult as D, FragmentInferMeta as Dn, UnionSelection as Dr, GqlElementComposer as Dt, TransformOptions as E, Fragment as En, UnionMemberSelection as Er, ExtractMetadataAdapter as Et, mergeModifiers as F, GqlElement as Fn, DeclaredVariables as Fr, FragmentTaggedTemplateFunction as Ft, ParseResultBase as G, NestedObjectFieldsBuilder as Gn, AnyDirectiveRef as Gr, OperationTaggedTemplateFunction as Gt, GraphqlAnalysisError as H, AttachmentsTupleToIntersection as Hn, ConstAssignableInputValue as Hr, OperationBuilderDispatch as Ht, mergeVariableUsages as I, GqlElementAttachment as In, FieldArgumentValue as Ir, buildFieldsFromSelectionSet as It, ParsedFragment as J, ColocateHelper as Jn, DirectiveLocation as Jr, TemplateResultMetadataOptions as Jt, ParsedArgument as K, NestedUnionFieldsBuilder as Kn, AnyDirectiveRefBrand as Kr, OperationTemplateMetadataOptions as Kt, sortFragmentsByDependency as L, GqlElementContext as Ln, FragmentVariableValue as Lr, createFragmentTaggedTemplate as Lt, getInputFieldType as M, empty as Mn, AssignableInput as Mr, recordFragmentUsage as Mt, inferVariablesFromUsages as N, AnyGqlDefine as Nn, AssignableInputByFieldName as Nr, withFragmentUsageCollection as Nt, VariableUsage as O, EmptyObject as On, AnyDirectiveAttachments as Or, GqlElementComposerOptions as Ot, isModifierAssignable as P, GqlDefine as Pn, AssignableInputFromVarDefs as Pr, CurriedFragmentFunction as Pt, ParsedOperation as Q, StripFunctions as Qn, TypeSystemDirectiveLocation as Qr, InputRecord as Qt, transformParsedGraphql as R, GqlElementDefinitionFactory as Rn, AnyConstAssignableInput as Rr, extractFragmentVariables as Rt, buildVarSpecifiers as S, AnyOperationOf as Sn, InferField as Sr, wrapArtifactAsOperation as St, EnrichedVariable as T, AnyFragment as Tn, ScalarShorthand as Tr, AnyGqlContext as Tt, InferredVariable as U, FieldAccessorFunction as Un, ConstAssignableInputValueFromVarSpec as Ur, OperationMetadataContext as Ut, parseTypeNode as V, AttachmentToProperty as Vn, ConstAssignableInputFromVarDefs as Vr, FragmentTemplateMetadataOptions as Vt, ParseResult as W, FieldsBuilder as Wn, GetAssignableType as Wr, OperationOptionsObject as Wt, ParsedInlineFragment as X, ColocatedFields as Xn, DirectiveRefInner as Xr, DirectiveRecord as Xt, ParsedFragmentSpread as Y, ColocatedEntries as Yn, DirectiveRef as Yr, createOperationTaggedTemplate as Yt, ParsedObjectField as Z, createColocateHelper as Zn, ExecutableDirectiveLocation as Zr, EnumRecord as Zt, getScalarInputType as _, isDirectiveRef as _n, AnyNestedObject as _r, hasVarRefInside as _t, PrebuiltEntryNotFound as a, ExtendOptions as an, buildDocument as ar, Result as at, BuiltVarSpecifier as b, createCompatTaggedTemplate as bn, AnyUnionSelection as br, OperationCoreParams as bt, TypeFormatters as c, DirectiveArgValue as cn, ParsedInputSpecifier as cr, PreprocessResult as ct, calculateFieldsType as d, DirectiveMethod as dn, parseOutputSpecifier as dr, Selector as dt, OperationTypeNames as en, Tuple as er, ParsedValue as et, generateInputObjectType as f, StandardDirectives as fn, AbstractFieldSelection as fr, getNameAt as ft, getEnumType as g, createTypedDirectiveMethod as gn, AnyFieldsExtended as gr, getVariablePath as gt, generateInputTypeFromVarDefs as h, createStandardDirectives as hn, AnyFields as hr, getVarRefValue as ht, AssertExtends as i, createSchemaIndex as in, buildConstValueNode as ir, OkResult as it, getFieldReturnType as j, SwitchIfOmittable as jn, AnyAssigningInput as jr, FragmentUsageRecord as jt, collectVariableUsages as k, IfOmittable as kn, AnyAssignableInput as kr, GqlElementComposerWithSchema as kt, applyTypeModifier as l, DirectiveArgumentSpecifiers as ln, ParsedOutputSpecifier as lr, preprocessFragmentArgs as lt, generateInputTypeFromSpecifiers as m, createDirectiveMethod as mn, AnyFieldValue as mr, getVarRefName as mt, Hidden as n, SchemaIndex as nn, EnumLookup as nr, TypeInfo as nt, PrebuiltTypeRegistry as o, createExtendComposer as on, buildOperationTypeNode as or, err as ot, generateInputType as p, createDirectiveBuilder as pn, AnyFieldSelection as pr, getValueAt as pt, ParsedFieldSelection as q, createFieldFactories as qn, DirectiveArgumentSpecifier as qr, TemplateResult as qt, hidden as r, UnionRecord as rn, buildArgumentValue as rr, ErrResult as rt, GenerateInputObjectTypeOptions as s, AnyDirectiveMethod as sn, buildWithTypeModifier as sr, ok as st, wrapByKey as t, ScalarRecord as tn, UnionToIntersection as tr, ParsedVariable as tt, calculateFieldType as u, DirectiveBuilder as un, parseInputSpecifier as ur, PathSegment as ut, getScalarOutputType as v, CompatTaggedTemplate as vn, AnyNestedObjectExtended as vr, varRefTools as vt, EnrichedOperation as w, OperationInferMeta as wn, InferFieldsExtended as wr, createVarRefs as wt, buildVarSpecifier as x, AnyOperation as xn, FieldSelectionTemplateOf as xr, buildOperationArtifact as xt, graphqlTypeToTypeScript as y, CurriedCompatFunction as yn, AnyNestedUnion as yr, OperationArtifactResult as yt, createSchemaIndexFromSchema as z, TemplateCompatSpec as zn, AnyConstAssignableInputValue as zr, filterUnresolvedFragmentSpreads as zt };
2087
+ //# sourceMappingURL=index-CRWc3q9X.d.cts.map