@soda-gql/core 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["value","field","curr: Readonly<{ modifier: TypeModifier | \"\"; type: TypeNode }>","cache: { value: TDefinition } | null","define","define","define","define","define","paths","fields","cacheMap: CacheMap","factory: AnyFieldSelectionFactory","factoryReturn: AnyFieldSelectionFactoryReturn<TAlias>","operationTypeName: TTypeName | null","operationTypeName: TTypeName | null","elementComposer: GqlElementComposer<typeof composers, typeof helper>"],"sources":["../src/composer/build-document.ts","../src/types/element/gql-element.ts","../src/types/element/composed-operation.ts","../src/types/element/fields-builder.ts","../src/types/element/inline-operation.ts","../src/types/element/model.ts","../src/types/element/slice.ts","../src/composer/projection-path-graph.ts","../src/composer/composed-operation.ts","../src/utils/wrap-by-key.ts","../src/composer/fields-builder.ts","../src/composer/inline-operation.ts","../src/composer/model.ts","../src/composer/slice.ts","../src/types/schema/type-modifier.ts","../src/composer/var-builder.ts","../src/composer/gql-composer.ts","../src/schema/type-specifier-builder.ts","../src/schema/schema-builder.ts"],"sourcesContent":["import {\n type ArgumentNode,\n type ConstObjectFieldNode,\n type ConstValueNode,\n type DocumentNode,\n type FieldNode,\n type InlineFragmentNode,\n Kind,\n type NamedTypeNode,\n type ObjectFieldNode,\n OperationTypeNode,\n type TypedQueryDocumentNode,\n type TypeNode,\n type ValueNode,\n type VariableDefinitionNode,\n} from \"graphql\";\nimport {\n type AnyAssignableInput,\n type AnyAssignableInputValue,\n type AnyFields,\n type AnyNestedUnion,\n type InferFields,\n VarRef,\n} from \"../types/fragment\";\nimport type { AnyGraphqlSchema, ConstAssignableInput, InputTypeSpecifiers, OperationType, TypeModifier } from \"../types/schema\";\nimport type { ConstValue } from \"../types/schema/const-value\";\n\nexport const buildArgumentValue = (value: AnyAssignableInputValue): ValueNode | null => {\n if (value === undefined) {\n return null;\n }\n\n if (value === null) {\n return {\n kind: Kind.NULL,\n };\n }\n\n if (value instanceof VarRef) {\n return {\n kind: Kind.VARIABLE,\n name: { kind: Kind.NAME, value: value.name },\n };\n }\n\n if (Array.isArray(value)) {\n return {\n kind: Kind.LIST,\n values: value.map((item) => buildArgumentValue(item)).filter((item) => item !== null),\n };\n }\n\n if (typeof value === \"object\") {\n return {\n kind: Kind.OBJECT,\n fields: Object.entries(value)\n .map(([key, value]): ObjectFieldNode | null => {\n const valueNode = buildArgumentValue(value);\n return valueNode\n ? {\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: key },\n value: valueNode,\n }\n : null;\n })\n .filter((item) => item !== null),\n };\n }\n\n if (typeof value === \"string\") {\n return {\n kind: Kind.STRING,\n value,\n };\n }\n\n if (typeof value === \"number\") {\n // Distinguish between INT and FLOAT\n const isFloat = !Number.isInteger(value) || value.toString().includes(\".\");\n return {\n kind: isFloat ? Kind.FLOAT : Kind.INT,\n value: value.toString(),\n };\n }\n\n if (typeof value === \"boolean\") {\n return {\n kind: Kind.BOOLEAN,\n value,\n };\n }\n\n throw new Error(`Unknown value type: ${typeof (value satisfies never)}`);\n};\n\nconst buildArguments = (args: AnyAssignableInput): ArgumentNode[] =>\n Object.entries(args ?? {})\n .map(([name, value]): ArgumentNode | null => {\n const valueNode = buildArgumentValue(value);\n return valueNode ? { kind: Kind.ARGUMENT, name: { kind: Kind.NAME, value: name }, value: valueNode } : null;\n })\n .filter((item) => item !== null);\n\nconst buildUnionSelection = (union: AnyNestedUnion): InlineFragmentNode[] =>\n Object.entries(union)\n .map(([typeName, object]): InlineFragmentNode | null => {\n return object\n ? {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: { kind: Kind.NAMED_TYPE, name: { kind: Kind.NAME, value: typeName } },\n selectionSet: { kind: Kind.SELECTION_SET, selections: buildField(object) },\n }\n : null;\n })\n .filter((item) => item !== null);\n\nconst buildField = (field: AnyFields): FieldNode[] =>\n Object.entries(field).map(\n ([alias, { args, field, object, union }]): FieldNode => ({\n kind: Kind.FIELD,\n name: { kind: Kind.NAME, value: field },\n alias: alias !== field ? { kind: Kind.NAME, value: alias } : undefined,\n arguments: buildArguments(args),\n selectionSet: object\n ? {\n kind: Kind.SELECTION_SET,\n selections: buildField(object),\n }\n : union\n ? {\n kind: Kind.SELECTION_SET,\n selections: buildUnionSelection(union),\n }\n : undefined,\n }),\n );\n\nexport const buildConstValueNode = (value: ConstValue): ConstValueNode | null => {\n if (value === undefined) {\n return null;\n }\n\n if (value === null) {\n return { kind: Kind.NULL };\n }\n\n if (typeof value === \"string\") {\n return { kind: Kind.STRING, value };\n }\n\n if (typeof value === \"boolean\") {\n return { kind: Kind.BOOLEAN, value };\n }\n\n if (typeof value === \"number\") {\n // Distinguish between INT and FLOAT\n const isFloat = !Number.isInteger(value) || value.toString().includes(\".\");\n return { kind: isFloat ? Kind.FLOAT : Kind.INT, value: value.toString() };\n }\n\n if (Array.isArray(value)) {\n return { kind: Kind.LIST, values: value.map((item) => buildConstValueNode(item)).filter((item) => item !== null) };\n }\n\n if (typeof value === \"object\") {\n return {\n kind: Kind.OBJECT,\n fields: Object.entries(value)\n .map(([key, value]): ConstObjectFieldNode | null => {\n const valueNode = buildConstValueNode(value);\n return valueNode\n ? {\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: key },\n value: valueNode,\n }\n : null;\n })\n .filter((item) => item !== null),\n };\n }\n\n throw new Error(`Unknown value type: ${typeof (value satisfies never)}`);\n};\n\nexport const buildWithTypeModifier = (modifier: TypeModifier, buildType: () => NamedTypeNode): TypeNode => {\n const baseType = buildType();\n\n if (modifier === \"?\") {\n return baseType;\n }\n\n let curr: Readonly<{ modifier: TypeModifier | \"\"; type: TypeNode }> = { modifier, type: baseType };\n\n while (curr.modifier.length > 0) {\n if (curr.modifier.startsWith(\"!\")) {\n curr = {\n modifier: curr.modifier.slice(1) as TypeModifier,\n type: curr.type.kind === Kind.NON_NULL_TYPE ? curr.type : { kind: Kind.NON_NULL_TYPE, type: curr.type },\n };\n continue;\n }\n\n if (curr.modifier.startsWith(\"[]\")) {\n curr = {\n modifier: curr.modifier.slice(2) as TypeModifier,\n type: { kind: Kind.LIST_TYPE, type: curr.type },\n };\n continue;\n }\n\n throw new Error(`Unknown modifier: ${curr.modifier}`);\n }\n\n return curr.type;\n};\n\nconst buildVariables = (variables: InputTypeSpecifiers): VariableDefinitionNode[] => {\n return Object.entries(variables).map(\n ([name, ref]): VariableDefinitionNode => ({\n kind: Kind.VARIABLE_DEFINITION,\n variable: { kind: Kind.VARIABLE, name: { kind: Kind.NAME, value: name } },\n defaultValue: (ref.defaultValue && buildConstValueNode(ref.defaultValue.default)) || undefined,\n type: buildWithTypeModifier(ref.modifier, () => ({ kind: Kind.NAMED_TYPE, name: { kind: Kind.NAME, value: ref.name } })),\n }),\n );\n};\n\nexport const buildOperationTypeNode = (operation: OperationType): OperationTypeNode => {\n switch (operation) {\n case \"query\":\n return OperationTypeNode.QUERY;\n case \"mutation\":\n return OperationTypeNode.MUTATION;\n case \"subscription\":\n return OperationTypeNode.SUBSCRIPTION;\n default:\n throw new Error(`Unknown operation type: ${operation}`);\n }\n};\n\n// Overloaded function signatures for flexible usage\nexport const buildDocument = <\n TSchema extends AnyGraphqlSchema,\n TFields extends AnyFields,\n TVarDefinitions extends InputTypeSpecifiers,\n>(options: {\n operationName: string;\n operationType: OperationType;\n variables: TVarDefinitions;\n fields: TFields;\n}): TypedQueryDocumentNode<InferFields<TSchema, TFields>, ConstAssignableInput<TSchema, TVarDefinitions>> => {\n const { operationName, operationType, variables, fields } = options;\n return {\n kind: Kind.DOCUMENT,\n definitions: [\n {\n kind: Kind.OPERATION_DEFINITION,\n operation: buildOperationTypeNode(operationType),\n name: { kind: Kind.NAME, value: operationName },\n variableDefinitions: buildVariables(variables),\n // directives: directives || [],\n selectionSet: {\n kind: Kind.SELECTION_SET,\n selections: buildField(fields),\n },\n },\n ],\n } satisfies DocumentNode as TypedQueryDocumentNode<\n InferFields<TSchema, TFields>,\n ConstAssignableInput<TSchema, TVarDefinitions>\n >;\n};\n","const GQL_ELEMENT_FACTORY = Symbol(\"GQL_ELEMENT_FACTORY\");\nconst GQL_ELEMENT_CONTEXT = Symbol(\"GQL_ELEMENT_CONTEXT\");\n\nexport type GqlElementContext = {\n canonicalId: string;\n};\n\nexport type GqlElementDefinitionFactory<T> = (context: GqlElementContext | null) => T;\n\nexport abstract class GqlElement<TDefinition> {\n private [GQL_ELEMENT_FACTORY]: GqlElementDefinitionFactory<TDefinition>;\n private [GQL_ELEMENT_CONTEXT]: GqlElementContext | null = null;\n\n protected constructor(define: GqlElementDefinitionFactory<TDefinition>) {\n let cache: { value: TDefinition } | null = null;\n\n this[GQL_ELEMENT_FACTORY] = (context) => {\n if (cache) {\n return cache.value;\n }\n const value = define(context);\n cache = { value };\n return value;\n };\n }\n\n static setContext<TElement extends GqlElement<any>>(element: TElement, context: GqlElementContext): void {\n element[GQL_ELEMENT_CONTEXT] = context;\n }\n\n static evaluate(element: GqlElement<any>): void {\n void GqlElement.get(element);\n }\n\n static get<TValue>(element: GqlElement<TValue>): TValue {\n const context = element[GQL_ELEMENT_CONTEXT];\n return element[GQL_ELEMENT_FACTORY](context);\n }\n}\n","/** Operation composition helpers (`gql.query`, `gql.mutation`, `gql.subscription`). */\nimport type { TypedQueryDocumentNode } from \"graphql\";\nimport type { Hidden } from \"../../utils/hidden\";\nimport type { Prettify } from \"../../utils/prettify\";\nimport type { UnionToIntersection } from \"../../utils/type-utils\";\nimport type { AnyFields, AssignableInput, InferFields } from \"../fragment\";\nimport type { AnyGraphqlRuntimeAdapter, InferExecutionResultProjection, NormalizedExecutionResult } from \"../runtime\";\nimport type {\n AnyConstAssignableInput,\n AnyGraphqlSchema,\n ConstAssignableInput,\n InputTypeSpecifiers,\n OperationType,\n} from \"../schema\";\nimport { GqlElement, type GqlElementContext } from \"./gql-element\";\nimport type { AnySlicePayloads } from \"./slice\";\n\nexport type AnyComposedOperation =\n | AnyComposedOperationOf<\"query\">\n | AnyComposedOperationOf<\"mutation\">\n | AnyComposedOperationOf<\"subscription\">;\nexport type AnyComposedOperationOf<TOperationType extends OperationType> = ComposedOperation<\n AnyGraphqlRuntimeAdapter,\n TOperationType,\n string,\n string[],\n any,\n any,\n any\n>;\n\ndeclare const __COMPOSED_OPERATION_BRAND__: unique symbol;\n\ntype ComposedOperationDefinition<\n TRuntimeAdapter extends AnyGraphqlRuntimeAdapter,\n TOperationType extends OperationType,\n TOperationName extends string,\n TVariableNames extends string[],\n TVariables extends AnyConstAssignableInput,\n TRawData extends object,\n TProjectedData extends object,\n> = {\n readonly operationType: TOperationType;\n readonly operationName: TOperationName;\n readonly variableNames: TVariableNames;\n readonly projectionPathGraph: ProjectionPathGraphNode;\n readonly document: TypedQueryDocumentNode<TRawData, TVariables>;\n readonly parse: (result: NormalizedExecutionResult<TRuntimeAdapter, TRawData, any>) => TProjectedData;\n};\n\nexport class ComposedOperation<\n TRuntimeAdapter extends AnyGraphqlRuntimeAdapter,\n TOperationType extends OperationType,\n TOperationName extends string,\n TVariableNames extends string[],\n TVariables extends AnyConstAssignableInput,\n TRawData extends object,\n TProjectedData extends object,\n >\n extends GqlElement<\n ComposedOperationDefinition<\n TRuntimeAdapter,\n TOperationType,\n TOperationName,\n TVariableNames,\n TVariables,\n TRawData,\n TProjectedData\n >\n >\n implements\n ComposedOperationDefinition<\n TRuntimeAdapter,\n TOperationType,\n TOperationName,\n TVariableNames,\n TVariables,\n TRawData,\n TProjectedData\n >\n{\n declare readonly [__COMPOSED_OPERATION_BRAND__]: Hidden<{\n operationType: TOperationType;\n }>;\n\n private constructor(\n define: (\n context: GqlElementContext | null,\n ) => ComposedOperationDefinition<\n TRuntimeAdapter,\n TOperationType,\n TOperationName,\n TVariableNames,\n TVariables,\n TRawData,\n TProjectedData\n >,\n ) {\n super(define);\n }\n\n public get operationType() {\n return GqlElement.get(this).operationType;\n }\n public get operationName() {\n return GqlElement.get(this).operationName;\n }\n public get variableNames() {\n return GqlElement.get(this).variableNames;\n }\n public get projectionPathGraph() {\n return GqlElement.get(this).projectionPathGraph;\n }\n public get document() {\n return GqlElement.get(this).document;\n }\n public get parse() {\n return GqlElement.get(this).parse;\n }\n\n static create<\n TSchema extends AnyGraphqlSchema,\n TRuntimeAdapter extends AnyGraphqlRuntimeAdapter,\n TOperationType extends OperationType,\n TOperationName extends string,\n TVariableDefinitions extends InputTypeSpecifiers,\n TSliceFragments extends AnySlicePayloads,\n >(\n define: (context: import(\"./gql-element\").GqlElementContext | null) => {\n operationType: TOperationType;\n operationName: TOperationName;\n variableNames: (keyof TVariableDefinitions & string)[];\n projectionPathGraph: ProjectionPathGraphNode;\n document: TypedQueryDocumentNode<\n InferComposedOperationRawData<TSchema, TSliceFragments>,\n ConstAssignableInput<TSchema, TVariableDefinitions>\n >;\n parse: (\n result: NormalizedExecutionResult<TRuntimeAdapter, InferComposedOperationRawData<TSchema, TSliceFragments>, any>,\n ) => {\n [K in keyof TSliceFragments]: InferExecutionResultProjection<TSliceFragments[K][\"projection\"]>;\n };\n },\n ) {\n return new ComposedOperation(define);\n }\n}\n\nexport type ProjectionPathGraphNode = {\n readonly matches: { label: string; path: string; exact: boolean }[];\n readonly children: { readonly [segment: string]: ProjectionPathGraphNode };\n};\n\nexport type ConcatSlicePayloads<TSlicePayloads extends AnySlicePayloads> = Prettify<\n UnionToIntersection<\n {\n [TLabel in keyof TSlicePayloads & string]: TSlicePayloads[TLabel] extends { getFields: () => infer TFields }\n ? { [K in keyof TFields & string as `${TLabel}_${K}`]: TFields[K] }\n : {};\n }[keyof TSlicePayloads & string]\n >\n> &\n AnyFields;\n\nexport type InferComposedOperationRawData<TSchema extends AnyGraphqlSchema, TSlicePayloads extends AnySlicePayloads> = Prettify<\n InferFields<TSchema, ConcatSlicePayloads<TSlicePayloads>>\n>;\n\nexport type ComposedOperationDefinitionBuilder<\n TSchema extends AnyGraphqlSchema,\n TVarDefinitions extends InputTypeSpecifiers,\n TSliceContents extends AnySlicePayloads,\n> = (tools: { $: NoInfer<AssignableInput<TSchema, TVarDefinitions>> }) => TSliceContents;\n","/** Field builder factories shared by model and slice helpers. */\n\nimport type { IfEmpty } from \"../../utils/empty-object\";\nimport type { UnionToIntersection } from \"../../utils/type-utils\";\nimport type {\n AbstractFieldSelection,\n AnyAssignableInput,\n AnyDirectiveAttachments,\n AnyFieldSelection,\n AnyFields,\n AnyNestedObject,\n AnyNestedUnion,\n AssignableInput,\n FieldSelectionTemplateOf,\n} from \"../fragment\";\nimport type {\n AnyGraphqlSchema,\n InputTypeSpecifiers,\n ObjectFieldRecord,\n OutputEnumSpecifier,\n OutputObjectSpecifier,\n OutputScalarSpecifier,\n OutputTypenameSpecifier,\n OutputUnionSpecifier,\n UnionMemberName,\n} from \"../schema\";\n\nexport const mergeFields = <TFieldEntries extends AnyFields[]>(fields: TFieldEntries) =>\n Object.assign({}, ...fields) as MergeFields<TFieldEntries>;\n\nexport type MergeFields<TFieldEntries extends AnyFields[]> = UnionToIntersection<\n TFieldEntries[number]\n> extends infer TFieldsIntersection\n ? {\n [TFieldName in keyof TFieldsIntersection]: TFieldsIntersection[TFieldName] extends AnyFieldSelection\n ? TFieldsIntersection[TFieldName]\n : never;\n } & {}\n : never;\n\n/**\n * Builder signature exposed to userland `model` and `slice` helpers. The\n * tooling `f`/`fields`/`_` aliases provide ergonomic access to GraphQL fields\n * while preserving the original schema information for inference.\n */\nexport type FieldsBuilder<\n TSchema extends AnyGraphqlSchema,\n TTypeName extends keyof TSchema[\"object\"] & string,\n TVariableDefinitions extends InputTypeSpecifiers,\n TFields extends AnyFields[],\n> = (tools: NoInfer<FieldsBuilderTools<TSchema, TTypeName, TVariableDefinitions>>) => TFields;\n\nexport type FieldsBuilderTools<\n TSchema extends AnyGraphqlSchema,\n TTypeName extends keyof TSchema[\"object\"] & string,\n TVariableDefinitions extends InputTypeSpecifiers,\n> = {\n f: FieldSelectionFactories<TSchema, TTypeName>;\n $: AssignableInput<TSchema, TVariableDefinitions>;\n};\n\n/** Narrow builder used when a field resolves to an object and we need nested selections. */\nexport type NestedObjectFieldsBuilder<\n TSchema extends AnyGraphqlSchema,\n TTypeName extends keyof TSchema[\"object\"] & string,\n TFields extends AnyNestedObject[],\n> = (tools: NoInfer<NestedObjectFieldsBuilderTools<TSchema, TTypeName>>) => TFields;\n\nexport type NestedObjectFieldsBuilderTools<\n TSchema extends AnyGraphqlSchema,\n TTypeName extends keyof TSchema[\"object\"] & string,\n> = {\n f: FieldSelectionFactories<TSchema, TTypeName>;\n};\n\nexport type NestedUnionFieldsBuilder<\n TSchema extends AnyGraphqlSchema,\n TMemberName extends string,\n TUnionFields extends AnyNestedUnion,\n> = {\n [TTypename in keyof TUnionFields & TMemberName]?: NestedObjectFieldsBuilder<\n TSchema,\n TTypename,\n NonNullable<TUnionFields[TTypename]>[]\n >;\n};\n\n/** Map each field to a factory capable of emitting fully-typed references. */\nexport type FieldSelectionFactories<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema[\"object\"] & string> = {\n [TFieldName in keyof ObjectFieldRecord<TSchema, TTypeName>]: TFieldName extends string\n ? FieldSelectionFactory<TSchema, FieldSelectionTemplateOf<TSchema, TTypeName, TFieldName>>\n : never;\n};\n\nexport type AnyFieldSelectionFactory = <TAlias extends string | null = null>(\n fieldArgs: AnyAssignableInput | void,\n extras?: { alias?: TAlias; directives?: AnyDirectiveAttachments },\n) => AnyFieldSelectionFactoryReturn<TAlias>;\n\nexport type FieldSelectionFactory<TSchema extends AnyGraphqlSchema, TSelection extends AnyFieldSelection> = <\n TAlias extends string | null = null,\n>(\n fieldArgs: TSelection[\"args\"] | IfEmpty<TSelection[\"args\"], void | null>,\n extras?: { alias?: TAlias; directives?: TSelection[\"directives\"] },\n) => FieldSelectionFactoryReturn<TSchema, TSelection, TAlias>;\n\nexport type AnyFieldSelectionFactoryReturn<TAlias extends string | null> =\n | FieldSelectionFactoryReturn<AnyGraphqlSchema, AnyFieldSelection & { type: OutputObjectSpecifier }, TAlias>\n | FieldSelectionFactoryReturn<AnyGraphqlSchema, AnyFieldSelection & { type: OutputUnionSpecifier }, TAlias>\n | FieldSelectionFactoryReturn<\n AnyGraphqlSchema,\n AnyFieldSelection & { type: OutputTypenameSpecifier | OutputScalarSpecifier | OutputEnumSpecifier },\n TAlias\n >;\n\nexport type FieldSelectionFactoryReturn<\n TSchema extends AnyGraphqlSchema,\n TSelection extends AnyFieldSelection,\n TAlias extends string | null,\n> = TSelection extends { type: OutputObjectSpecifier }\n ? FieldSelectionFactoryObjectReturn<TSchema, TSelection, TAlias>\n : TSelection extends { type: OutputUnionSpecifier }\n ? FieldSelectionFactoryUnionReturn<TSchema, TSelection, TAlias>\n : TSelection extends { type: OutputTypenameSpecifier | OutputScalarSpecifier | OutputEnumSpecifier }\n ? FieldSelectionFactoryPrimitiveReturn<TSelection, TAlias>\n : never;\n\nexport type FieldSelectionFactoryObjectReturn<\n TSchema extends AnyGraphqlSchema,\n TSelection extends AnyFieldSelection & { type: OutputObjectSpecifier },\n TAlias extends string | null,\n> = <TNested extends AnyNestedObject[]>(\n nest: NestedObjectFieldsBuilder<TSchema, TSelection[\"type\"][\"name\"], TNested>,\n) => {\n [_ in TAlias extends null ? TSelection[\"field\"] : TAlias]: AbstractFieldSelection<\n TSelection[\"parent\"],\n TSelection[\"field\"],\n TSelection[\"type\"],\n TSelection[\"args\"],\n TSelection[\"directives\"],\n { object: MergeFields<TNested> }\n >;\n};\n\nexport type FieldSelectionFactoryUnionReturn<\n TSchema extends AnyGraphqlSchema,\n TSelection extends AnyFieldSelection & { type: OutputUnionSpecifier },\n TAlias extends string | null,\n> = <TNested extends AnyNestedUnion>(\n nest: NestedUnionFieldsBuilder<TSchema, UnionMemberName<TSchema, TSelection[\"type\"]>, TNested>,\n) => {\n [_ in TAlias extends null ? TSelection[\"field\"] : TAlias]: AbstractFieldSelection<\n TSelection[\"parent\"],\n TSelection[\"field\"],\n TSelection[\"type\"],\n TSelection[\"args\"],\n TSelection[\"directives\"],\n { union: TNested }\n >;\n};\n\nexport type FieldSelectionFactoryPrimitiveReturn<\n TSelection extends AnyFieldSelection & { type: OutputTypenameSpecifier | OutputScalarSpecifier | OutputEnumSpecifier },\n TAlias extends string | null,\n> = {\n [_ in TAlias extends null ? TSelection[\"field\"] : TAlias]: AbstractFieldSelection<\n TSelection[\"parent\"],\n TSelection[\"field\"],\n TSelection[\"type\"],\n TSelection[\"args\"],\n TSelection[\"directives\"],\n {}\n >;\n};\n\nexport type FieldSelectionFactoryFieldArguments<TFieldSelectionTemplate extends AnyFieldSelection> =\n | TFieldSelectionTemplate[\"args\"]\n | IfEmpty<TFieldSelectionTemplate[\"args\"], void | null>;\n","/** Operation composition helpers (`gql.query`, `gql.mutation`, `gql.subscription`). */\nimport type { TypedQueryDocumentNode } from \"graphql\";\nimport type { Hidden } from \"../../utils/hidden\";\nimport type { AnyFields, InferFields } from \"../fragment\";\nimport type {\n AnyConstAssignableInput,\n AnyGraphqlSchema,\n ConstAssignableInput,\n InputTypeSpecifiers,\n OperationType,\n} from \"../schema\";\nimport { GqlElement, type GqlElementContext } from \"./gql-element\";\n\nexport type AnyInlineOperation =\n | AnyInlineOperationOf<\"query\">\n | AnyInlineOperationOf<\"mutation\">\n | AnyInlineOperationOf<\"subscription\">;\nexport type AnyInlineOperationOf<TOperationType extends OperationType> = InlineOperation<\n TOperationType,\n string,\n string[],\n any,\n AnyFields,\n any\n>;\n\ndeclare const __INLINE_OPERATION_BRAND__: unique symbol;\n\ntype InlineOperationArtifact<\n TOperationType extends OperationType,\n TOperationName extends string,\n TVariableNames extends string[],\n TVariables extends AnyConstAssignableInput,\n TFields extends Partial<AnyFields>,\n TData extends object,\n> = {\n readonly operationType: TOperationType;\n readonly operationName: TOperationName;\n readonly variableNames: TVariableNames;\n readonly documentSource: () => TFields;\n readonly document: TypedQueryDocumentNode<TData, TVariables>;\n};\n\nexport class InlineOperation<\n TOperationType extends OperationType,\n TOperationName extends string,\n TVariableNames extends string[],\n TVariables extends AnyConstAssignableInput,\n TFields extends Partial<AnyFields>,\n TData extends object,\n >\n extends GqlElement<InlineOperationArtifact<TOperationType, TOperationName, TVariableNames, TVariables, TFields, TData>>\n implements InlineOperationArtifact<TOperationType, TOperationName, TVariableNames, TVariables, TFields, TData>\n{\n declare readonly [__INLINE_OPERATION_BRAND__]: Hidden<{\n operationType: TOperationType;\n }>;\n\n private constructor(\n define: (\n context: GqlElementContext | null,\n ) => InlineOperationArtifact<TOperationType, TOperationName, TVariableNames, TVariables, TFields, TData>,\n ) {\n super(define);\n }\n\n public get operationType() {\n return GqlElement.get(this).operationType;\n }\n public get operationName() {\n return GqlElement.get(this).operationName;\n }\n public get variableNames() {\n return GqlElement.get(this).variableNames;\n }\n public get documentSource() {\n return GqlElement.get(this).documentSource;\n }\n public get document() {\n return GqlElement.get(this).document;\n }\n\n static create<\n TSchema extends AnyGraphqlSchema,\n TOperationType extends OperationType,\n TOperationName extends string,\n TVariableDefinitions extends InputTypeSpecifiers,\n TFields extends AnyFields,\n >(\n define: (context: GqlElementContext | null) => {\n operationType: TOperationType;\n operationName: TOperationName;\n variableNames: (keyof TVariableDefinitions & string)[];\n documentSource: () => TFields;\n document: TypedQueryDocumentNode<InferFields<TSchema, TFields>, ConstAssignableInput<TSchema, TVariableDefinitions>>;\n },\n ) {\n return new InlineOperation(define);\n }\n}\n","/** Model helper types mirroring the `gql.model` API. */\n\nimport type { SwitchIfEmpty } from \"../../utils/empty-object\";\nimport type { Hidden } from \"../../utils/hidden\";\nimport type { AnyAssignableInput, AnyFields, AssignableInput, InferFields } from \"../fragment\";\nimport type { AnyGraphqlSchema, InputTypeSpecifiers } from \"../schema\";\nimport { GqlElement } from \"./gql-element\";\n\nexport type AnyModel = Model<string, any, AnyFields, any, any>;\n\ntype ModelArtifact<\n TTypeName extends string,\n TVariables extends Partial<AnyAssignableInput> | void,\n TFields extends Partial<AnyFields>,\n TRaw extends object,\n TNormalized extends object,\n> = {\n readonly typename: TTypeName;\n readonly fragment: (variables: TVariables) => TFields;\n readonly normalize: (raw: TRaw) => TNormalized;\n};\n\ndeclare const __MODEL_BRAND__: unique symbol;\nexport class Model<\n TTypeName extends string,\n TVariables extends Partial<AnyAssignableInput> | void,\n TFields extends Partial<AnyFields>,\n TRaw extends object,\n TNormalized extends object,\n >\n extends GqlElement<ModelArtifact<TTypeName, TVariables, TFields, TRaw, TNormalized>>\n implements ModelArtifact<TTypeName, TVariables, TFields, TRaw, TNormalized>\n{\n declare readonly [__MODEL_BRAND__]: Hidden<{\n input: TVariables;\n output: TNormalized;\n }>;\n\n private constructor(define: () => ModelArtifact<TTypeName, TVariables, TFields, TRaw, TNormalized>) {\n super(define);\n }\n\n public get typename() {\n return GqlElement.get(this).typename;\n }\n public get fragment() {\n return GqlElement.get(this).fragment;\n }\n public get normalize() {\n return GqlElement.get(this).normalize;\n }\n\n static create<\n TSchema extends AnyGraphqlSchema,\n TTypeName extends keyof TSchema[\"object\"] & string,\n TVariableDefinitions extends InputTypeSpecifiers,\n TFields extends AnyFields,\n TNormalized extends object,\n >(\n define: () => {\n typename: TTypeName;\n fragment: (variables: SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>) => TFields;\n normalize: (raw: NoInfer<InferFields<TSchema, TFields>>) => TNormalized;\n },\n ) {\n type Fields = TFields & { [key: symbol]: never };\n type Raw = InferFields<TSchema, TFields> & { [key: symbol]: never };\n\n return new Model(\n define as () => ModelArtifact<\n TTypeName,\n SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>,\n Fields,\n Raw,\n TNormalized\n >,\n );\n }\n}\n","import type { SwitchIfEmpty } from \"../../utils/empty-object\";\nimport type { Hidden } from \"../../utils/hidden\";\nimport type { AnyAssignableInput, AnyFields, AssignableInput } from \"../fragment\";\nimport type { AnyProjection, InferExecutionResultProjection } from \"../runtime\";\nimport type { AnyGraphqlSchema, InputTypeSpecifiers, OperationType } from \"../schema\";\nimport { GqlElement } from \"./gql-element\";\n\nexport type AnySlice = AnySliceOf<\"query\"> | AnySliceOf<\"mutation\"> | AnySliceOf<\"subscription\">;\nexport type AnySliceOf<TOperationType extends OperationType> = Slice<TOperationType, any, AnyFields, AnyProjection>;\n\ntype SliceDefinition<\n TOperationType extends OperationType,\n TVariables extends Partial<AnyAssignableInput> | void,\n TFields extends Partial<AnyFields>,\n TProjection extends AnyProjection,\n> = {\n readonly operationType: TOperationType;\n readonly embed: (variables: TVariables) => SlicePayload<TVariables, TFields, TProjection>;\n};\n\ndeclare const __OPERATION_SLICE_BRAND__: unique symbol;\nexport class Slice<\n TOperationType extends OperationType,\n TVariables extends Partial<AnyAssignableInput> | void,\n TFields extends Partial<AnyFields>,\n TProjection extends AnyProjection,\n >\n extends GqlElement<SliceDefinition<TOperationType, TVariables, TFields, TProjection>>\n implements SliceDefinition<TOperationType, TVariables, TFields, TProjection>\n{\n declare readonly [__OPERATION_SLICE_BRAND__]: Hidden<{\n operationType: TOperationType;\n output: InferExecutionResultProjection<TProjection>;\n }>;\n\n private constructor(define: () => SliceDefinition<TOperationType, TVariables, TFields, TProjection>) {\n super(define);\n }\n\n public get operationType() {\n return GqlElement.get(this).operationType;\n }\n public get embed() {\n return GqlElement.get(this).embed;\n }\n\n static create<\n TSchema extends AnyGraphqlSchema,\n TOperationType extends OperationType,\n TVariableDefinitions extends InputTypeSpecifiers,\n TFields extends AnyFields,\n TProjection extends AnyProjection,\n >(\n define: () => {\n operationType: TOperationType;\n embed: (\n variables: SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>,\n ) => SlicePayload<\n SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>,\n TFields,\n TProjection\n >;\n },\n ) {\n type Fields = TFields & { [key: symbol]: never };\n type Variables = SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>;\n\n return new Slice(define as () => SliceDefinition<TOperationType, Variables, Fields, TProjection>);\n }\n}\n\nexport type AnySlicePayloads = { [key: string]: AnySlicePayload };\n\nexport type AnySlicePayload = SlicePayload<AnyAssignableInput | void, AnyFields, AnyProjection>;\nexport type SlicePayload<\n TVariables extends Partial<AnyAssignableInput> | void,\n TFields extends Partial<AnyFields>,\n TProjection extends AnyProjection,\n> = {\n variables: TVariables;\n getFields: () => TFields;\n projection: TProjection;\n};\n\nexport type InferOutputOfSlice<TSlice extends AnySliceOf<any>> = ReturnType<TSlice[typeof __OPERATION_SLICE_BRAND__]>[\"output\"];\n","import type { AnySlicePayload, ProjectionPathGraphNode } from \"../types/element\";\nimport { mapValues } from \"../utils/map-values\";\n\ntype ExecutionResultProjectionPathGraphIntermediate = {\n [segment: string]: { label: string; raw: string; segments: string[] }[];\n};\n\nfunction createPathGraph(paths: ExecutionResultProjectionPathGraphIntermediate[string]): ProjectionPathGraphNode {\n const intermediate = paths.reduce(\n (acc: ExecutionResultProjectionPathGraphIntermediate, { label, raw, segments: [segment, ...segments] }) => {\n if (segment) {\n (acc[segment] || (acc[segment] = [])).push({ label, raw, segments });\n }\n return acc;\n },\n {},\n );\n\n return {\n matches: paths.map(({ label, raw, segments }) => ({ label, path: raw, exact: segments.length === 0 })),\n children: mapValues(intermediate, (paths) => createPathGraph(paths)),\n } satisfies ProjectionPathGraphNode;\n}\n\nexport function createPathGraphFromSliceEntries(fragments: { [key: string]: AnySlicePayload }) {\n const paths = Object.entries(fragments).flatMap(([label, slice]) =>\n Array.from(\n new Map(\n slice.projection.paths.map(({ full: raw, segments }) => {\n const [first, ...rest] = segments;\n return [raw, { label, raw, segments: [`${label}_${first}`, ...rest] }];\n }),\n ).values(),\n ),\n );\n\n return createPathGraph(paths);\n}\n","import { createExecutionResultParser } from \"../runtime/parse-execution-result\";\nimport {\n type AnySlicePayloads,\n ComposedOperation,\n type ComposedOperationDefinitionBuilder,\n type ConcatSlicePayloads,\n} from \"../types/element\";\nimport type { AnyGraphqlRuntimeAdapter } from \"../types/runtime\";\nimport type { AnyGraphqlSchema, InputTypeSpecifiers, OperationType } from \"../types/schema\";\n\nimport { buildDocument } from \"./build-document\";\nimport { createVarRefs, type MergeVarDefinitions, mergeVarDefinitions } from \"./input\";\nimport { createPathGraphFromSliceEntries } from \"./projection-path-graph\";\n\nexport const createComposedOperationComposerFactory = <\n TSchema extends AnyGraphqlSchema,\n TRuntimeAdapter extends AnyGraphqlRuntimeAdapter,\n>() => {\n return <TOperationType extends OperationType>(operationType: TOperationType) => {\n return <\n TOperationName extends string,\n TSliceFragments extends AnySlicePayloads,\n TVarDefinitions extends InputTypeSpecifiers[] = [{}],\n >(\n options: {\n operationName: TOperationName;\n variables?: TVarDefinitions;\n },\n builder: ComposedOperationDefinitionBuilder<TSchema, MergeVarDefinitions<TVarDefinitions>, TSliceFragments>,\n ) => {\n return ComposedOperation.create<\n TSchema,\n TRuntimeAdapter,\n TOperationType,\n TOperationName,\n MergeVarDefinitions<TVarDefinitions>,\n TSliceFragments\n >(() => {\n const { operationName } = options;\n const variables = mergeVarDefinitions((options.variables ?? []) as TVarDefinitions);\n const $ = createVarRefs(variables);\n const fragments = builder({ $ });\n\n const fields = Object.fromEntries(\n Object.entries(fragments).flatMap(([label, { getFields: fields }]) =>\n Object.entries(fields).map(([key, reference]) => [`${label}_${key}`, reference]),\n ),\n ) as ConcatSlicePayloads<TSliceFragments>;\n const projectionPathGraph = createPathGraphFromSliceEntries(fragments);\n\n return {\n operationType,\n operationName,\n variableNames: Object.keys(variables) as (keyof MergeVarDefinitions<TVarDefinitions> & string)[],\n projectionPathGraph,\n document: buildDocument({\n operationName,\n operationType,\n variables,\n fields,\n }),\n parse: createExecutionResultParser({ fragments, projectionPathGraph }),\n };\n });\n };\n };\n};\n","export const wrapByKey = <TName extends string, TValue>(name: TName, value: TValue) =>\n ({\n [name]: value,\n }) as {\n [K in TName]: TValue;\n };\n","import {\n type AnyFieldSelectionFactory,\n type AnyFieldSelectionFactoryReturn,\n type FieldSelectionFactories,\n type FieldSelectionFactoryObjectReturn,\n type FieldSelectionFactoryPrimitiveReturn,\n type FieldSelectionFactoryUnionReturn,\n mergeFields,\n type NestedObjectFieldsBuilder,\n type NestedUnionFieldsBuilder,\n} from \"../types/element\";\nimport type { AnyFieldSelection, AnyNestedObject, AnyNestedUnion } from \"../types/fragment\";\nimport type {\n AnyGraphqlSchema,\n OutputEnumSpecifier,\n OutputObjectSpecifier,\n OutputScalarSpecifier,\n OutputTypenameSpecifier,\n OutputUnionSpecifier,\n UnionMemberName,\n} from \"../types/schema\";\nimport { mapValues } from \"../utils/map-values\";\nimport { wrapByKey } from \"../utils/wrap-by-key\";\n\n// Cache is schema-scoped to avoid cross-schema contamination when multiple schemas share type names\ntype CacheMap = Map<string, Record<string, AnyFieldSelectionFactory>>;\n\nconst cacheMapBySchema = new WeakMap<AnyGraphqlSchema, CacheMap>();\nconst ensureCacheMapBySchema = (schema: AnyGraphqlSchema) => {\n const cachedCacheMap = cacheMapBySchema.get(schema);\n if (cachedCacheMap) {\n return cachedCacheMap;\n }\n\n const cacheMap: CacheMap = new Map();\n cacheMapBySchema.set(schema, cacheMap);\n return cacheMap;\n};\n\nexport const createFieldFactories = <TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema[\"object\"] & string>(\n schema: TSchema,\n typeName: TTypeName,\n): FieldSelectionFactories<TSchema, TTypeName> => {\n const cacheMap = ensureCacheMapBySchema(schema);\n const cached = cacheMap.get(typeName);\n if (cached) {\n return cached as unknown as FieldSelectionFactories<TSchema, TTypeName>;\n }\n\n const factories = createFieldFactoriesInner(schema, typeName);\n cacheMap.set(typeName, factories as unknown as Record<string, AnyFieldSelectionFactory>);\n\n return factories;\n};\n\nconst createFieldFactoriesInner = <TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema[\"object\"] & string>(\n schema: TSchema,\n typeName: TTypeName,\n): FieldSelectionFactories<TSchema, TTypeName> => {\n const typeDef = schema.object[typeName];\n if (!typeDef) {\n throw new Error(`Type ${typeName} is not defined in schema objects`);\n }\n\n const entries = Object.entries(typeDef.fields).map(([fieldName, type]): [string, AnyFieldSelectionFactory] => {\n const factory: AnyFieldSelectionFactory = <TAlias extends string | null = null>(\n fieldArgs: AnyFieldSelection[\"args\"] | null | void,\n extras?: { alias?: TAlias; directives?: AnyFieldSelection[\"directives\"] },\n ) => {\n const wrap = <T>(value: T) => wrapByKey((extras?.alias ?? fieldName) as TAlias extends null ? string : TAlias, value);\n\n if (type.kind === \"object\") {\n type TSelection = AnyFieldSelection & { type: OutputObjectSpecifier };\n const factoryReturn: AnyFieldSelectionFactoryReturn<TAlias> = (<TNested extends AnyNestedObject[]>(\n nest: NestedObjectFieldsBuilder<TSchema, TSelection[\"type\"][\"name\"], TNested>,\n ) =>\n wrap({\n parent: typeName,\n field: fieldName,\n type: type,\n args: fieldArgs ?? {},\n directives: extras?.directives ?? {},\n object: mergeFields(nest({ f: createFieldFactories(schema, type.name) })),\n union: null,\n } satisfies AnyFieldSelection)) satisfies FieldSelectionFactoryObjectReturn<TSchema, TSelection, TAlias>;\n\n return factoryReturn;\n }\n\n if (type.kind === \"union\") {\n type TSelection = AnyFieldSelection & { type: OutputUnionSpecifier };\n const factoryReturn: AnyFieldSelectionFactoryReturn<TAlias> = (<TNested extends AnyNestedUnion>(\n nest: NestedUnionFieldsBuilder<TSchema, UnionMemberName<TSchema, TSelection[\"type\"]>, TNested>,\n ) =>\n wrap({\n parent: typeName,\n field: fieldName,\n type: type,\n args: fieldArgs ?? {},\n directives: extras?.directives ?? {},\n object: null,\n union: mapValues(\n nest as Record<string, NestedObjectFieldsBuilder<TSchema, string, AnyNestedObject[]> | undefined>,\n (builder, memberName) => {\n if (!builder) {\n throw new Error(`Builder is undefined for member name: ${memberName}`);\n }\n return mergeFields(builder({ f: createFieldFactories(schema, memberName) }));\n },\n ) as TNested,\n } satisfies AnyFieldSelection)) satisfies FieldSelectionFactoryUnionReturn<TSchema, TSelection, TAlias>;\n\n return factoryReturn;\n }\n\n if (type.kind === \"scalar\" || type.kind === \"enum\" || type.kind === \"typename\") {\n type TSelection = AnyFieldSelection & { type: OutputTypenameSpecifier | OutputScalarSpecifier | OutputEnumSpecifier };\n const factoryReturn: AnyFieldSelectionFactoryReturn<TAlias> = wrap({\n parent: typeName,\n field: fieldName,\n type,\n args: fieldArgs ?? {},\n directives: extras?.directives ?? {},\n object: null,\n union: null,\n } satisfies AnyFieldSelection) satisfies FieldSelectionFactoryPrimitiveReturn<TSelection, TAlias>;\n return factoryReturn;\n }\n\n throw new Error(`Unsupported field type: ${type satisfies never}`);\n };\n\n return [fieldName, factory] as const;\n });\n\n const factories: Record<string, AnyFieldSelectionFactory> = Object.fromEntries(entries);\n\n return factories as unknown as FieldSelectionFactories<TSchema, TTypeName>;\n};\n","import { type FieldsBuilder, InlineOperation, type MergeFields, mergeFields } from \"../types/element\";\nimport type { AnyFields } from \"../types/fragment\";\nimport type { AnyGraphqlRuntimeAdapter } from \"../types/runtime\";\nimport type { AnyGraphqlSchema, InputTypeSpecifiers, OperationType } from \"../types/schema\";\n\nimport { buildDocument } from \"./build-document\";\nimport { createFieldFactories } from \"./fields-builder\";\nimport { createVarRefs, type MergeVarDefinitions, mergeVarDefinitions } from \"./input\";\n\nexport const createInlineOperationComposerFactory = <\n TSchema extends AnyGraphqlSchema,\n _TRuntimeAdapter extends AnyGraphqlRuntimeAdapter,\n>(\n schema: NoInfer<TSchema>,\n) => {\n return <TOperationType extends OperationType>(operationType: TOperationType) => {\n type TTypeName = TSchema[\"operations\"][TOperationType] & keyof TSchema[\"object\"] & string;\n const operationTypeName: TTypeName | null = schema.operations[operationType];\n if (operationTypeName === null) {\n throw new Error(`Operation type ${operationType} is not defined in schema roots`);\n }\n\n return <TOperationName extends string, TFields extends AnyFields[], TVarDefinitions extends InputTypeSpecifiers[] = [{}]>(\n options: {\n operationName: TOperationName;\n variables?: TVarDefinitions;\n },\n fieldBuilder: FieldsBuilder<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, TFields>,\n ) => {\n return InlineOperation.create<\n TSchema,\n TOperationType,\n TOperationName,\n MergeVarDefinitions<TVarDefinitions>,\n MergeFields<TFields>\n >(() => {\n const { operationName } = options;\n const variables = mergeVarDefinitions((options.variables ?? []) as TVarDefinitions);\n const $ = createVarRefs(variables);\n const f = createFieldFactories(schema, operationTypeName);\n const fields = mergeFields(fieldBuilder({ f, $ }));\n\n return {\n operationType,\n operationName,\n variableNames: Object.keys(variables) as (keyof MergeVarDefinitions<TVarDefinitions> & string)[],\n documentSource: () => fields,\n document: buildDocument({\n operationName,\n operationType,\n variables,\n fields,\n }),\n };\n });\n };\n };\n};\n","import { type FieldsBuilder, type MergeFields, Model, mergeFields } from \"../types/element\";\nimport type { AnyFields, InferFields } from \"../types/fragment\";\nimport type { AnyGraphqlSchema, InputTypeSpecifiers, OperationType } from \"../types/schema\";\nimport { mapValues } from \"../utils/map-values\";\nimport { createFieldFactories } from \"./fields-builder\";\nimport { createVarAssignments, type MergeVarDefinitions, mergeVarDefinitions } from \"./input\";\n\nexport const createGqlModelComposers = <TSchema extends AnyGraphqlSchema>(schema: NoInfer<TSchema>) => {\n type ModelBuilder<TTypeName extends keyof TSchema[\"object\"] & string> = <\n TFieldEntries extends AnyFields[],\n TNormalized extends object,\n TVarDefinitions extends InputTypeSpecifiers[] = [{}],\n >(\n options: {\n variables?: TVarDefinitions;\n },\n builder: FieldsBuilder<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, TFieldEntries>,\n normalize: (raw: NoInfer<InferFields<TSchema, MergeFields<TFieldEntries>>>) => TNormalized,\n ) => ReturnType<\n typeof Model.create<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, MergeFields<TFieldEntries>, TNormalized>\n >;\n\n const createModelComposer = <TTypeName extends keyof TSchema[\"object\"] & string>(\n typename: TTypeName,\n ): ModelBuilder<TTypeName> => {\n return <TFieldEntries extends AnyFields[], TNormalized extends object, TVarDefinitions extends InputTypeSpecifiers[] = [{}]>(\n options: {\n variables?: TVarDefinitions;\n },\n builder: FieldsBuilder<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, TFieldEntries>,\n normalize: (raw: NoInfer<InferFields<TSchema, MergeFields<TFieldEntries>>>) => TNormalized,\n ) =>\n Model.create<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, MergeFields<TFieldEntries>, TNormalized>(() => {\n const varDefinitions = mergeVarDefinitions((options.variables ?? []) as TVarDefinitions);\n return {\n typename,\n fragment: (variables) => {\n const f = createFieldFactories(schema, typename);\n const $ = createVarAssignments(varDefinitions, variables);\n return mergeFields(builder({ f, $ }));\n },\n normalize,\n };\n });\n };\n\n type ModelBuildersAll = {\n readonly [TTypeName in keyof TSchema[\"object\"]]: TTypeName extends string ? ModelBuilder<TTypeName> : never;\n };\n type ModelBuilders = Omit<ModelBuildersAll, TSchema[\"operations\"][OperationType] & keyof ModelBuildersAll>;\n\n return mapValues(schema.object, (_, typename) => createModelComposer(typename)) as ModelBuilders;\n};\n","import { handleProjectionBuilder } from \"../runtime/slice\";\nimport {\n type ExecutionResultProjectionsBuilder,\n type FieldsBuilder,\n type MergeFields,\n mergeFields,\n Slice,\n} from \"../types/element\";\nimport type { AnyFields } from \"../types/fragment\";\nimport type { AnyGraphqlRuntimeAdapter, AnyProjection } from \"../types/runtime\";\nimport type { AnyGraphqlSchema, InputTypeSpecifiers, OperationType } from \"../types/schema\";\n\nimport { createFieldFactories } from \"./fields-builder\";\nimport { createVarAssignments, type MergeVarDefinitions, mergeVarDefinitions } from \"./input\";\n\nexport const createSliceComposerFactory = <TSchema extends AnyGraphqlSchema, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter>(\n schema: NoInfer<TSchema>,\n) => {\n return <TOperationType extends OperationType>(operationType: TOperationType) => {\n type TTypeName = TSchema[\"operations\"][TOperationType] & keyof TSchema[\"object\"] & string;\n const operationTypeName: TTypeName | null = schema.operations[operationType];\n if (operationTypeName === null) {\n throw new Error(`Operation type ${operationType} is not defined in schema roots`);\n }\n\n return <\n TFieldEntries extends AnyFields[],\n TProjection extends AnyProjection,\n TVarDefinitions extends InputTypeSpecifiers[] = [{}],\n >(\n options: {\n variables?: TVarDefinitions;\n },\n fieldBuilder: FieldsBuilder<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, TFieldEntries>,\n projectionBuilder: ExecutionResultProjectionsBuilder<TSchema, TRuntimeAdapter, MergeFields<TFieldEntries>, TProjection>,\n ) =>\n Slice.create<TSchema, TOperationType, MergeVarDefinitions<TVarDefinitions>, MergeFields<TFieldEntries>, TProjection>(() => {\n const varDefinitions = mergeVarDefinitions((options.variables ?? []) as TVarDefinitions);\n const projection = handleProjectionBuilder(projectionBuilder);\n\n return {\n operationType,\n embed: (variables) => {\n const f = createFieldFactories(schema, operationTypeName);\n const $ = createVarAssignments(varDefinitions, variables);\n const fields = mergeFields(fieldBuilder({ f, $ }));\n return { variables, getFields: () => fields, projection };\n },\n };\n });\n };\n};\n","export type AnyTypeModifier = string;\n\nexport type TypeModifier = \"?\" | `!${string}` | `[]${string}`;\n\nexport type ListTypeModifierSuffix = \"[]\" | \"[]!\";\nexport type StripTailingListFromTypeModifier<TModifier extends TypeModifier> =\n TModifier extends `${infer TInner extends TypeModifier}${ListTypeModifierSuffix}` ? TInner : TModifier;\n\nexport type ApplyTypeModifier<TModifier extends TypeModifier, TInner> = TModifier extends \"!\"\n ? TInner\n : TModifier extends \"?\" | \"\"\n ? TInner | null | undefined\n : TModifier extends `![]${infer TNext extends TypeModifier}`\n ? ApplyTypeModifier<TNext, TInner[]>\n : TModifier extends `[]${infer TNext extends TypeModifier}`\n ? ApplyTypeModifier<TNext, (TInner | null | undefined)[]>\n : never;\n\nexport type ApplyTypeModifierToKeys<T extends { [key: string]: { modifier: TypeModifier } }> = {\n readonly [K in keyof T as T[K][\"modifier\"] extends `${string}!` ? K : never]-?: T[K];\n} & {\n readonly [K in keyof T as T[K][\"modifier\"] extends `${string}!` ? never : K]+?: T[K];\n};\n\nexport type ModifiedTypeName<TNameCandidate extends string, TName extends TNameCandidate, TModifier extends AnyTypeModifier> =\n | (`${TName}:${TModifier}` & NoInfer<TypeModifierValidation<TModifier>>)\n | NoInfer<`${TName}:${TypeModifierSuggestion<TModifier>}`>;\n\ntype TypeModifierSuggestion<TModifier extends AnyTypeModifier> = [TModifier, TypeModifier] extends [TypeModifier, TModifier]\n ? \"?\" | \"!\" | \"[]\"\n : TModifier extends \"?\"\n ? \"?\"\n : TModifier extends `${string}!`\n ? `${TModifier}[]`\n : TModifier extends `${string}[]`\n ? `${TModifier}[]` | `${TModifier}!`\n : never;\n\ntype TypeModifierValidation<TModifier extends AnyTypeModifier> = TModifier extends \"?\" | \"!\"\n ? string\n : TModifier extends `${\"!\" | \"\"}[]${infer TNext extends TypeModifier | \"\"}`\n ? TNext extends \"\"\n ? string\n : TypeModifierValidation<TNext>\n : { _: \"If you see this message on type error, modifier format is wrong.\" };\n\nexport const parseModifiedTypeName = <TName extends string, TModifier extends AnyTypeModifier>(\n nameAndModifier: ModifiedTypeName<string, TName, TModifier>,\n) => {\n if (typeof nameAndModifier !== \"string\") {\n throw new Error(`Invalid modified type name: ${nameAndModifier}`);\n }\n\n const [name, modifier] = nameAndModifier.split(\":\") as [TName, TModifier];\n return { name, modifier };\n};\n","import {\n type AnyConstDirectiveAttachments,\n type AnyGraphqlSchema,\n type AnyTypeSpecifier,\n type ConstAssignableInputValue,\n type ModifiedTypeName,\n parseModifiedTypeName,\n type TypeModifier,\n} from \"../types/schema\";\nimport { wrapByKey } from \"../utils/wrap-by-key\";\n\ntype AssignableDefaultValue<\n TSchema extends AnyGraphqlSchema,\n TKind extends \"scalar\" | \"enum\" | \"input\",\n TName extends keyof TSchema[TKind] & string,\n TModifier extends TypeModifier,\n> = ConstAssignableInputValue<\n TSchema,\n {\n scalar: { kind: \"scalar\"; name: TName; modifier: TModifier; directives: {}; defaultValue: null };\n enum: { kind: \"enum\"; name: TName; modifier: TModifier; directives: {}; defaultValue: null };\n input: { kind: \"input\"; name: TName; modifier: TModifier; directives: {}; defaultValue: null };\n }[TKind]\n>;\n\nexport const createVarBuilder = <TSchema extends AnyGraphqlSchema>(schema: TSchema) => {\n const $ = <TVarName extends string>(varName: TVarName) => {\n const createRefBuilder = <TKind extends \"scalar\" | \"enum\" | \"input\">(kind: TKind) => {\n type InputRef<\n TTypeName extends keyof TSchema[TKind] & string,\n TModifier extends TypeModifier,\n TDefaultFn extends (() => AssignableDefaultValue<TSchema, TKind, TTypeName, TModifier>) | null,\n TDirectives extends AnyConstDirectiveAttachments,\n > = {\n kind: TKind;\n name: TTypeName;\n modifier: TModifier;\n defaultValue: TDefaultFn extends null\n ? null\n : {\n default: ReturnType<NonNullable<TDefaultFn>>;\n };\n directives: TDirectives;\n };\n\n return <\n const TTypeName extends keyof TSchema[TKind] & string,\n const TModifier extends TypeModifier,\n const TDefaultFn extends (() => AssignableDefaultValue<TSchema, TKind, TTypeName, TModifier>) | null = null,\n const TDirectives extends AnyConstDirectiveAttachments = {},\n >(\n type: ModifiedTypeName<string, TTypeName, TModifier>,\n extras?: {\n default?:\n | (TDefaultFn & (() => AssignableDefaultValue<TSchema, TKind, TTypeName, TModifier>))\n | (NoInfer<TDefaultFn> extends null ? () => AssignableDefaultValue<TSchema, TKind, TTypeName, TModifier> : never);\n directives?: TDirectives;\n },\n ) =>\n wrapByKey(varName, {\n kind,\n ...parseModifiedTypeName(type),\n defaultValue: extras?.default ? { default: extras.default() } : null,\n directives: extras?.directives ?? ({} as TDirectives),\n } satisfies AnyTypeSpecifier as InputRef<TTypeName, TModifier, TDefaultFn, TDirectives>);\n };\n\n return {\n scalar: createRefBuilder(\"scalar\"),\n enum: createRefBuilder(\"enum\"),\n input: createRefBuilder(\"input\"),\n\n byField: <\n const TTypeName extends keyof TSchema[\"object\"] & string,\n const TFieldName extends keyof TSchema[\"object\"][TTypeName][\"fields\"] & string,\n const TArgName extends keyof TSchema[\"object\"][TTypeName][\"fields\"][TFieldName][\"arguments\"] & string,\n >(\n typeName: TTypeName,\n fieldName: TFieldName,\n argName: TArgName,\n ) => {\n const argTypeRef = schema.object[typeName]?.fields[fieldName]?.arguments[argName];\n\n if (!argTypeRef) {\n throw new Error(`Argument ${argName} not found in field ${fieldName} of type ${typeName}`);\n }\n\n // TODO: clone\n return { ...argTypeRef } as TSchema[\"object\"][TTypeName][\"fields\"][TFieldName][\"arguments\"][TArgName];\n },\n };\n };\n\n return { $ };\n};\n","import type { AnyComposedOperation, AnyInlineOperation, AnyModel, AnySlice } from \"../types/element\";\nimport type { AnyGraphqlRuntimeAdapter } from \"../types/runtime\";\nimport type { AnyGraphqlSchema } from \"../types/schema\";\nimport { createComposedOperationComposerFactory } from \"./composed-operation\";\nimport { createInlineOperationComposerFactory } from \"./inline-operation\";\nimport { createGqlModelComposers } from \"./model\";\nimport { createSliceComposerFactory } from \"./slice\";\nimport { createVarBuilder } from \"./var-builder\";\n\nexport type GqlElementComposer<TComposers, THelper> = <\n TResult extends AnyModel | AnySlice | AnyComposedOperation | AnyInlineOperation,\n>(\n composeElement: (composers: TComposers, helper: THelper) => TResult,\n) => TResult;\n\nexport const createGqlElementComposer = <TSchema extends AnyGraphqlSchema, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter>(\n schema: NoInfer<TSchema>,\n) => {\n const model = createGqlModelComposers<TSchema>(schema);\n const createSliceComposer = createSliceComposerFactory<TSchema, TRuntimeAdapter>(schema);\n const createComposedOperationFactory = createComposedOperationComposerFactory<TSchema, TRuntimeAdapter>();\n const createInlineOperationComposer = createInlineOperationComposerFactory<TSchema, TRuntimeAdapter>(schema);\n const composers = {\n model,\n query: {\n slice: createSliceComposer(\"query\"),\n composed: createComposedOperationFactory(\"query\"),\n inline: createInlineOperationComposer(\"query\"),\n },\n mutation: {\n slice: createSliceComposer(\"mutation\"),\n composed: createComposedOperationFactory(\"mutation\"),\n inline: createInlineOperationComposer(\"mutation\"),\n },\n subscription: {\n slice: createSliceComposer(\"subscription\"),\n composed: createComposedOperationFactory(\"subscription\"),\n inline: createInlineOperationComposer(\"subscription\"),\n },\n };\n\n const helper = {\n ...createVarBuilder(schema),\n };\n\n const elementComposer: GqlElementComposer<typeof composers, typeof helper> = (composeElement) =>\n composeElement(composers, helper);\n\n return elementComposer;\n};\n","import {\n type AnyConstDirectiveAttachments,\n type AnyTypeSpecifier,\n type InputTypeKind,\n type InputTypeSpecifiers,\n type ModifiedTypeName,\n type OutputTypeKind,\n parseModifiedTypeName,\n type TypeModifier,\n} from \"../types/schema\";\nimport type { ConstValue } from \"../types/schema/const-value\";\n\nconst createUnsafeInputTypeSpecifierFactory = <const TKind extends InputTypeKind>(kind: TKind) => {\n type UnsafeInputTypeSpecifier<\n TName extends string,\n TModifier extends TypeModifier,\n TDefaultFactory extends (() => ConstValue) | null,\n TDirectives extends AnyConstDirectiveAttachments,\n > = {\n kind: TKind;\n name: TName;\n modifier: TModifier;\n defaultValue: TDefaultFactory extends null ? null : { default: ReturnType<NonNullable<TDefaultFactory>> };\n directives: TDirectives;\n };\n\n return <\n const TName extends string,\n const TModifier extends TypeModifier,\n const TDefaultFactory extends (() => ConstValue) | null = null,\n const TDirectives extends AnyConstDirectiveAttachments = {},\n >(\n type: ModifiedTypeName<string, TName, TModifier>,\n extras: {\n default?: TDefaultFactory;\n directives?: TDirectives;\n },\n ): UnsafeInputTypeSpecifier<TName, TModifier, TDefaultFactory, TDirectives> =>\n ({\n kind,\n ...parseModifiedTypeName(type),\n defaultValue: extras.default ? { default: extras.default() } : null,\n directives: extras.directives ?? ({} as TDirectives),\n }) satisfies AnyTypeSpecifier as UnsafeInputTypeSpecifier<TName, TModifier, TDefaultFactory, TDirectives>;\n};\n\nexport const unsafeInputType = {\n scalar: createUnsafeInputTypeSpecifierFactory(\"scalar\"),\n enum: createUnsafeInputTypeSpecifierFactory(\"enum\"),\n input: createUnsafeInputTypeSpecifierFactory(\"input\"),\n};\n\nconst createUnsafeOutputTypeSpecifierFactory = <const TKind extends OutputTypeKind>(kind: TKind) => {\n type UnsafeOutputTypeSpecifier<\n TName extends string,\n TModifier extends TypeModifier,\n TArguments extends InputTypeSpecifiers,\n TDirectives extends AnyConstDirectiveAttachments,\n > = {\n kind: TKind;\n name: TName;\n modifier: TModifier;\n arguments: TArguments;\n directives: TDirectives;\n };\n\n return <\n const TName extends string,\n const TModifier extends TypeModifier,\n const TArguments extends InputTypeSpecifiers = {},\n const TDirectives extends AnyConstDirectiveAttachments = {},\n >(\n type: ModifiedTypeName<string, TName, TModifier>,\n extras: {\n arguments?: TArguments;\n directives?: TDirectives;\n },\n ): UnsafeOutputTypeSpecifier<TName, TModifier, InputTypeSpecifiers extends TArguments ? {} : TArguments, TDirectives> =>\n ({\n kind,\n ...parseModifiedTypeName(type),\n arguments: extras.arguments ?? ({} as TArguments),\n directives: extras.directives ?? ({} as TDirectives),\n }) satisfies AnyTypeSpecifier as UnsafeOutputTypeSpecifier<\n TName,\n TModifier,\n InputTypeSpecifiers extends TArguments ? {} : TArguments,\n TDirectives\n >;\n};\n\nexport const unsafeOutputType = {\n scalar: createUnsafeOutputTypeSpecifierFactory(\"scalar\"),\n enum: createUnsafeOutputTypeSpecifierFactory(\"enum\"),\n object: createUnsafeOutputTypeSpecifierFactory(\"object\"),\n union: createUnsafeOutputTypeSpecifierFactory(\"union\"),\n typename: createUnsafeOutputTypeSpecifierFactory(\"typename\"),\n};\n","import type {\n AnyConstDirectiveAttachments,\n EnumDefinition,\n InputDefinition,\n ObjectDefinition,\n OperationRoots,\n ScalarDefinition,\n UnionDefinition,\n} from \"../types/schema\";\nimport { type Hidden, hidden } from \"../utils/hidden\";\nimport { wrapByKey } from \"../utils/wrap-by-key\";\nimport { unsafeOutputType } from \"./type-specifier-builder\";\n\nexport const defineScalar = <const TName extends string, TInput, TOutput, TDirectives extends AnyConstDirectiveAttachments>(\n name: TName,\n definition: (tool: { type: typeof hidden }) => {\n input: Hidden<TInput>;\n output: Hidden<TOutput>;\n directives: TDirectives;\n },\n) =>\n wrapByKey(name, {\n _type: hidden() as Hidden<{ input: TInput; output: TOutput }>,\n name,\n directives: definition({ type: hidden }).directives,\n } satisfies ScalarDefinition<{ input: TInput; output: TOutput }>);\n\nexport const define = <const TName extends string>(name: TName) => ({\n enum: <const TValues extends EnumDefinition<string>[\"values\"], TDirectives extends AnyConstDirectiveAttachments>(\n values: TValues,\n directives: TDirectives,\n ) =>\n ({\n _type: hidden(),\n name,\n values,\n directives,\n }) satisfies EnumDefinition<keyof TValues & string>,\n\n input: <TFields extends InputDefinition[\"fields\"], TDirectives extends AnyConstDirectiveAttachments>(\n fields: TFields,\n directives: TDirectives,\n ) =>\n ({\n name,\n fields,\n directives,\n }) satisfies InputDefinition,\n\n object: <TFields extends ObjectDefinition[\"fields\"], TDirectives extends AnyConstDirectiveAttachments>(\n fields: TFields,\n directives: TDirectives,\n ) =>\n ({\n name,\n fields: {\n __typename: unsafeOutputType.typename(`${name}:!`, {}),\n ...fields,\n },\n directives,\n }) satisfies ObjectDefinition,\n\n union: <TTypes extends UnionDefinition[\"types\"], TDirectives extends AnyConstDirectiveAttachments>(\n types: TTypes,\n directives: TDirectives,\n ) =>\n ({\n name,\n types,\n directives,\n }) satisfies UnionDefinition,\n});\n\nexport const defineOperationRoots = <const TOperationRoots extends OperationRoots>(operationRoots: TOperationRoots) =>\n operationRoots;\n"],"mappings":";;;;AA2BA,MAAa,sBAAsB,UAAqD;AACtF,KAAI,UAAU,OACZ,QAAO;AAGT,KAAI,UAAU,KACZ,QAAO,EACL,MAAM,KAAK,MACZ;AAGH,KAAI,iBAAiB,OACnB,QAAO;EACL,MAAM,KAAK;EACX,MAAM;GAAE,MAAM,KAAK;GAAM,OAAO,MAAM;GAAM;EAC7C;AAGH,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO;EACL,MAAM,KAAK;EACX,QAAQ,MAAM,KAAK,SAAS,mBAAmB,KAAK,CAAC,CAAC,QAAQ,SAAS,SAAS,KAAK;EACtF;AAGH,KAAI,OAAO,UAAU,SACnB,QAAO;EACL,MAAM,KAAK;EACX,QAAQ,OAAO,QAAQ,MAAM,CAC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OAAO,cAAe,EAAE;EACrC;;AAQL,MAAa,mBAAmB;CAC9B,QAAQ,uCAAuC,SAAS;CACxD,MAAM,uCAAuC,OAAO;CACpD,QAAQ,uCAAuC,SAAS;CACxD,OAAO,uCAAuC,QAAQ;CACtD,UAAU,uCAAuC,WAAW;CAC7D;;;;ACpFD,MAAa,gBACX,MACA,eAMA,UAAU,MAAM;CACd,OAAO,QAAQ;CACf;CACA,YAAY,WAAW,EAAE,MAAM,QAAQ,CAAC,CAAC;CAC1C,CAAgE;AAEnE,MAAa,UAAsC,UAAiB;CAClE,OACE,QACA,gBAEC;EACC,OAAO,QAAQ;EACf;EACA;EACA;EACD;CAEH,QACE,QACA,gBAEC;EACC;EACA;EACA;EACD;CAEH,SACE,QACA,gBAEC;EACC;EACA,QAAQ;GACN,YAAY,iBAAiB,SAAS,GAAG,KAAK,KAAK,EAAE,CAAC;GACtD,GAAG;GACJ;EACD;EACD;CAEH,QACE,OACA,gBAEC;EACC;EACA;EACA;EACD;CACJ;AAED,MAAa,wBAAsE,mBACjF"}
1
+ {"version":3,"file":"index.js","names":["value","field","curr: Readonly<{ modifier: TypeModifier | \"\"; type: TypeNode }>","cache: { value: TDefinition } | null","define","define","define","define","define","paths","fields","cacheMap: CacheMap","factory: AnyFieldSelectionFactory","factoryReturn: AnyFieldSelectionFactoryReturn<TAlias>","operationTypeName: TTypeName | null","operationTypeName: TTypeName | null","elementComposer: GqlElementComposer<typeof composers, typeof helper>"],"sources":["../src/composer/build-document.ts","../src/types/element/gql-element.ts","../src/types/element/composed-operation.ts","../src/types/element/fields-builder.ts","../src/types/element/inline-operation.ts","../src/types/element/model.ts","../src/types/element/slice.ts","../src/composer/projection-path-graph.ts","../src/composer/composed-operation.ts","../src/utils/wrap-by-key.ts","../src/composer/fields-builder.ts","../src/composer/inline-operation.ts","../src/composer/model.ts","../src/composer/slice.ts","../src/types/schema/type-modifier.ts","../src/composer/var-builder.ts","../src/composer/gql-composer.ts","../src/schema/type-specifier-builder.ts","../src/schema/schema-builder.ts"],"sourcesContent":["import type { TypedDocumentNode } from \"@graphql-typed-document-node/core\";\nimport {\n type ArgumentNode,\n type ConstObjectFieldNode,\n type ConstValueNode,\n type DocumentNode,\n type FieldNode,\n type InlineFragmentNode,\n Kind,\n type NamedTypeNode,\n type ObjectFieldNode,\n OperationTypeNode,\n type TypeNode,\n type ValueNode,\n type VariableDefinitionNode,\n} from \"graphql\";\nimport {\n type AnyAssignableInput,\n type AnyAssignableInputValue,\n type AnyFields,\n type AnyNestedUnion,\n type InferFields,\n VarRef,\n} from \"../types/fragment\";\nimport type { AnyGraphqlSchema, ConstAssignableInput, InputTypeSpecifiers, OperationType, TypeModifier } from \"../types/schema\";\nimport type { ConstValue } from \"../types/schema/const-value\";\n\nexport const buildArgumentValue = (value: AnyAssignableInputValue): ValueNode | null => {\n if (value === undefined) {\n return null;\n }\n\n if (value === null) {\n return {\n kind: Kind.NULL,\n };\n }\n\n if (value instanceof VarRef) {\n return {\n kind: Kind.VARIABLE,\n name: { kind: Kind.NAME, value: value.name },\n };\n }\n\n if (Array.isArray(value)) {\n return {\n kind: Kind.LIST,\n values: value.map((item) => buildArgumentValue(item)).filter((item) => item !== null),\n };\n }\n\n if (typeof value === \"object\") {\n return {\n kind: Kind.OBJECT,\n fields: Object.entries(value)\n .map(([key, value]): ObjectFieldNode | null => {\n const valueNode = buildArgumentValue(value);\n return valueNode\n ? {\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: key },\n value: valueNode,\n }\n : null;\n })\n .filter((item) => item !== null),\n };\n }\n\n if (typeof value === \"string\") {\n return {\n kind: Kind.STRING,\n value,\n };\n }\n\n if (typeof value === \"number\") {\n // Distinguish between INT and FLOAT\n const isFloat = !Number.isInteger(value) || value.toString().includes(\".\");\n return {\n kind: isFloat ? Kind.FLOAT : Kind.INT,\n value: value.toString(),\n };\n }\n\n if (typeof value === \"boolean\") {\n return {\n kind: Kind.BOOLEAN,\n value,\n };\n }\n\n throw new Error(`Unknown value type: ${typeof (value satisfies never)}`);\n};\n\nconst buildArguments = (args: AnyAssignableInput): ArgumentNode[] =>\n Object.entries(args ?? {})\n .map(([name, value]): ArgumentNode | null => {\n const valueNode = buildArgumentValue(value);\n return valueNode ? { kind: Kind.ARGUMENT, name: { kind: Kind.NAME, value: name }, value: valueNode } : null;\n })\n .filter((item) => item !== null);\n\nconst buildUnionSelection = (union: AnyNestedUnion): InlineFragmentNode[] =>\n Object.entries(union)\n .map(([typeName, object]): InlineFragmentNode | null => {\n return object\n ? {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: { kind: Kind.NAMED_TYPE, name: { kind: Kind.NAME, value: typeName } },\n selectionSet: { kind: Kind.SELECTION_SET, selections: buildField(object) },\n }\n : null;\n })\n .filter((item) => item !== null);\n\nconst buildField = (field: AnyFields): FieldNode[] =>\n Object.entries(field).map(\n ([alias, { args, field, object, union }]): FieldNode => ({\n kind: Kind.FIELD,\n name: { kind: Kind.NAME, value: field },\n alias: alias !== field ? { kind: Kind.NAME, value: alias } : undefined,\n arguments: buildArguments(args),\n selectionSet: object\n ? {\n kind: Kind.SELECTION_SET,\n selections: buildField(object),\n }\n : union\n ? {\n kind: Kind.SELECTION_SET,\n selections: buildUnionSelection(union),\n }\n : undefined,\n }),\n );\n\nexport const buildConstValueNode = (value: ConstValue): ConstValueNode | null => {\n if (value === undefined) {\n return null;\n }\n\n if (value === null) {\n return { kind: Kind.NULL };\n }\n\n if (typeof value === \"string\") {\n return { kind: Kind.STRING, value };\n }\n\n if (typeof value === \"boolean\") {\n return { kind: Kind.BOOLEAN, value };\n }\n\n if (typeof value === \"number\") {\n // Distinguish between INT and FLOAT\n const isFloat = !Number.isInteger(value) || value.toString().includes(\".\");\n return { kind: isFloat ? Kind.FLOAT : Kind.INT, value: value.toString() };\n }\n\n if (Array.isArray(value)) {\n return { kind: Kind.LIST, values: value.map((item) => buildConstValueNode(item)).filter((item) => item !== null) };\n }\n\n if (typeof value === \"object\") {\n return {\n kind: Kind.OBJECT,\n fields: Object.entries(value)\n .map(([key, value]): ConstObjectFieldNode | null => {\n const valueNode = buildConstValueNode(value);\n return valueNode\n ? {\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: key },\n value: valueNode,\n }\n : null;\n })\n .filter((item) => item !== null),\n };\n }\n\n throw new Error(`Unknown value type: ${typeof (value satisfies never)}`);\n};\n\nexport const buildWithTypeModifier = (modifier: TypeModifier, buildType: () => NamedTypeNode): TypeNode => {\n const baseType = buildType();\n\n if (modifier === \"?\") {\n return baseType;\n }\n\n let curr: Readonly<{ modifier: TypeModifier | \"\"; type: TypeNode }> = { modifier, type: baseType };\n\n while (curr.modifier.length > 0) {\n if (curr.modifier.startsWith(\"!\")) {\n curr = {\n modifier: curr.modifier.slice(1) as TypeModifier,\n type: curr.type.kind === Kind.NON_NULL_TYPE ? curr.type : { kind: Kind.NON_NULL_TYPE, type: curr.type },\n };\n continue;\n }\n\n if (curr.modifier.startsWith(\"[]\")) {\n curr = {\n modifier: curr.modifier.slice(2) as TypeModifier,\n type: { kind: Kind.LIST_TYPE, type: curr.type },\n };\n continue;\n }\n\n throw new Error(`Unknown modifier: ${curr.modifier}`);\n }\n\n return curr.type;\n};\n\nconst buildVariables = (variables: InputTypeSpecifiers): VariableDefinitionNode[] => {\n return Object.entries(variables).map(\n ([name, ref]): VariableDefinitionNode => ({\n kind: Kind.VARIABLE_DEFINITION,\n variable: { kind: Kind.VARIABLE, name: { kind: Kind.NAME, value: name } },\n defaultValue: (ref.defaultValue && buildConstValueNode(ref.defaultValue.default)) || undefined,\n type: buildWithTypeModifier(ref.modifier, () => ({ kind: Kind.NAMED_TYPE, name: { kind: Kind.NAME, value: ref.name } })),\n }),\n );\n};\n\nexport const buildOperationTypeNode = (operation: OperationType): OperationTypeNode => {\n switch (operation) {\n case \"query\":\n return OperationTypeNode.QUERY;\n case \"mutation\":\n return OperationTypeNode.MUTATION;\n case \"subscription\":\n return OperationTypeNode.SUBSCRIPTION;\n default:\n throw new Error(`Unknown operation type: ${operation}`);\n }\n};\n\n// Overloaded function signatures for flexible usage\nexport const buildDocument = <\n TSchema extends AnyGraphqlSchema,\n TFields extends AnyFields,\n TVarDefinitions extends InputTypeSpecifiers,\n>(options: {\n operationName: string;\n operationType: OperationType;\n variables: TVarDefinitions;\n fields: TFields;\n}): TypedDocumentNode<InferFields<TSchema, TFields>, ConstAssignableInput<TSchema, TVarDefinitions>> => {\n const { operationName, operationType, variables, fields } = options;\n return {\n kind: Kind.DOCUMENT,\n definitions: [\n {\n kind: Kind.OPERATION_DEFINITION,\n operation: buildOperationTypeNode(operationType),\n name: { kind: Kind.NAME, value: operationName },\n variableDefinitions: buildVariables(variables),\n // directives: directives || [],\n selectionSet: {\n kind: Kind.SELECTION_SET,\n selections: buildField(fields),\n },\n },\n ],\n } satisfies DocumentNode as TypedDocumentNode<InferFields<TSchema, TFields>, ConstAssignableInput<TSchema, TVarDefinitions>>;\n};\n","const GQL_ELEMENT_FACTORY = Symbol(\"GQL_ELEMENT_FACTORY\");\nconst GQL_ELEMENT_CONTEXT = Symbol(\"GQL_ELEMENT_CONTEXT\");\n\nexport type GqlElementContext = {\n canonicalId: string;\n};\n\nexport type GqlElementDefinitionFactory<T> = (context: GqlElementContext | null) => T;\n\nexport abstract class GqlElement<TDefinition> {\n private [GQL_ELEMENT_FACTORY]: GqlElementDefinitionFactory<TDefinition>;\n private [GQL_ELEMENT_CONTEXT]: GqlElementContext | null = null;\n\n protected constructor(define: GqlElementDefinitionFactory<TDefinition>) {\n let cache: { value: TDefinition } | null = null;\n\n this[GQL_ELEMENT_FACTORY] = (context) => {\n if (cache) {\n return cache.value;\n }\n const value = define(context);\n cache = { value };\n return value;\n };\n }\n\n static setContext<TElement extends GqlElement<any>>(element: TElement, context: GqlElementContext): void {\n element[GQL_ELEMENT_CONTEXT] = context;\n }\n\n static evaluate(element: GqlElement<any>): void {\n void GqlElement.get(element);\n }\n\n static get<TValue>(element: GqlElement<TValue>): TValue {\n const context = element[GQL_ELEMENT_CONTEXT];\n return element[GQL_ELEMENT_FACTORY](context);\n }\n}\n","/** Operation composition helpers (`gql.query`, `gql.mutation`, `gql.subscription`). */\n\nimport type { TypedDocumentNode } from \"@graphql-typed-document-node/core\";\nimport type { Hidden } from \"../../utils/hidden\";\nimport type { Prettify } from \"../../utils/prettify\";\nimport type { UnionToIntersection } from \"../../utils/type-utils\";\nimport type { AnyFields, AssignableInput, InferFields } from \"../fragment\";\nimport type { AnyGraphqlRuntimeAdapter, InferExecutionResultProjection, NormalizedExecutionResult } from \"../runtime\";\nimport type {\n AnyConstAssignableInput,\n AnyGraphqlSchema,\n ConstAssignableInput,\n InputTypeSpecifiers,\n OperationType,\n} from \"../schema\";\nimport { GqlElement, type GqlElementContext } from \"./gql-element\";\nimport type { AnySlicePayloads } from \"./slice\";\n\nexport type AnyComposedOperation =\n | AnyComposedOperationOf<\"query\">\n | AnyComposedOperationOf<\"mutation\">\n | AnyComposedOperationOf<\"subscription\">;\nexport type AnyComposedOperationOf<TOperationType extends OperationType> = ComposedOperation<\n AnyGraphqlRuntimeAdapter,\n TOperationType,\n string,\n string[],\n any,\n any,\n any\n>;\n\ndeclare const __COMPOSED_OPERATION_BRAND__: unique symbol;\n\ntype ComposedOperationDefinition<\n TRuntimeAdapter extends AnyGraphqlRuntimeAdapter,\n TOperationType extends OperationType,\n TOperationName extends string,\n TVariableNames extends string[],\n TVariables extends AnyConstAssignableInput,\n TRawData extends object,\n TProjectedData extends object,\n> = {\n readonly operationType: TOperationType;\n readonly operationName: TOperationName;\n readonly variableNames: TVariableNames;\n readonly projectionPathGraph: ProjectionPathGraphNode;\n readonly document: TypedDocumentNode<TRawData, TVariables>;\n readonly parse: (result: NormalizedExecutionResult<TRuntimeAdapter, TRawData, any>) => TProjectedData;\n};\n\nexport class ComposedOperation<\n TRuntimeAdapter extends AnyGraphqlRuntimeAdapter,\n TOperationType extends OperationType,\n TOperationName extends string,\n TVariableNames extends string[],\n TVariables extends AnyConstAssignableInput,\n TRawData extends object,\n TProjectedData extends object,\n >\n extends GqlElement<\n ComposedOperationDefinition<\n TRuntimeAdapter,\n TOperationType,\n TOperationName,\n TVariableNames,\n TVariables,\n TRawData,\n TProjectedData\n >\n >\n implements\n ComposedOperationDefinition<\n TRuntimeAdapter,\n TOperationType,\n TOperationName,\n TVariableNames,\n TVariables,\n TRawData,\n TProjectedData\n >\n{\n declare readonly [__COMPOSED_OPERATION_BRAND__]: Hidden<{\n operationType: TOperationType;\n }>;\n\n private constructor(\n define: (\n context: GqlElementContext | null,\n ) => ComposedOperationDefinition<\n TRuntimeAdapter,\n TOperationType,\n TOperationName,\n TVariableNames,\n TVariables,\n TRawData,\n TProjectedData\n >,\n ) {\n super(define);\n }\n\n public get operationType() {\n return GqlElement.get(this).operationType;\n }\n public get operationName() {\n return GqlElement.get(this).operationName;\n }\n public get variableNames() {\n return GqlElement.get(this).variableNames;\n }\n public get projectionPathGraph() {\n return GqlElement.get(this).projectionPathGraph;\n }\n public get document() {\n return GqlElement.get(this).document;\n }\n public get parse() {\n return GqlElement.get(this).parse;\n }\n\n static create<\n TSchema extends AnyGraphqlSchema,\n TRuntimeAdapter extends AnyGraphqlRuntimeAdapter,\n TOperationType extends OperationType,\n TOperationName extends string,\n TVariableDefinitions extends InputTypeSpecifiers,\n TSliceFragments extends AnySlicePayloads,\n >(\n define: (context: import(\"./gql-element\").GqlElementContext | null) => {\n operationType: TOperationType;\n operationName: TOperationName;\n variableNames: (keyof TVariableDefinitions & string)[];\n projectionPathGraph: ProjectionPathGraphNode;\n document: TypedDocumentNode<\n InferComposedOperationRawData<TSchema, TSliceFragments>,\n ConstAssignableInput<TSchema, TVariableDefinitions>\n >;\n parse: (\n result: NormalizedExecutionResult<TRuntimeAdapter, InferComposedOperationRawData<TSchema, TSliceFragments>, any>,\n ) => {\n [K in keyof TSliceFragments]: InferExecutionResultProjection<TSliceFragments[K][\"projection\"]>;\n };\n },\n ) {\n return new ComposedOperation(define);\n }\n}\n\nexport type ProjectionPathGraphNode = {\n readonly matches: { label: string; path: string; exact: boolean }[];\n readonly children: { readonly [segment: string]: ProjectionPathGraphNode };\n};\n\nexport type ConcatSlicePayloads<TSlicePayloads extends AnySlicePayloads> = Prettify<\n UnionToIntersection<\n {\n [TLabel in keyof TSlicePayloads & string]: TSlicePayloads[TLabel] extends { getFields: () => infer TFields }\n ? { [K in keyof TFields & string as `${TLabel}_${K}`]: TFields[K] }\n : {};\n }[keyof TSlicePayloads & string]\n >\n> &\n AnyFields;\n\nexport type InferComposedOperationRawData<TSchema extends AnyGraphqlSchema, TSlicePayloads extends AnySlicePayloads> = Prettify<\n InferFields<TSchema, ConcatSlicePayloads<TSlicePayloads>>\n>;\n\nexport type ComposedOperationDefinitionBuilder<\n TSchema extends AnyGraphqlSchema,\n TVarDefinitions extends InputTypeSpecifiers,\n TSliceContents extends AnySlicePayloads,\n> = (tools: { $: NoInfer<AssignableInput<TSchema, TVarDefinitions>> }) => TSliceContents;\n","/** Field builder factories shared by model and slice helpers. */\n\nimport type { IfEmpty } from \"../../utils/empty-object\";\nimport type { UnionToIntersection } from \"../../utils/type-utils\";\nimport type {\n AbstractFieldSelection,\n AnyAssignableInput,\n AnyDirectiveAttachments,\n AnyFieldSelection,\n AnyFields,\n AnyNestedObject,\n AnyNestedUnion,\n AssignableInput,\n FieldSelectionTemplateOf,\n} from \"../fragment\";\nimport type {\n AnyGraphqlSchema,\n InputTypeSpecifiers,\n ObjectFieldRecord,\n OutputEnumSpecifier,\n OutputObjectSpecifier,\n OutputScalarSpecifier,\n OutputTypenameSpecifier,\n OutputUnionSpecifier,\n UnionMemberName,\n} from \"../schema\";\n\nexport const mergeFields = <TFieldEntries extends AnyFields[]>(fields: TFieldEntries) =>\n Object.assign({}, ...fields) as MergeFields<TFieldEntries>;\n\nexport type MergeFields<TFieldEntries extends AnyFields[]> = UnionToIntersection<\n TFieldEntries[number]\n> extends infer TFieldsIntersection\n ? {\n [TFieldName in keyof TFieldsIntersection]: TFieldsIntersection[TFieldName] extends AnyFieldSelection\n ? TFieldsIntersection[TFieldName]\n : never;\n } & {}\n : never;\n\n/**\n * Builder signature exposed to userland `model` and `slice` helpers. The\n * tooling `f`/`fields`/`_` aliases provide ergonomic access to GraphQL fields\n * while preserving the original schema information for inference.\n */\nexport type FieldsBuilder<\n TSchema extends AnyGraphqlSchema,\n TTypeName extends keyof TSchema[\"object\"] & string,\n TVariableDefinitions extends InputTypeSpecifiers,\n TFields extends AnyFields[],\n> = (tools: NoInfer<FieldsBuilderTools<TSchema, TTypeName, TVariableDefinitions>>) => TFields;\n\nexport type FieldsBuilderTools<\n TSchema extends AnyGraphqlSchema,\n TTypeName extends keyof TSchema[\"object\"] & string,\n TVariableDefinitions extends InputTypeSpecifiers,\n> = {\n f: FieldSelectionFactories<TSchema, TTypeName>;\n $: AssignableInput<TSchema, TVariableDefinitions>;\n};\n\n/** Narrow builder used when a field resolves to an object and we need nested selections. */\nexport type NestedObjectFieldsBuilder<\n TSchema extends AnyGraphqlSchema,\n TTypeName extends keyof TSchema[\"object\"] & string,\n TFields extends AnyNestedObject[],\n> = (tools: NoInfer<NestedObjectFieldsBuilderTools<TSchema, TTypeName>>) => TFields;\n\nexport type NestedObjectFieldsBuilderTools<\n TSchema extends AnyGraphqlSchema,\n TTypeName extends keyof TSchema[\"object\"] & string,\n> = {\n f: FieldSelectionFactories<TSchema, TTypeName>;\n};\n\nexport type NestedUnionFieldsBuilder<\n TSchema extends AnyGraphqlSchema,\n TMemberName extends string,\n TUnionFields extends AnyNestedUnion,\n> = {\n [TTypename in keyof TUnionFields & TMemberName]?: NestedObjectFieldsBuilder<\n TSchema,\n TTypename,\n NonNullable<TUnionFields[TTypename]>[]\n >;\n};\n\n/** Map each field to a factory capable of emitting fully-typed references. */\nexport type FieldSelectionFactories<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema[\"object\"] & string> = {\n [TFieldName in keyof ObjectFieldRecord<TSchema, TTypeName>]: TFieldName extends string\n ? FieldSelectionFactory<TSchema, FieldSelectionTemplateOf<TSchema, TTypeName, TFieldName>>\n : never;\n};\n\nexport type AnyFieldSelectionFactory = <TAlias extends string | null = null>(\n fieldArgs: AnyAssignableInput | void,\n extras?: { alias?: TAlias; directives?: AnyDirectiveAttachments },\n) => AnyFieldSelectionFactoryReturn<TAlias>;\n\nexport type FieldSelectionFactory<TSchema extends AnyGraphqlSchema, TSelection extends AnyFieldSelection> = <\n TAlias extends string | null = null,\n>(\n fieldArgs: TSelection[\"args\"] | IfEmpty<TSelection[\"args\"], void | null>,\n extras?: { alias?: TAlias; directives?: TSelection[\"directives\"] },\n) => FieldSelectionFactoryReturn<TSchema, TSelection, TAlias>;\n\nexport type AnyFieldSelectionFactoryReturn<TAlias extends string | null> =\n | FieldSelectionFactoryReturn<AnyGraphqlSchema, AnyFieldSelection & { type: OutputObjectSpecifier }, TAlias>\n | FieldSelectionFactoryReturn<AnyGraphqlSchema, AnyFieldSelection & { type: OutputUnionSpecifier }, TAlias>\n | FieldSelectionFactoryReturn<\n AnyGraphqlSchema,\n AnyFieldSelection & { type: OutputTypenameSpecifier | OutputScalarSpecifier | OutputEnumSpecifier },\n TAlias\n >;\n\nexport type FieldSelectionFactoryReturn<\n TSchema extends AnyGraphqlSchema,\n TSelection extends AnyFieldSelection,\n TAlias extends string | null,\n> = TSelection extends { type: OutputObjectSpecifier }\n ? FieldSelectionFactoryObjectReturn<TSchema, TSelection, TAlias>\n : TSelection extends { type: OutputUnionSpecifier }\n ? FieldSelectionFactoryUnionReturn<TSchema, TSelection, TAlias>\n : TSelection extends { type: OutputTypenameSpecifier | OutputScalarSpecifier | OutputEnumSpecifier }\n ? FieldSelectionFactoryPrimitiveReturn<TSelection, TAlias>\n : never;\n\nexport type FieldSelectionFactoryObjectReturn<\n TSchema extends AnyGraphqlSchema,\n TSelection extends AnyFieldSelection & { type: OutputObjectSpecifier },\n TAlias extends string | null,\n> = <TNested extends AnyNestedObject[]>(\n nest: NestedObjectFieldsBuilder<TSchema, TSelection[\"type\"][\"name\"], TNested>,\n) => {\n [_ in TAlias extends null ? TSelection[\"field\"] : TAlias]: AbstractFieldSelection<\n TSelection[\"parent\"],\n TSelection[\"field\"],\n TSelection[\"type\"],\n TSelection[\"args\"],\n TSelection[\"directives\"],\n { object: MergeFields<TNested> }\n >;\n};\n\nexport type FieldSelectionFactoryUnionReturn<\n TSchema extends AnyGraphqlSchema,\n TSelection extends AnyFieldSelection & { type: OutputUnionSpecifier },\n TAlias extends string | null,\n> = <TNested extends AnyNestedUnion>(\n nest: NestedUnionFieldsBuilder<TSchema, UnionMemberName<TSchema, TSelection[\"type\"]>, TNested>,\n) => {\n [_ in TAlias extends null ? TSelection[\"field\"] : TAlias]: AbstractFieldSelection<\n TSelection[\"parent\"],\n TSelection[\"field\"],\n TSelection[\"type\"],\n TSelection[\"args\"],\n TSelection[\"directives\"],\n { union: TNested }\n >;\n};\n\nexport type FieldSelectionFactoryPrimitiveReturn<\n TSelection extends AnyFieldSelection & { type: OutputTypenameSpecifier | OutputScalarSpecifier | OutputEnumSpecifier },\n TAlias extends string | null,\n> = {\n [_ in TAlias extends null ? TSelection[\"field\"] : TAlias]: AbstractFieldSelection<\n TSelection[\"parent\"],\n TSelection[\"field\"],\n TSelection[\"type\"],\n TSelection[\"args\"],\n TSelection[\"directives\"],\n {}\n >;\n};\n\nexport type FieldSelectionFactoryFieldArguments<TFieldSelectionTemplate extends AnyFieldSelection> =\n | TFieldSelectionTemplate[\"args\"]\n | IfEmpty<TFieldSelectionTemplate[\"args\"], void | null>;\n","import type { TypedDocumentNode } from \"@graphql-typed-document-node/core\";\nimport type { Hidden } from \"../../utils/hidden\";\nimport type { AnyFields, InferFields } from \"../fragment\";\nimport type {\n AnyConstAssignableInput,\n AnyGraphqlSchema,\n ConstAssignableInput,\n InputTypeSpecifiers,\n OperationType,\n} from \"../schema\";\nimport { GqlElement, type GqlElementContext } from \"./gql-element\";\n\nexport type AnyInlineOperation =\n | AnyInlineOperationOf<\"query\">\n | AnyInlineOperationOf<\"mutation\">\n | AnyInlineOperationOf<\"subscription\">;\nexport type AnyInlineOperationOf<TOperationType extends OperationType> = InlineOperation<\n TOperationType,\n string,\n string[],\n any,\n AnyFields,\n any\n>;\n\ndeclare const __INLINE_OPERATION_BRAND__: unique symbol;\n\ntype InlineOperationArtifact<\n TOperationType extends OperationType,\n TOperationName extends string,\n TVariableNames extends string[],\n TVariables extends AnyConstAssignableInput,\n TFields extends Partial<AnyFields>,\n TData extends object,\n> = {\n readonly operationType: TOperationType;\n readonly operationName: TOperationName;\n readonly variableNames: TVariableNames;\n readonly documentSource: () => TFields;\n readonly document: TypedDocumentNode<TData, TVariables>;\n};\n\nexport class InlineOperation<\n TOperationType extends OperationType,\n TOperationName extends string,\n TVariableNames extends string[],\n TVariables extends AnyConstAssignableInput,\n TFields extends Partial<AnyFields>,\n TData extends object,\n >\n extends GqlElement<InlineOperationArtifact<TOperationType, TOperationName, TVariableNames, TVariables, TFields, TData>>\n implements InlineOperationArtifact<TOperationType, TOperationName, TVariableNames, TVariables, TFields, TData>\n{\n declare readonly [__INLINE_OPERATION_BRAND__]: Hidden<{\n operationType: TOperationType;\n }>;\n\n private constructor(\n define: (\n context: GqlElementContext | null,\n ) => InlineOperationArtifact<TOperationType, TOperationName, TVariableNames, TVariables, TFields, TData>,\n ) {\n super(define);\n }\n\n public get operationType() {\n return GqlElement.get(this).operationType;\n }\n public get operationName() {\n return GqlElement.get(this).operationName;\n }\n public get variableNames() {\n return GqlElement.get(this).variableNames;\n }\n public get documentSource() {\n return GqlElement.get(this).documentSource;\n }\n public get document() {\n return GqlElement.get(this).document;\n }\n\n static create<\n TSchema extends AnyGraphqlSchema,\n TOperationType extends OperationType,\n TOperationName extends string,\n TVariableDefinitions extends InputTypeSpecifiers,\n TFields extends AnyFields,\n >(\n define: (context: GqlElementContext | null) => {\n operationType: TOperationType;\n operationName: TOperationName;\n variableNames: (keyof TVariableDefinitions & string)[];\n documentSource: () => TFields;\n document: TypedDocumentNode<InferFields<TSchema, TFields>, ConstAssignableInput<TSchema, TVariableDefinitions>>;\n },\n ) {\n return new InlineOperation(define);\n }\n}\n","/** Model helper types mirroring the `gql.model` API. */\n\nimport type { SwitchIfEmpty } from \"../../utils/empty-object\";\nimport type { Hidden } from \"../../utils/hidden\";\nimport type { AnyAssignableInput, AnyFields, AssignableInput, InferFields } from \"../fragment\";\nimport type { AnyGraphqlSchema, InputTypeSpecifiers } from \"../schema\";\nimport { GqlElement } from \"./gql-element\";\n\nexport type AnyModel = Model<string, any, AnyFields, any, any>;\n\ntype ModelArtifact<\n TTypeName extends string,\n TVariables extends Partial<AnyAssignableInput> | void,\n TFields extends Partial<AnyFields>,\n TRaw extends object,\n TNormalized extends object,\n> = {\n readonly typename: TTypeName;\n readonly fragment: (variables: TVariables) => TFields;\n readonly normalize: (raw: TRaw) => TNormalized;\n};\n\ndeclare const __MODEL_BRAND__: unique symbol;\nexport class Model<\n TTypeName extends string,\n TVariables extends Partial<AnyAssignableInput> | void,\n TFields extends Partial<AnyFields>,\n TRaw extends object,\n TNormalized extends object,\n >\n extends GqlElement<ModelArtifact<TTypeName, TVariables, TFields, TRaw, TNormalized>>\n implements ModelArtifact<TTypeName, TVariables, TFields, TRaw, TNormalized>\n{\n declare readonly [__MODEL_BRAND__]: Hidden<{\n input: TVariables;\n output: TNormalized;\n }>;\n\n private constructor(define: () => ModelArtifact<TTypeName, TVariables, TFields, TRaw, TNormalized>) {\n super(define);\n }\n\n public get typename() {\n return GqlElement.get(this).typename;\n }\n public get fragment() {\n return GqlElement.get(this).fragment;\n }\n public get normalize() {\n return GqlElement.get(this).normalize;\n }\n\n static create<\n TSchema extends AnyGraphqlSchema,\n TTypeName extends keyof TSchema[\"object\"] & string,\n TVariableDefinitions extends InputTypeSpecifiers,\n TFields extends AnyFields,\n TNormalized extends object,\n >(\n define: () => {\n typename: TTypeName;\n fragment: (variables: SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>) => TFields;\n normalize: (raw: NoInfer<InferFields<TSchema, TFields>>) => TNormalized;\n },\n ) {\n type Fields = TFields & { [key: symbol]: never };\n type Raw = InferFields<TSchema, TFields> & { [key: symbol]: never };\n\n return new Model(\n define as () => ModelArtifact<\n TTypeName,\n SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>,\n Fields,\n Raw,\n TNormalized\n >,\n );\n }\n}\n","import type { SwitchIfEmpty } from \"../../utils/empty-object\";\nimport type { Hidden } from \"../../utils/hidden\";\nimport type { AnyAssignableInput, AnyFields, AssignableInput } from \"../fragment\";\nimport type { AnyProjection, InferExecutionResultProjection } from \"../runtime\";\nimport type { AnyGraphqlSchema, InputTypeSpecifiers, OperationType } from \"../schema\";\nimport { GqlElement } from \"./gql-element\";\n\nexport type AnySlice = AnySliceOf<\"query\"> | AnySliceOf<\"mutation\"> | AnySliceOf<\"subscription\">;\nexport type AnySliceOf<TOperationType extends OperationType> = Slice<TOperationType, any, AnyFields, AnyProjection>;\n\ntype SliceDefinition<\n TOperationType extends OperationType,\n TVariables extends Partial<AnyAssignableInput> | void,\n TFields extends Partial<AnyFields>,\n TProjection extends AnyProjection,\n> = {\n readonly operationType: TOperationType;\n readonly embed: (variables: TVariables) => SlicePayload<TVariables, TFields, TProjection>;\n};\n\ndeclare const __OPERATION_SLICE_BRAND__: unique symbol;\nexport class Slice<\n TOperationType extends OperationType,\n TVariables extends Partial<AnyAssignableInput> | void,\n TFields extends Partial<AnyFields>,\n TProjection extends AnyProjection,\n >\n extends GqlElement<SliceDefinition<TOperationType, TVariables, TFields, TProjection>>\n implements SliceDefinition<TOperationType, TVariables, TFields, TProjection>\n{\n declare readonly [__OPERATION_SLICE_BRAND__]: Hidden<{\n operationType: TOperationType;\n output: InferExecutionResultProjection<TProjection>;\n }>;\n\n private constructor(define: () => SliceDefinition<TOperationType, TVariables, TFields, TProjection>) {\n super(define);\n }\n\n public get operationType() {\n return GqlElement.get(this).operationType;\n }\n public get embed() {\n return GqlElement.get(this).embed;\n }\n\n static create<\n TSchema extends AnyGraphqlSchema,\n TOperationType extends OperationType,\n TVariableDefinitions extends InputTypeSpecifiers,\n TFields extends AnyFields,\n TProjection extends AnyProjection,\n >(\n define: () => {\n operationType: TOperationType;\n embed: (\n variables: SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>,\n ) => SlicePayload<\n SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>,\n TFields,\n TProjection\n >;\n },\n ) {\n type Fields = TFields & { [key: symbol]: never };\n type Variables = SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>;\n\n return new Slice(define as () => SliceDefinition<TOperationType, Variables, Fields, TProjection>);\n }\n}\n\nexport type AnySlicePayloads = { [key: string]: AnySlicePayload };\n\nexport type AnySlicePayload = SlicePayload<AnyAssignableInput | void, AnyFields, AnyProjection>;\nexport type SlicePayload<\n TVariables extends Partial<AnyAssignableInput> | void,\n TFields extends Partial<AnyFields>,\n TProjection extends AnyProjection,\n> = {\n variables: TVariables;\n getFields: () => TFields;\n projection: TProjection;\n};\n\nexport type InferOutputOfSlice<TSlice extends AnySliceOf<any>> = ReturnType<TSlice[typeof __OPERATION_SLICE_BRAND__]>[\"output\"];\n","import type { AnySlicePayload, ProjectionPathGraphNode } from \"../types/element\";\nimport { mapValues } from \"../utils/map-values\";\n\ntype ExecutionResultProjectionPathGraphIntermediate = {\n [segment: string]: { label: string; raw: string; segments: string[] }[];\n};\n\nfunction createPathGraph(paths: ExecutionResultProjectionPathGraphIntermediate[string]): ProjectionPathGraphNode {\n const intermediate = paths.reduce(\n (acc: ExecutionResultProjectionPathGraphIntermediate, { label, raw, segments: [segment, ...segments] }) => {\n if (segment) {\n (acc[segment] || (acc[segment] = [])).push({ label, raw, segments });\n }\n return acc;\n },\n {},\n );\n\n return {\n matches: paths.map(({ label, raw, segments }) => ({ label, path: raw, exact: segments.length === 0 })),\n children: mapValues(intermediate, (paths) => createPathGraph(paths)),\n } satisfies ProjectionPathGraphNode;\n}\n\nexport function createPathGraphFromSliceEntries(fragments: { [key: string]: AnySlicePayload }) {\n const paths = Object.entries(fragments).flatMap(([label, slice]) =>\n Array.from(\n new Map(\n slice.projection.paths.map(({ full: raw, segments }) => {\n const [first, ...rest] = segments;\n return [raw, { label, raw, segments: [`${label}_${first}`, ...rest] }];\n }),\n ).values(),\n ),\n );\n\n return createPathGraph(paths);\n}\n","import { createExecutionResultParser } from \"../runtime/parse-execution-result\";\nimport {\n type AnySlicePayloads,\n ComposedOperation,\n type ComposedOperationDefinitionBuilder,\n type ConcatSlicePayloads,\n} from \"../types/element\";\nimport type { AnyGraphqlRuntimeAdapter } from \"../types/runtime\";\nimport type { AnyGraphqlSchema, InputTypeSpecifiers, OperationType } from \"../types/schema\";\n\nimport { buildDocument } from \"./build-document\";\nimport { createVarRefs, type MergeVarDefinitions, mergeVarDefinitions } from \"./input\";\nimport { createPathGraphFromSliceEntries } from \"./projection-path-graph\";\n\nexport const createComposedOperationComposerFactory = <\n TSchema extends AnyGraphqlSchema,\n TRuntimeAdapter extends AnyGraphqlRuntimeAdapter,\n>() => {\n return <TOperationType extends OperationType>(operationType: TOperationType) => {\n return <\n TOperationName extends string,\n TSliceFragments extends AnySlicePayloads,\n TVarDefinitions extends InputTypeSpecifiers[] = [{}],\n >(\n options: {\n operationName: TOperationName;\n variables?: TVarDefinitions;\n },\n builder: ComposedOperationDefinitionBuilder<TSchema, MergeVarDefinitions<TVarDefinitions>, TSliceFragments>,\n ) => {\n return ComposedOperation.create<\n TSchema,\n TRuntimeAdapter,\n TOperationType,\n TOperationName,\n MergeVarDefinitions<TVarDefinitions>,\n TSliceFragments\n >(() => {\n const { operationName } = options;\n const variables = mergeVarDefinitions((options.variables ?? []) as TVarDefinitions);\n const $ = createVarRefs(variables);\n const fragments = builder({ $ });\n\n const fields = Object.fromEntries(\n Object.entries(fragments).flatMap(([label, { getFields: fields }]) =>\n Object.entries(fields).map(([key, reference]) => [`${label}_${key}`, reference]),\n ),\n ) as ConcatSlicePayloads<TSliceFragments>;\n const projectionPathGraph = createPathGraphFromSliceEntries(fragments);\n\n return {\n operationType,\n operationName,\n variableNames: Object.keys(variables) as (keyof MergeVarDefinitions<TVarDefinitions> & string)[],\n projectionPathGraph,\n document: buildDocument({\n operationName,\n operationType,\n variables,\n fields,\n }),\n parse: createExecutionResultParser({ fragments, projectionPathGraph }),\n };\n });\n };\n };\n};\n","export const wrapByKey = <TName extends string, TValue>(name: TName, value: TValue) =>\n ({\n [name]: value,\n }) as {\n [K in TName]: TValue;\n };\n","import {\n type AnyFieldSelectionFactory,\n type AnyFieldSelectionFactoryReturn,\n type FieldSelectionFactories,\n type FieldSelectionFactoryObjectReturn,\n type FieldSelectionFactoryPrimitiveReturn,\n type FieldSelectionFactoryUnionReturn,\n mergeFields,\n type NestedObjectFieldsBuilder,\n type NestedUnionFieldsBuilder,\n} from \"../types/element\";\nimport type { AnyFieldSelection, AnyNestedObject, AnyNestedUnion } from \"../types/fragment\";\nimport type {\n AnyGraphqlSchema,\n OutputEnumSpecifier,\n OutputObjectSpecifier,\n OutputScalarSpecifier,\n OutputTypenameSpecifier,\n OutputUnionSpecifier,\n UnionMemberName,\n} from \"../types/schema\";\nimport { mapValues } from \"../utils/map-values\";\nimport { wrapByKey } from \"../utils/wrap-by-key\";\n\n// Cache is schema-scoped to avoid cross-schema contamination when multiple schemas share type names\ntype CacheMap = Map<string, Record<string, AnyFieldSelectionFactory>>;\n\nconst cacheMapBySchema = new WeakMap<AnyGraphqlSchema, CacheMap>();\nconst ensureCacheMapBySchema = (schema: AnyGraphqlSchema) => {\n const cachedCacheMap = cacheMapBySchema.get(schema);\n if (cachedCacheMap) {\n return cachedCacheMap;\n }\n\n const cacheMap: CacheMap = new Map();\n cacheMapBySchema.set(schema, cacheMap);\n return cacheMap;\n};\n\nexport const createFieldFactories = <TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema[\"object\"] & string>(\n schema: TSchema,\n typeName: TTypeName,\n): FieldSelectionFactories<TSchema, TTypeName> => {\n const cacheMap = ensureCacheMapBySchema(schema);\n const cached = cacheMap.get(typeName);\n if (cached) {\n return cached as unknown as FieldSelectionFactories<TSchema, TTypeName>;\n }\n\n const factories = createFieldFactoriesInner(schema, typeName);\n cacheMap.set(typeName, factories as unknown as Record<string, AnyFieldSelectionFactory>);\n\n return factories;\n};\n\nconst createFieldFactoriesInner = <TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema[\"object\"] & string>(\n schema: TSchema,\n typeName: TTypeName,\n): FieldSelectionFactories<TSchema, TTypeName> => {\n const typeDef = schema.object[typeName];\n if (!typeDef) {\n throw new Error(`Type ${typeName} is not defined in schema objects`);\n }\n\n const entries = Object.entries(typeDef.fields).map(([fieldName, type]): [string, AnyFieldSelectionFactory] => {\n const factory: AnyFieldSelectionFactory = <TAlias extends string | null = null>(\n fieldArgs: AnyFieldSelection[\"args\"] | null | void,\n extras?: { alias?: TAlias; directives?: AnyFieldSelection[\"directives\"] },\n ) => {\n const wrap = <T>(value: T) => wrapByKey((extras?.alias ?? fieldName) as TAlias extends null ? string : TAlias, value);\n\n if (type.kind === \"object\") {\n type TSelection = AnyFieldSelection & { type: OutputObjectSpecifier };\n const factoryReturn: AnyFieldSelectionFactoryReturn<TAlias> = (<TNested extends AnyNestedObject[]>(\n nest: NestedObjectFieldsBuilder<TSchema, TSelection[\"type\"][\"name\"], TNested>,\n ) =>\n wrap({\n parent: typeName,\n field: fieldName,\n type: type,\n args: fieldArgs ?? {},\n directives: extras?.directives ?? {},\n object: mergeFields(nest({ f: createFieldFactories(schema, type.name) })),\n union: null,\n } satisfies AnyFieldSelection)) satisfies FieldSelectionFactoryObjectReturn<TSchema, TSelection, TAlias>;\n\n return factoryReturn;\n }\n\n if (type.kind === \"union\") {\n type TSelection = AnyFieldSelection & { type: OutputUnionSpecifier };\n const factoryReturn: AnyFieldSelectionFactoryReturn<TAlias> = (<TNested extends AnyNestedUnion>(\n nest: NestedUnionFieldsBuilder<TSchema, UnionMemberName<TSchema, TSelection[\"type\"]>, TNested>,\n ) =>\n wrap({\n parent: typeName,\n field: fieldName,\n type: type,\n args: fieldArgs ?? {},\n directives: extras?.directives ?? {},\n object: null,\n union: mapValues(\n nest as Record<string, NestedObjectFieldsBuilder<TSchema, string, AnyNestedObject[]> | undefined>,\n (builder, memberName) => {\n if (!builder) {\n throw new Error(`Builder is undefined for member name: ${memberName}`);\n }\n return mergeFields(builder({ f: createFieldFactories(schema, memberName) }));\n },\n ) as TNested,\n } satisfies AnyFieldSelection)) satisfies FieldSelectionFactoryUnionReturn<TSchema, TSelection, TAlias>;\n\n return factoryReturn;\n }\n\n if (type.kind === \"scalar\" || type.kind === \"enum\" || type.kind === \"typename\") {\n type TSelection = AnyFieldSelection & { type: OutputTypenameSpecifier | OutputScalarSpecifier | OutputEnumSpecifier };\n const factoryReturn: AnyFieldSelectionFactoryReturn<TAlias> = wrap({\n parent: typeName,\n field: fieldName,\n type,\n args: fieldArgs ?? {},\n directives: extras?.directives ?? {},\n object: null,\n union: null,\n } satisfies AnyFieldSelection) satisfies FieldSelectionFactoryPrimitiveReturn<TSelection, TAlias>;\n return factoryReturn;\n }\n\n throw new Error(`Unsupported field type: ${type satisfies never}`);\n };\n\n return [fieldName, factory] as const;\n });\n\n const factories: Record<string, AnyFieldSelectionFactory> = Object.fromEntries(entries);\n\n return factories as unknown as FieldSelectionFactories<TSchema, TTypeName>;\n};\n","import { type FieldsBuilder, InlineOperation, type MergeFields, mergeFields } from \"../types/element\";\nimport type { AnyFields } from \"../types/fragment\";\nimport type { AnyGraphqlRuntimeAdapter } from \"../types/runtime\";\nimport type { AnyGraphqlSchema, InputTypeSpecifiers, OperationType } from \"../types/schema\";\n\nimport { buildDocument } from \"./build-document\";\nimport { createFieldFactories } from \"./fields-builder\";\nimport { createVarRefs, type MergeVarDefinitions, mergeVarDefinitions } from \"./input\";\n\nexport const createInlineOperationComposerFactory = <\n TSchema extends AnyGraphqlSchema,\n _TRuntimeAdapter extends AnyGraphqlRuntimeAdapter,\n>(\n schema: NoInfer<TSchema>,\n) => {\n return <TOperationType extends OperationType>(operationType: TOperationType) => {\n type TTypeName = TSchema[\"operations\"][TOperationType] & keyof TSchema[\"object\"] & string;\n const operationTypeName: TTypeName | null = schema.operations[operationType];\n if (operationTypeName === null) {\n throw new Error(`Operation type ${operationType} is not defined in schema roots`);\n }\n\n return <TOperationName extends string, TFields extends AnyFields[], TVarDefinitions extends InputTypeSpecifiers[] = [{}]>(\n options: {\n operationName: TOperationName;\n variables?: TVarDefinitions;\n },\n fieldBuilder: FieldsBuilder<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, TFields>,\n ) => {\n return InlineOperation.create<\n TSchema,\n TOperationType,\n TOperationName,\n MergeVarDefinitions<TVarDefinitions>,\n MergeFields<TFields>\n >(() => {\n const { operationName } = options;\n const variables = mergeVarDefinitions((options.variables ?? []) as TVarDefinitions);\n const $ = createVarRefs(variables);\n const f = createFieldFactories(schema, operationTypeName);\n const fields = mergeFields(fieldBuilder({ f, $ }));\n\n return {\n operationType,\n operationName,\n variableNames: Object.keys(variables) as (keyof MergeVarDefinitions<TVarDefinitions> & string)[],\n documentSource: () => fields,\n document: buildDocument({\n operationName,\n operationType,\n variables,\n fields,\n }),\n };\n });\n };\n };\n};\n","import { type FieldsBuilder, type MergeFields, Model, mergeFields } from \"../types/element\";\nimport type { AnyFields, InferFields } from \"../types/fragment\";\nimport type { AnyGraphqlSchema, InputTypeSpecifiers, OperationType } from \"../types/schema\";\nimport { mapValues } from \"../utils/map-values\";\nimport { createFieldFactories } from \"./fields-builder\";\nimport { createVarAssignments, type MergeVarDefinitions, mergeVarDefinitions } from \"./input\";\n\nexport const createGqlModelComposers = <TSchema extends AnyGraphqlSchema>(schema: NoInfer<TSchema>) => {\n type ModelBuilder<TTypeName extends keyof TSchema[\"object\"] & string> = <\n TFieldEntries extends AnyFields[],\n TNormalized extends object,\n TVarDefinitions extends InputTypeSpecifiers[] = [{}],\n >(\n options: {\n variables?: TVarDefinitions;\n },\n builder: FieldsBuilder<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, TFieldEntries>,\n normalize: (raw: NoInfer<InferFields<TSchema, MergeFields<TFieldEntries>>>) => TNormalized,\n ) => ReturnType<\n typeof Model.create<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, MergeFields<TFieldEntries>, TNormalized>\n >;\n\n const createModelComposer = <TTypeName extends keyof TSchema[\"object\"] & string>(\n typename: TTypeName,\n ): ModelBuilder<TTypeName> => {\n return <TFieldEntries extends AnyFields[], TNormalized extends object, TVarDefinitions extends InputTypeSpecifiers[] = [{}]>(\n options: {\n variables?: TVarDefinitions;\n },\n builder: FieldsBuilder<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, TFieldEntries>,\n normalize: (raw: NoInfer<InferFields<TSchema, MergeFields<TFieldEntries>>>) => TNormalized,\n ) =>\n Model.create<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, MergeFields<TFieldEntries>, TNormalized>(() => {\n const varDefinitions = mergeVarDefinitions((options.variables ?? []) as TVarDefinitions);\n return {\n typename,\n fragment: (variables) => {\n const f = createFieldFactories(schema, typename);\n const $ = createVarAssignments(varDefinitions, variables);\n return mergeFields(builder({ f, $ }));\n },\n normalize,\n };\n });\n };\n\n type ModelBuildersAll = {\n readonly [TTypeName in keyof TSchema[\"object\"]]: TTypeName extends string ? ModelBuilder<TTypeName> : never;\n };\n type ModelBuilders = Omit<ModelBuildersAll, TSchema[\"operations\"][OperationType] & keyof ModelBuildersAll>;\n\n return mapValues(schema.object, (_, typename) => createModelComposer(typename)) as ModelBuilders;\n};\n","import { handleProjectionBuilder } from \"../runtime/slice\";\nimport {\n type ExecutionResultProjectionsBuilder,\n type FieldsBuilder,\n type MergeFields,\n mergeFields,\n Slice,\n} from \"../types/element\";\nimport type { AnyFields } from \"../types/fragment\";\nimport type { AnyGraphqlRuntimeAdapter, AnyProjection } from \"../types/runtime\";\nimport type { AnyGraphqlSchema, InputTypeSpecifiers, OperationType } from \"../types/schema\";\n\nimport { createFieldFactories } from \"./fields-builder\";\nimport { createVarAssignments, type MergeVarDefinitions, mergeVarDefinitions } from \"./input\";\n\nexport const createSliceComposerFactory = <TSchema extends AnyGraphqlSchema, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter>(\n schema: NoInfer<TSchema>,\n) => {\n return <TOperationType extends OperationType>(operationType: TOperationType) => {\n type TTypeName = TSchema[\"operations\"][TOperationType] & keyof TSchema[\"object\"] & string;\n const operationTypeName: TTypeName | null = schema.operations[operationType];\n if (operationTypeName === null) {\n throw new Error(`Operation type ${operationType} is not defined in schema roots`);\n }\n\n return <\n TFieldEntries extends AnyFields[],\n TProjection extends AnyProjection,\n TVarDefinitions extends InputTypeSpecifiers[] = [{}],\n >(\n options: {\n variables?: TVarDefinitions;\n },\n fieldBuilder: FieldsBuilder<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, TFieldEntries>,\n projectionBuilder: ExecutionResultProjectionsBuilder<TSchema, TRuntimeAdapter, MergeFields<TFieldEntries>, TProjection>,\n ) =>\n Slice.create<TSchema, TOperationType, MergeVarDefinitions<TVarDefinitions>, MergeFields<TFieldEntries>, TProjection>(() => {\n const varDefinitions = mergeVarDefinitions((options.variables ?? []) as TVarDefinitions);\n const projection = handleProjectionBuilder(projectionBuilder);\n\n return {\n operationType,\n embed: (variables) => {\n const f = createFieldFactories(schema, operationTypeName);\n const $ = createVarAssignments(varDefinitions, variables);\n const fields = mergeFields(fieldBuilder({ f, $ }));\n return { variables, getFields: () => fields, projection };\n },\n };\n });\n };\n};\n","export type AnyTypeModifier = string;\n\nexport type TypeModifier = \"?\" | `!${string}` | `[]${string}`;\n\nexport type ListTypeModifierSuffix = \"[]\" | \"[]!\";\nexport type StripTailingListFromTypeModifier<TModifier extends TypeModifier> =\n TModifier extends `${infer TInner extends TypeModifier}${ListTypeModifierSuffix}` ? TInner : TModifier;\n\nexport type ApplyTypeModifier<TModifier extends TypeModifier, TInner> = TModifier extends \"!\"\n ? TInner\n : TModifier extends \"?\" | \"\"\n ? TInner | null | undefined\n : TModifier extends `![]${infer TNext extends TypeModifier}`\n ? ApplyTypeModifier<TNext, TInner[]>\n : TModifier extends `[]${infer TNext extends TypeModifier}`\n ? ApplyTypeModifier<TNext, (TInner | null | undefined)[]>\n : never;\n\nexport type ApplyTypeModifierToKeys<T extends { [key: string]: { modifier: TypeModifier } }> = {\n readonly [K in keyof T as T[K][\"modifier\"] extends `${string}!` ? K : never]-?: T[K];\n} & {\n readonly [K in keyof T as T[K][\"modifier\"] extends `${string}!` ? never : K]+?: T[K];\n};\n\nexport type ModifiedTypeName<TNameCandidate extends string, TName extends TNameCandidate, TModifier extends AnyTypeModifier> =\n | (`${TName}:${TModifier}` & NoInfer<TypeModifierValidation<TModifier>>)\n | NoInfer<`${TName}:${TypeModifierSuggestion<TModifier>}`>;\n\ntype TypeModifierSuggestion<TModifier extends AnyTypeModifier> = [TModifier, TypeModifier] extends [TypeModifier, TModifier]\n ? \"?\" | \"!\" | \"[]\"\n : TModifier extends \"?\"\n ? \"?\"\n : TModifier extends `${string}!`\n ? `${TModifier}[]`\n : TModifier extends `${string}[]`\n ? `${TModifier}[]` | `${TModifier}!`\n : never;\n\ntype TypeModifierValidation<TModifier extends AnyTypeModifier> = TModifier extends \"?\" | \"!\"\n ? string\n : TModifier extends `${\"!\" | \"\"}[]${infer TNext extends TypeModifier | \"\"}`\n ? TNext extends \"\"\n ? string\n : TypeModifierValidation<TNext>\n : { _: \"If you see this message on type error, modifier format is wrong.\" };\n\nexport const parseModifiedTypeName = <TName extends string, TModifier extends AnyTypeModifier>(\n nameAndModifier: ModifiedTypeName<string, TName, TModifier>,\n) => {\n if (typeof nameAndModifier !== \"string\") {\n throw new Error(`Invalid modified type name: ${nameAndModifier}`);\n }\n\n const [name, modifier] = nameAndModifier.split(\":\") as [TName, TModifier];\n return { name, modifier };\n};\n","import {\n type AnyConstDirectiveAttachments,\n type AnyGraphqlSchema,\n type AnyTypeSpecifier,\n type ConstAssignableInputValue,\n type ModifiedTypeName,\n parseModifiedTypeName,\n type TypeModifier,\n} from \"../types/schema\";\nimport { wrapByKey } from \"../utils/wrap-by-key\";\n\ntype AssignableDefaultValue<\n TSchema extends AnyGraphqlSchema,\n TKind extends \"scalar\" | \"enum\" | \"input\",\n TName extends keyof TSchema[TKind] & string,\n TModifier extends TypeModifier,\n> = ConstAssignableInputValue<\n TSchema,\n {\n scalar: { kind: \"scalar\"; name: TName; modifier: TModifier; directives: {}; defaultValue: null };\n enum: { kind: \"enum\"; name: TName; modifier: TModifier; directives: {}; defaultValue: null };\n input: { kind: \"input\"; name: TName; modifier: TModifier; directives: {}; defaultValue: null };\n }[TKind]\n>;\n\nexport const createVarBuilder = <TSchema extends AnyGraphqlSchema>(schema: TSchema) => {\n const $ = <TVarName extends string>(varName: TVarName) => {\n const createRefBuilder = <TKind extends \"scalar\" | \"enum\" | \"input\">(kind: TKind) => {\n type InputRef<\n TTypeName extends keyof TSchema[TKind] & string,\n TModifier extends TypeModifier,\n TDefaultFn extends (() => AssignableDefaultValue<TSchema, TKind, TTypeName, TModifier>) | null,\n TDirectives extends AnyConstDirectiveAttachments,\n > = {\n kind: TKind;\n name: TTypeName;\n modifier: TModifier;\n defaultValue: TDefaultFn extends null\n ? null\n : {\n default: ReturnType<NonNullable<TDefaultFn>>;\n };\n directives: TDirectives;\n };\n\n return <\n const TTypeName extends keyof TSchema[TKind] & string,\n const TModifier extends TypeModifier,\n const TDefaultFn extends (() => AssignableDefaultValue<TSchema, TKind, TTypeName, TModifier>) | null = null,\n const TDirectives extends AnyConstDirectiveAttachments = {},\n >(\n type: ModifiedTypeName<string, TTypeName, TModifier>,\n extras?: {\n default?:\n | (TDefaultFn & (() => AssignableDefaultValue<TSchema, TKind, TTypeName, TModifier>))\n | (NoInfer<TDefaultFn> extends null ? () => AssignableDefaultValue<TSchema, TKind, TTypeName, TModifier> : never);\n directives?: TDirectives;\n },\n ) =>\n wrapByKey(varName, {\n kind,\n ...parseModifiedTypeName(type),\n defaultValue: extras?.default ? { default: extras.default() } : null,\n directives: extras?.directives ?? ({} as TDirectives),\n } satisfies AnyTypeSpecifier as InputRef<TTypeName, TModifier, TDefaultFn, TDirectives>);\n };\n\n return {\n scalar: createRefBuilder(\"scalar\"),\n enum: createRefBuilder(\"enum\"),\n input: createRefBuilder(\"input\"),\n\n byField: <\n const TTypeName extends keyof TSchema[\"object\"] & string,\n const TFieldName extends keyof TSchema[\"object\"][TTypeName][\"fields\"] & string,\n const TArgName extends keyof TSchema[\"object\"][TTypeName][\"fields\"][TFieldName][\"arguments\"] & string,\n >(\n typeName: TTypeName,\n fieldName: TFieldName,\n argName: TArgName,\n ) => {\n const argTypeRef = schema.object[typeName]?.fields[fieldName]?.arguments[argName];\n\n if (!argTypeRef) {\n throw new Error(`Argument ${argName} not found in field ${fieldName} of type ${typeName}`);\n }\n\n // TODO: clone\n return { ...argTypeRef } as TSchema[\"object\"][TTypeName][\"fields\"][TFieldName][\"arguments\"][TArgName];\n },\n };\n };\n\n return { $ };\n};\n","import type { AnyComposedOperation, AnyInlineOperation, AnyModel, AnySlice } from \"../types/element\";\nimport type { AnyGraphqlRuntimeAdapter } from \"../types/runtime\";\nimport type { AnyGraphqlSchema } from \"../types/schema\";\nimport { createComposedOperationComposerFactory } from \"./composed-operation\";\nimport { createInlineOperationComposerFactory } from \"./inline-operation\";\nimport { createGqlModelComposers } from \"./model\";\nimport { createSliceComposerFactory } from \"./slice\";\nimport { createVarBuilder } from \"./var-builder\";\n\nexport type GqlElementComposer<TComposers, THelper> = <\n TResult extends AnyModel | AnySlice | AnyComposedOperation | AnyInlineOperation,\n>(\n composeElement: (composers: TComposers, helper: THelper) => TResult,\n) => TResult;\n\nexport const createGqlElementComposer = <TSchema extends AnyGraphqlSchema, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter>(\n schema: NoInfer<TSchema>,\n) => {\n const model = createGqlModelComposers<TSchema>(schema);\n const createSliceComposer = createSliceComposerFactory<TSchema, TRuntimeAdapter>(schema);\n const createComposedOperationFactory = createComposedOperationComposerFactory<TSchema, TRuntimeAdapter>();\n const createInlineOperationComposer = createInlineOperationComposerFactory<TSchema, TRuntimeAdapter>(schema);\n const composers = {\n model,\n query: {\n slice: createSliceComposer(\"query\"),\n composed: createComposedOperationFactory(\"query\"),\n inline: createInlineOperationComposer(\"query\"),\n },\n mutation: {\n slice: createSliceComposer(\"mutation\"),\n composed: createComposedOperationFactory(\"mutation\"),\n inline: createInlineOperationComposer(\"mutation\"),\n },\n subscription: {\n slice: createSliceComposer(\"subscription\"),\n composed: createComposedOperationFactory(\"subscription\"),\n inline: createInlineOperationComposer(\"subscription\"),\n },\n };\n\n const helper = {\n ...createVarBuilder(schema),\n };\n\n const elementComposer: GqlElementComposer<typeof composers, typeof helper> = (composeElement) =>\n composeElement(composers, helper);\n\n return elementComposer;\n};\n","import {\n type AnyConstDirectiveAttachments,\n type AnyTypeSpecifier,\n type InputTypeKind,\n type InputTypeSpecifiers,\n type ModifiedTypeName,\n type OutputTypeKind,\n parseModifiedTypeName,\n type TypeModifier,\n} from \"../types/schema\";\nimport type { ConstValue } from \"../types/schema/const-value\";\n\nconst createUnsafeInputTypeSpecifierFactory = <const TKind extends InputTypeKind>(kind: TKind) => {\n type UnsafeInputTypeSpecifier<\n TName extends string,\n TModifier extends TypeModifier,\n TDefaultFactory extends (() => ConstValue) | null,\n TDirectives extends AnyConstDirectiveAttachments,\n > = {\n kind: TKind;\n name: TName;\n modifier: TModifier;\n defaultValue: TDefaultFactory extends null ? null : { default: ReturnType<NonNullable<TDefaultFactory>> };\n directives: TDirectives;\n };\n\n return <\n const TName extends string,\n const TModifier extends TypeModifier,\n const TDefaultFactory extends (() => ConstValue) | null = null,\n const TDirectives extends AnyConstDirectiveAttachments = {},\n >(\n type: ModifiedTypeName<string, TName, TModifier>,\n extras: {\n default?: TDefaultFactory;\n directives?: TDirectives;\n },\n ): UnsafeInputTypeSpecifier<TName, TModifier, TDefaultFactory, TDirectives> =>\n ({\n kind,\n ...parseModifiedTypeName(type),\n defaultValue: extras.default ? { default: extras.default() } : null,\n directives: extras.directives ?? ({} as TDirectives),\n }) satisfies AnyTypeSpecifier as UnsafeInputTypeSpecifier<TName, TModifier, TDefaultFactory, TDirectives>;\n};\n\nexport const unsafeInputType = {\n scalar: createUnsafeInputTypeSpecifierFactory(\"scalar\"),\n enum: createUnsafeInputTypeSpecifierFactory(\"enum\"),\n input: createUnsafeInputTypeSpecifierFactory(\"input\"),\n};\n\nconst createUnsafeOutputTypeSpecifierFactory = <const TKind extends OutputTypeKind>(kind: TKind) => {\n type UnsafeOutputTypeSpecifier<\n TName extends string,\n TModifier extends TypeModifier,\n TArguments extends InputTypeSpecifiers,\n TDirectives extends AnyConstDirectiveAttachments,\n > = {\n kind: TKind;\n name: TName;\n modifier: TModifier;\n arguments: TArguments;\n directives: TDirectives;\n };\n\n return <\n const TName extends string,\n const TModifier extends TypeModifier,\n const TArguments extends InputTypeSpecifiers = {},\n const TDirectives extends AnyConstDirectiveAttachments = {},\n >(\n type: ModifiedTypeName<string, TName, TModifier>,\n extras: {\n arguments?: TArguments;\n directives?: TDirectives;\n },\n ): UnsafeOutputTypeSpecifier<TName, TModifier, InputTypeSpecifiers extends TArguments ? {} : TArguments, TDirectives> =>\n ({\n kind,\n ...parseModifiedTypeName(type),\n arguments: extras.arguments ?? ({} as TArguments),\n directives: extras.directives ?? ({} as TDirectives),\n }) satisfies AnyTypeSpecifier as UnsafeOutputTypeSpecifier<\n TName,\n TModifier,\n InputTypeSpecifiers extends TArguments ? {} : TArguments,\n TDirectives\n >;\n};\n\nexport const unsafeOutputType = {\n scalar: createUnsafeOutputTypeSpecifierFactory(\"scalar\"),\n enum: createUnsafeOutputTypeSpecifierFactory(\"enum\"),\n object: createUnsafeOutputTypeSpecifierFactory(\"object\"),\n union: createUnsafeOutputTypeSpecifierFactory(\"union\"),\n typename: createUnsafeOutputTypeSpecifierFactory(\"typename\"),\n};\n","import type {\n AnyConstDirectiveAttachments,\n EnumDefinition,\n InputDefinition,\n ObjectDefinition,\n OperationRoots,\n ScalarDefinition,\n UnionDefinition,\n} from \"../types/schema\";\nimport { type Hidden, hidden } from \"../utils/hidden\";\nimport { wrapByKey } from \"../utils/wrap-by-key\";\nimport { unsafeOutputType } from \"./type-specifier-builder\";\n\nexport const defineScalar = <const TName extends string, TInput, TOutput, TDirectives extends AnyConstDirectiveAttachments>(\n name: TName,\n definition: (tool: { type: typeof hidden }) => {\n input: Hidden<TInput>;\n output: Hidden<TOutput>;\n directives: TDirectives;\n },\n) =>\n wrapByKey(name, {\n _type: hidden() as Hidden<{ input: TInput; output: TOutput }>,\n name,\n directives: definition({ type: hidden }).directives,\n } satisfies ScalarDefinition<{ input: TInput; output: TOutput }>);\n\nexport const define = <const TName extends string>(name: TName) => ({\n enum: <const TValues extends EnumDefinition<string>[\"values\"], TDirectives extends AnyConstDirectiveAttachments>(\n values: TValues,\n directives: TDirectives,\n ) =>\n ({\n _type: hidden(),\n name,\n values,\n directives,\n }) satisfies EnumDefinition<keyof TValues & string>,\n\n input: <TFields extends InputDefinition[\"fields\"], TDirectives extends AnyConstDirectiveAttachments>(\n fields: TFields,\n directives: TDirectives,\n ) =>\n ({\n name,\n fields,\n directives,\n }) satisfies InputDefinition,\n\n object: <TFields extends ObjectDefinition[\"fields\"], TDirectives extends AnyConstDirectiveAttachments>(\n fields: TFields,\n directives: TDirectives,\n ) =>\n ({\n name,\n fields: {\n __typename: unsafeOutputType.typename(`${name}:!`, {}),\n ...fields,\n },\n directives,\n }) satisfies ObjectDefinition,\n\n union: <TTypes extends UnionDefinition[\"types\"], TDirectives extends AnyConstDirectiveAttachments>(\n types: TTypes,\n directives: TDirectives,\n ) =>\n ({\n name,\n types,\n directives,\n }) satisfies UnionDefinition,\n});\n\nexport const defineOperationRoots = <const TOperationRoots extends OperationRoots>(operationRoots: TOperationRoots) =>\n operationRoots;\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AAMC,mBAAwE,mBAC5E,eAAe,WAAW,OAAO;AAEnC,QAAO;;;;;ACpCT,MAAM,yCAA4E,SAAgB;AAchG,SAME,MACA,YAKC;EACC;EACA,GAAG,sBAAsB,KAAK;EAC9B,cAAc,OAAO,UAAU,EAAE,SAAS,OAAO,SAAS,EAAE,GAAG;EAC/D,YAAY,OAAO,cAAe,EAAE;EACrC;;AAGL,MAAa,kBAAkB;CAC7B,QAAQ,sCAAsC,SAAS;CACvD,MAAM,sCAAsC,OAAO;CACnD,OAAO,sCAAsC,QAAQ;CACtD;AAED,MAAM,0CAA8E,SAAgB;AAclG,SAME,MACA,YAKC;EACC;EACA,GAAG,sBAAsB,KAAK;EAC9B,WAAW,OAAO,aAAc,EAAE;EAClC,YAAY,OAAO,cAAe,EAAE;EACrC;;AAQL,MAAa,mBAAmB;CAC9B,QAAQ,uCAAuC,SAAS;CACxD,MAAM,uCAAuC,OAAO;CACpD,QAAQ,uCAAuC,SAAS;CACxD,OAAO,uCAAuC,QAAQ;CACtD,UAAU,uCAAuC,WAAW;CAC7D;;;;ACpFD,MAAa,gBACX,MACA,eAMA,UAAU,MAAM;CACd,OAAO,QAAQ;CACf;CACA,YAAY,WAAW,EAAE,MAAM,QAAQ,CAAC,CAAC;CAC1C,CAAgE;AAEnE,MAAa,UAAsC,UAAiB;CAClE,OACE,QACA,gBAEC;EACC,OAAO,QAAQ;EACf;EACA;EACA;EACD;CAEH,QACE,QACA,gBAEC;EACC;EACA;EACA;EACD;CAEH,SACE,QACA,gBAEC;EACC;EACA,QAAQ;GACN,YAAY,iBAAiB,SAAS,GAAG,KAAK,KAAK,EAAE,CAAC;GACtD,GAAG;GACJ;EACD;EACD;CAEH,QACE,OACA,gBAEC;EACC;EACA;EACA;EACD;CACJ;AAED,MAAa,wBAAsE,mBACjF"}
@@ -25,6 +25,21 @@ const getInlineOperation = (name) => {
25
25
  */
26
26
  const __resetRuntimeRegistry = () => {
27
27
  composedOperationRegistry.clear();
28
+ inlineOperationRegistry.clear();
29
+ };
30
+ /**
31
+ * Test-only function to get all registered composed operations
32
+ * @internal
33
+ */
34
+ const __getRegisteredComposedOperations = () => {
35
+ return composedOperationRegistry;
36
+ };
37
+ /**
38
+ * Test-only function to get all registered inline operations
39
+ * @internal
40
+ */
41
+ const __getRegisteredInlineOperations = () => {
42
+ return inlineOperationRegistry;
28
43
  };
29
44
 
30
45
  //#endregion
@@ -83,6 +98,8 @@ const gqlRuntime = {
83
98
  };
84
99
 
85
100
  //#endregion
101
+ exports.__getRegisteredComposedOperations = __getRegisteredComposedOperations;
102
+ exports.__getRegisteredInlineOperations = __getRegisteredInlineOperations;
86
103
  exports.__resetRuntimeRegistry = __resetRuntimeRegistry;
87
104
  exports.createRuntimeAdapter = createRuntimeAdapter;
88
105
  exports.gqlRuntime = gqlRuntime;
@@ -1,4 +1,4 @@
1
- import { AnyAssignableInput, AnyComposedOperationOf, AnyExecutionResultProjectionsBuilder, AnyGraphqlRuntimeAdapter, AnyInlineOperationOf, AnyModel, AnySliceOf, AnySlicePayload, Hidden, OperationRoots, OperationType, StripFunctions } from "../index-D9WBGAJq.cjs";
1
+ import { AnyAssignableInput, AnyComposedOperationOf, AnyExecutionResultProjectionsBuilder, AnyGraphqlRuntimeAdapter, AnyInlineOperationOf, AnyModel, AnySliceOf, AnySlicePayload, Hidden, OperationRoots, OperationType, StripFunctions } from "../index-xC3mD3EI.cjs";
2
2
 
3
3
  //#region packages/core/src/runtime/model.d.ts
4
4
  type RuntimeModelInput = {
@@ -46,6 +46,16 @@ declare const createRuntimeAdapter: <TRuntimeAdapter extends AnyGraphqlRuntimeAd
46
46
  * @internal
47
47
  */
48
48
  declare const __resetRuntimeRegistry: () => void;
49
+ /**
50
+ * Test-only function to get all registered composed operations
51
+ * @internal
52
+ */
53
+ declare const __getRegisteredComposedOperations: () => ReadonlyMap<string, AnyComposedOperationOf<OperationType>>;
54
+ /**
55
+ * Test-only function to get all registered inline operations
56
+ * @internal
57
+ */
58
+ declare const __getRegisteredInlineOperations: () => ReadonlyMap<string, AnyInlineOperationOf<OperationType>>;
49
59
  //#endregion
50
60
  //#region packages/core/src/runtime/index.d.ts
51
61
  declare const gqlRuntime: {
@@ -57,5 +67,5 @@ declare const gqlRuntime: {
57
67
  getInlineOperation: (name: string) => AnyInlineOperationOf<keyof OperationRoots>;
58
68
  };
59
69
  //#endregion
60
- export { type RuntimeComposedOperationInput, type RuntimeInlineOperationInput, type RuntimeModelInput, type RuntimeSliceInput, __resetRuntimeRegistry, createRuntimeAdapter, gqlRuntime };
70
+ export { type RuntimeComposedOperationInput, type RuntimeInlineOperationInput, type RuntimeModelInput, type RuntimeSliceInput, __getRegisteredComposedOperations, __getRegisteredInlineOperations, __resetRuntimeRegistry, createRuntimeAdapter, gqlRuntime };
61
71
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/runtime/model.ts","../../src/runtime/composed-operation.ts","../../src/runtime/inline-operation.ts","../../src/runtime/slice.ts","../../src/runtime/runtime-adapter.ts","../../src/runtime/runtime-registry.ts","../../src/runtime/index.ts"],"sourcesContent":[],"mappings":";;;KAIY,iBAAA;EAAA,QAAA,EACA,cADiB,CACF,QADE,CAAA;EAAA,OAAA,EAAA;IACF,SAAA,EAAA,CAAA,GAAA,EAAA,GAAA,EAAA,GAAA,MAAA;;CAAD;;;AADG,KCIjB,6BAAA,GDJiB;UACF,ECIf,cDJe,CCIA,sBDJA,CCIuB,aDJvB,CAAA,CAAA;SAAf,EAAA;IAAc,SAAA,EAAA,CAAA,KAAA,EAAA;SCME;;qBAA0C;IAH1D,CAAA;EAA6B,CAAA;;;;ADJ7B,KEEA,2BAAA,GFFiB;EAAA,QAAA,EEGjB,cFHiB,CEGF,oBFHE,CEGmB,aFHnB,CAAA,CAAA;SACF,EAAA,CAAA,CAAA;;;;AADf,KGEA,iBAAA,GHFiB;EAAA,QAAA,EGGjB,cHHiB,CGGF,UHHE,CGGS,aHHT,CAAA,CAAA;SACF,EAAA;IAAf,eAAA,EGIS,oCHJT;EAAc,CAAA;;;;KIDrB,8CAA8C;EJAvC,IAAA,EAAA,CAAA,CAAA,CAAA,GAAA,GICK,MJDY,CICL,CJDK,CAAA;CAAA,EAAA,GIEvB,eJFuB;AACF,cIGd,oBJHc,EAAA,CAAA,wBIGkC,wBJHlC,CAAA,CAAA,OAAA,EIIhB,qBJJgB,CIIM,eJJN,CAAA,EAAA,GIIsB,eJJtB;;;;;;;cK6Bd;;;AL7BD,cMQC,UNRD,EAAA;EAAc,KAAA,EAAA,CAAA,KAAA,EMezB,iBNfyB,EAAA,WAAA;;;;ECGd,oBAAA,EAAA,CAAA,IAAA,EAAA,MAA6B,EAAA,yBAAA,CAAA,oBAAA,CAAA;EAAA,kBAAA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAA,uBAAA,CAAA,oBAAA,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/runtime/model.ts","../../src/runtime/composed-operation.ts","../../src/runtime/inline-operation.ts","../../src/runtime/slice.ts","../../src/runtime/runtime-adapter.ts","../../src/runtime/runtime-registry.ts","../../src/runtime/index.ts"],"sourcesContent":[],"mappings":";;;KAIY,iBAAA;EAAA,QAAA,EACA,cADiB,CACF,QADE,CAAA;EAAA,OAAA,EAAA;IACF,SAAA,EAAA,CAAA,GAAA,EAAA,GAAA,EAAA,GAAA,MAAA;;CAAD;;;AADG,KCIjB,6BAAA,GDJiB;UACF,ECIf,cDJe,CCIA,sBDJA,CCIuB,aDJvB,CAAA,CAAA;SAAf,EAAA;IAAc,SAAA,EAAA,CAAA,KAAA,EAAA;SCME;;qBAA0C;IAH1D,CAAA;EAA6B,CAAA;;;;ADJ7B,KEEA,2BAAA,GFFiB;EAAA,QAAA,EEGjB,cFHiB,CEGF,oBFHE,CEGmB,aFHnB,CAAA,CAAA;SACF,EAAA,CAAA,CAAA;;;;AADf,KGEA,iBAAA,GHFiB;EAAA,QAAA,EGGjB,cHHiB,CGGF,UHHE,CGGS,aHHT,CAAA,CAAA;SACF,EAAA;IAAf,eAAA,EGIS,oCHJT;EAAc,CAAA;;;;KIDrB,8CAA8C;EJAvC,IAAA,EAAA,CAAA,CAAA,CAAA,GAAA,GICK,MJDY,CICL,CJDK,CAAA;CAAA,EAAA,GIEvB,eJFuB;AACF,cIGd,oBJHc,EAAA,CAAA,wBIGkC,wBJHlC,CAAA,CAAA,OAAA,EIIhB,qBJJgB,CIIM,eJJN,CAAA,EAAA,GIIsB,eJJtB;;;;;;;cK6Bd;AJ1Bb;;;;AACY,cIkCC,iCJlCD,EAAA,GAAA,GIkCyC,WJlCzC,CAAA,MAAA,EIkC6D,sBJlC7D,CIkCoF,aJlCpF,CAAA,CAAA;;;;;cI0CC,uCAAsC,oBAAoB,qBAAqB;;;AL9ChF,cMYC,UNZD,EAAA;EAAc,KAAA,EAAA,CAAA,KAAA,EMmBzB,iBNnByB,EAAA,WAAA;;;;ECGd,oBAAA,EAAA,CAAA,IAAA,EAAA,MAA6B,EAAA,yBAAA,CAAA,oBAAA,CAAA;EAAA,kBAAA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAA,uBAAA,CAAA,oBAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- import { AnyAssignableInput, AnyComposedOperationOf, AnyExecutionResultProjectionsBuilder, AnyGraphqlRuntimeAdapter, AnyInlineOperationOf, AnyModel, AnySliceOf, AnySlicePayload, Hidden, OperationRoots, OperationType, StripFunctions } from "../index-DiEkx8-6.js";
1
+ import { AnyAssignableInput, AnyComposedOperationOf, AnyExecutionResultProjectionsBuilder, AnyGraphqlRuntimeAdapter, AnyInlineOperationOf, AnyModel, AnySliceOf, AnySlicePayload, Hidden, OperationRoots, OperationType, StripFunctions } from "../index-AuafI3MM.js";
2
2
 
3
3
  //#region packages/core/src/runtime/model.d.ts
4
4
  type RuntimeModelInput = {
@@ -46,6 +46,16 @@ declare const createRuntimeAdapter: <TRuntimeAdapter extends AnyGraphqlRuntimeAd
46
46
  * @internal
47
47
  */
48
48
  declare const __resetRuntimeRegistry: () => void;
49
+ /**
50
+ * Test-only function to get all registered composed operations
51
+ * @internal
52
+ */
53
+ declare const __getRegisteredComposedOperations: () => ReadonlyMap<string, AnyComposedOperationOf<OperationType>>;
54
+ /**
55
+ * Test-only function to get all registered inline operations
56
+ * @internal
57
+ */
58
+ declare const __getRegisteredInlineOperations: () => ReadonlyMap<string, AnyInlineOperationOf<OperationType>>;
49
59
  //#endregion
50
60
  //#region packages/core/src/runtime/index.d.ts
51
61
  declare const gqlRuntime: {
@@ -57,5 +67,5 @@ declare const gqlRuntime: {
57
67
  getInlineOperation: (name: string) => AnyInlineOperationOf<keyof OperationRoots>;
58
68
  };
59
69
  //#endregion
60
- export { type RuntimeComposedOperationInput, type RuntimeInlineOperationInput, type RuntimeModelInput, type RuntimeSliceInput, __resetRuntimeRegistry, createRuntimeAdapter, gqlRuntime };
70
+ export { type RuntimeComposedOperationInput, type RuntimeInlineOperationInput, type RuntimeModelInput, type RuntimeSliceInput, __getRegisteredComposedOperations, __getRegisteredInlineOperations, __resetRuntimeRegistry, createRuntimeAdapter, gqlRuntime };
61
71
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/runtime/model.ts","../../src/runtime/composed-operation.ts","../../src/runtime/inline-operation.ts","../../src/runtime/slice.ts","../../src/runtime/runtime-adapter.ts","../../src/runtime/runtime-registry.ts","../../src/runtime/index.ts"],"sourcesContent":[],"mappings":";;;KAIY,iBAAA;EAAA,QAAA,EACA,cADiB,CACF,QADE,CAAA;EAAA,OAAA,EAAA;IACF,SAAA,EAAA,CAAA,GAAA,EAAA,GAAA,EAAA,GAAA,MAAA;;CAAD;;;AADG,KCIjB,6BAAA,GDJiB;UACF,ECIf,cDJe,CCIA,sBDJA,CCIuB,aDJvB,CAAA,CAAA;SAAf,EAAA;IAAc,SAAA,EAAA,CAAA,KAAA,EAAA;SCME;;qBAA0C;IAH1D,CAAA;EAA6B,CAAA;;;;ADJ7B,KEEA,2BAAA,GFFiB;EAAA,QAAA,EEGjB,cFHiB,CEGF,oBFHE,CEGmB,aFHnB,CAAA,CAAA;SACF,EAAA,CAAA,CAAA;;;;AADf,KGEA,iBAAA,GHFiB;EAAA,QAAA,EGGjB,cHHiB,CGGF,UHHE,CGGS,aHHT,CAAA,CAAA;SACF,EAAA;IAAf,eAAA,EGIS,oCHJT;EAAc,CAAA;;;;KIDrB,8CAA8C;EJAvC,IAAA,EAAA,CAAA,CAAA,CAAA,GAAA,GICK,MJDY,CICL,CJDK,CAAA;CAAA,EAAA,GIEvB,eJFuB;AACF,cIGd,oBJHc,EAAA,CAAA,wBIGkC,wBJHlC,CAAA,CAAA,OAAA,EIIhB,qBJJgB,CIIM,eJJN,CAAA,EAAA,GIIsB,eJJtB;;;;;;;cK6Bd;;;AL7BD,cMQC,UNRD,EAAA;EAAc,KAAA,EAAA,CAAA,KAAA,EMezB,iBNfyB,EAAA,WAAA;;;;ECGd,oBAAA,EAAA,CAAA,IAAA,EAAA,MAA6B,EAAA,yBAAA,CAAA,oBAAA,CAAA;EAAA,kBAAA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAA,uBAAA,CAAA,oBAAA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/runtime/model.ts","../../src/runtime/composed-operation.ts","../../src/runtime/inline-operation.ts","../../src/runtime/slice.ts","../../src/runtime/runtime-adapter.ts","../../src/runtime/runtime-registry.ts","../../src/runtime/index.ts"],"sourcesContent":[],"mappings":";;;KAIY,iBAAA;EAAA,QAAA,EACA,cADiB,CACF,QADE,CAAA;EAAA,OAAA,EAAA;IACF,SAAA,EAAA,CAAA,GAAA,EAAA,GAAA,EAAA,GAAA,MAAA;;CAAD;;;AADG,KCIjB,6BAAA,GDJiB;UACF,ECIf,cDJe,CCIA,sBDJA,CCIuB,aDJvB,CAAA,CAAA;SAAf,EAAA;IAAc,SAAA,EAAA,CAAA,KAAA,EAAA;SCME;;qBAA0C;IAH1D,CAAA;EAA6B,CAAA;;;;ADJ7B,KEEA,2BAAA,GFFiB;EAAA,QAAA,EEGjB,cFHiB,CEGF,oBFHE,CEGmB,aFHnB,CAAA,CAAA;SACF,EAAA,CAAA,CAAA;;;;AADf,KGEA,iBAAA,GHFiB;EAAA,QAAA,EGGjB,cHHiB,CGGF,UHHE,CGGS,aHHT,CAAA,CAAA;SACF,EAAA;IAAf,eAAA,EGIS,oCHJT;EAAc,CAAA;;;;KIDrB,8CAA8C;EJAvC,IAAA,EAAA,CAAA,CAAA,CAAA,GAAA,GICK,MJDY,CICL,CJDK,CAAA;CAAA,EAAA,GIEvB,eJFuB;AACF,cIGd,oBJHc,EAAA,CAAA,wBIGkC,wBJHlC,CAAA,CAAA,OAAA,EIIhB,qBJJgB,CIIM,eJJN,CAAA,EAAA,GIIsB,eJJtB;;;;;;;cK6Bd;AJ1Bb;;;;AACY,cIkCC,iCJlCD,EAAA,GAAA,GIkCyC,WJlCzC,CAAA,MAAA,EIkC6D,sBJlC7D,CIkCoF,aJlCpF,CAAA,CAAA;;;;;cI0CC,uCAAsC,oBAAoB,qBAAqB;;;AL9ChF,cMYC,UNZD,EAAA;EAAc,KAAA,EAAA,CAAA,KAAA,EMmBzB,iBNnByB,EAAA,WAAA;;;;ECGd,oBAAA,EAAA,CAAA,IAAA,EAAA,MAA6B,EAAA,yBAAA,CAAA,oBAAA,CAAA;EAAA,kBAAA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAA,uBAAA,CAAA,oBAAA,CAAA"}
@@ -25,6 +25,21 @@ const getInlineOperation = (name) => {
25
25
  */
26
26
  const __resetRuntimeRegistry = () => {
27
27
  composedOperationRegistry.clear();
28
+ inlineOperationRegistry.clear();
29
+ };
30
+ /**
31
+ * Test-only function to get all registered composed operations
32
+ * @internal
33
+ */
34
+ const __getRegisteredComposedOperations = () => {
35
+ return composedOperationRegistry;
36
+ };
37
+ /**
38
+ * Test-only function to get all registered inline operations
39
+ * @internal
40
+ */
41
+ const __getRegisteredInlineOperations = () => {
42
+ return inlineOperationRegistry;
28
43
  };
29
44
 
30
45
  //#endregion
@@ -83,5 +98,5 @@ const gqlRuntime = {
83
98
  };
84
99
 
85
100
  //#endregion
86
- export { __resetRuntimeRegistry, createRuntimeAdapter, gqlRuntime };
101
+ export { __getRegisteredComposedOperations, __getRegisteredInlineOperations, __resetRuntimeRegistry, createRuntimeAdapter, gqlRuntime };
87
102
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/runtime/runtime-registry.ts","../../src/runtime/composed-operation.ts","../../src/runtime/inline-operation.ts","../../src/runtime/model.ts","../../src/runtime/runtime-adapter.ts","../../src/runtime/index.ts"],"sourcesContent":["import type { AnyComposedOperationOf, AnyInlineOperationOf } from \"../types/element\";\nimport type { OperationType } from \"../types/schema\";\n\nconst composedOperationRegistry = new Map<string, AnyComposedOperationOf<OperationType>>();\nconst inlineOperationRegistry = new Map<string, AnyInlineOperationOf<OperationType>>();\n\nexport const registerComposedOperation = (operation: AnyComposedOperationOf<OperationType>) => {\n composedOperationRegistry.set(operation.operationName, operation);\n};\n\nexport const registerInlineOperation = (operation: AnyInlineOperationOf<OperationType>) => {\n inlineOperationRegistry.set(operation.operationName, operation);\n};\n\nexport const getComposedOperation = (name: string) => {\n const operation = composedOperationRegistry.get(name);\n if (!operation) {\n throw new Error(`Operation ${name} not found`);\n }\n return operation;\n};\n\nexport const getInlineOperation = (name: string) => {\n const operation = inlineOperationRegistry.get(name);\n if (!operation) {\n throw new Error(`Operation ${name} not found`);\n }\n return operation;\n};\n\n/**\n * Test-only function to reset the operation registry\n * @internal\n */\nexport const __resetRuntimeRegistry = () => {\n composedOperationRegistry.clear();\n};\n","import { createVarRefs } from \"../composer/input\";\nimport type { AnyComposedOperationOf, AnySlicePayload } from \"../types/element\";\nimport type { AnyAssignableInput } from \"../types/fragment\";\nimport type { AnyGraphqlSchema, InputTypeSpecifier, InputTypeSpecifiers, OperationType } from \"../types/schema\";\nimport type { StripFunctions, StripSymbols } from \"../utils/type-utils\";\nimport { createExecutionResultParser } from \"./parse-execution-result\";\nimport { registerComposedOperation } from \"./runtime-registry\";\n\nexport type RuntimeComposedOperationInput = {\n prebuild: StripFunctions<AnyComposedOperationOf<OperationType>>;\n runtime: {\n getSlices: (tools: { $: AnyAssignableInput }) => { [key: string]: AnySlicePayload };\n };\n};\n\nexport const createRuntimeComposedOperation = (input: RuntimeComposedOperationInput): AnyComposedOperationOf<OperationType> => {\n const operation = {\n operationType: input.prebuild.operationType,\n operationName: input.prebuild.operationName,\n variableNames: input.prebuild.variableNames,\n projectionPathGraph: input.prebuild.projectionPathGraph,\n document: input.prebuild.document,\n parse: createExecutionResultParser({\n fragments: input.runtime.getSlices({\n $: createVarRefs<AnyGraphqlSchema, InputTypeSpecifiers>(\n Object.fromEntries(input.prebuild.variableNames.map((name) => [name, null as unknown as InputTypeSpecifier])),\n ),\n }),\n projectionPathGraph: input.prebuild.projectionPathGraph,\n }),\n } satisfies StripSymbols<AnyComposedOperationOf<OperationType>> as AnyComposedOperationOf<OperationType>;\n\n registerComposedOperation(operation);\n\n return operation;\n};\n","import type { AnyInlineOperationOf } from \"../types/element\";\nimport type { OperationType } from \"../types/schema\";\nimport { hidden } from \"../utils/hidden\";\nimport type { StripFunctions, StripSymbols } from \"../utils/type-utils\";\nimport { registerInlineOperation } from \"./runtime-registry\";\n\nexport type RuntimeInlineOperationInput = {\n prebuild: StripFunctions<AnyInlineOperationOf<OperationType>>;\n runtime: {};\n};\n\nexport const createRuntimeInlineOperation = (input: RuntimeInlineOperationInput): AnyInlineOperationOf<OperationType> => {\n const operation = {\n operationType: input.prebuild.operationType,\n operationName: input.prebuild.operationName,\n variableNames: input.prebuild.variableNames,\n documentSource: hidden(),\n document: input.prebuild.document,\n } satisfies StripSymbols<AnyInlineOperationOf<OperationType>> as AnyInlineOperationOf<OperationType>;\n\n registerInlineOperation(operation);\n\n return operation;\n};\n","import type { AnyModel } from \"../types/element\";\nimport { hidden } from \"../utils/hidden\";\nimport type { StripFunctions, StripSymbols } from \"../utils/type-utils\";\n\nexport type RuntimeModelInput = {\n prebuild: StripFunctions<AnyModel>;\n runtime: {\n // biome-ignore lint/suspicious/noExplicitAny: any is ok here\n normalize: (raw: any) => object;\n };\n};\n\nexport const createRuntimeModel = (input: RuntimeModelInput): AnyModel =>\n ({\n typename: input.prebuild.typename,\n fragment: hidden(),\n normalize: input.runtime.normalize,\n }) satisfies StripSymbols<AnyModel> as unknown as AnyModel;\n","import type { AnyGraphqlRuntimeAdapter } from \"../types/runtime\";\nimport type { Hidden } from \"../utils/hidden\";\nimport { hidden } from \"../utils/hidden\";\n\ntype RuntimeAdapterFactory<TRuntimeAdapter extends AnyGraphqlRuntimeAdapter> = (tools: {\n type: <T>() => Hidden<T>;\n}) => TRuntimeAdapter;\n\nexport const createRuntimeAdapter = <TRuntimeAdapter extends AnyGraphqlRuntimeAdapter>(\n factory: RuntimeAdapterFactory<TRuntimeAdapter>,\n) => factory({ type: hidden });\n","import { createRuntimeComposedOperation } from \"./composed-operation\";\nimport { createRuntimeInlineOperation } from \"./inline-operation\";\nimport { createRuntimeModel } from \"./model\";\nimport { getComposedOperation, getInlineOperation } from \"./runtime-registry\";\nimport { createRuntimeSlice } from \"./slice\";\n\nexport type { RuntimeComposedOperationInput } from \"./composed-operation\";\nexport type { RuntimeInlineOperationInput } from \"./inline-operation\";\nexport type { RuntimeModelInput } from \"./model\";\nexport { createRuntimeAdapter } from \"./runtime-adapter\";\nexport { __resetRuntimeRegistry } from \"./runtime-registry\";\nexport type { RuntimeSliceInput } from \"./slice\";\n\nexport const gqlRuntime = {\n model: createRuntimeModel,\n composedOperation: createRuntimeComposedOperation,\n inlineOperation: createRuntimeInlineOperation,\n slice: createRuntimeSlice,\n getComposedOperation,\n getInlineOperation,\n};\n"],"mappings":";;;AAGA,MAAM,4CAA4B,IAAI,KAAoD;AAC1F,MAAM,0CAA0B,IAAI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,QAAQ,EAAE,MAAM,QAAQ,CAAC;;;;ACG9B,MAAa,aAAa;CACxB,OAAO;CACP,mBAAmB;CACnB,iBAAiB;CACjB,OAAO;CACP;CACA;CACD"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/runtime/runtime-registry.ts","../../src/runtime/composed-operation.ts","../../src/runtime/inline-operation.ts","../../src/runtime/model.ts","../../src/runtime/runtime-adapter.ts","../../src/runtime/index.ts"],"sourcesContent":["import type { AnyComposedOperationOf, AnyInlineOperationOf } from \"../types/element\";\nimport type { OperationType } from \"../types/schema\";\n\nconst composedOperationRegistry = new Map<string, AnyComposedOperationOf<OperationType>>();\nconst inlineOperationRegistry = new Map<string, AnyInlineOperationOf<OperationType>>();\n\nexport const registerComposedOperation = (operation: AnyComposedOperationOf<OperationType>) => {\n composedOperationRegistry.set(operation.operationName, operation);\n};\n\nexport const registerInlineOperation = (operation: AnyInlineOperationOf<OperationType>) => {\n inlineOperationRegistry.set(operation.operationName, operation);\n};\n\nexport const getComposedOperation = (name: string) => {\n const operation = composedOperationRegistry.get(name);\n if (!operation) {\n throw new Error(`Operation ${name} not found`);\n }\n return operation;\n};\n\nexport const getInlineOperation = (name: string) => {\n const operation = inlineOperationRegistry.get(name);\n if (!operation) {\n throw new Error(`Operation ${name} not found`);\n }\n return operation;\n};\n\n/**\n * Test-only function to reset the operation registry\n * @internal\n */\nexport const __resetRuntimeRegistry = () => {\n composedOperationRegistry.clear();\n inlineOperationRegistry.clear();\n};\n\n/**\n * Test-only function to get all registered composed operations\n * @internal\n */\nexport const __getRegisteredComposedOperations = (): ReadonlyMap<string, AnyComposedOperationOf<OperationType>> => {\n return composedOperationRegistry;\n};\n\n/**\n * Test-only function to get all registered inline operations\n * @internal\n */\nexport const __getRegisteredInlineOperations = (): ReadonlyMap<string, AnyInlineOperationOf<OperationType>> => {\n return inlineOperationRegistry;\n};\n","import { createVarRefs } from \"../composer/input\";\nimport type { AnyComposedOperationOf, AnySlicePayload } from \"../types/element\";\nimport type { AnyAssignableInput } from \"../types/fragment\";\nimport type { AnyGraphqlSchema, InputTypeSpecifier, InputTypeSpecifiers, OperationType } from \"../types/schema\";\nimport type { StripFunctions, StripSymbols } from \"../utils/type-utils\";\nimport { createExecutionResultParser } from \"./parse-execution-result\";\nimport { registerComposedOperation } from \"./runtime-registry\";\n\nexport type RuntimeComposedOperationInput = {\n prebuild: StripFunctions<AnyComposedOperationOf<OperationType>>;\n runtime: {\n getSlices: (tools: { $: AnyAssignableInput }) => { [key: string]: AnySlicePayload };\n };\n};\n\nexport const createRuntimeComposedOperation = (input: RuntimeComposedOperationInput): AnyComposedOperationOf<OperationType> => {\n const operation = {\n operationType: input.prebuild.operationType,\n operationName: input.prebuild.operationName,\n variableNames: input.prebuild.variableNames,\n projectionPathGraph: input.prebuild.projectionPathGraph,\n document: input.prebuild.document,\n parse: createExecutionResultParser({\n fragments: input.runtime.getSlices({\n $: createVarRefs<AnyGraphqlSchema, InputTypeSpecifiers>(\n Object.fromEntries(input.prebuild.variableNames.map((name) => [name, null as unknown as InputTypeSpecifier])),\n ),\n }),\n projectionPathGraph: input.prebuild.projectionPathGraph,\n }),\n } satisfies StripSymbols<AnyComposedOperationOf<OperationType>> as AnyComposedOperationOf<OperationType>;\n\n registerComposedOperation(operation);\n\n return operation;\n};\n","import type { AnyInlineOperationOf } from \"../types/element\";\nimport type { OperationType } from \"../types/schema\";\nimport { hidden } from \"../utils/hidden\";\nimport type { StripFunctions, StripSymbols } from \"../utils/type-utils\";\nimport { registerInlineOperation } from \"./runtime-registry\";\n\nexport type RuntimeInlineOperationInput = {\n prebuild: StripFunctions<AnyInlineOperationOf<OperationType>>;\n runtime: {};\n};\n\nexport const createRuntimeInlineOperation = (input: RuntimeInlineOperationInput): AnyInlineOperationOf<OperationType> => {\n const operation = {\n operationType: input.prebuild.operationType,\n operationName: input.prebuild.operationName,\n variableNames: input.prebuild.variableNames,\n documentSource: hidden(),\n document: input.prebuild.document,\n } satisfies StripSymbols<AnyInlineOperationOf<OperationType>> as AnyInlineOperationOf<OperationType>;\n\n registerInlineOperation(operation);\n\n return operation;\n};\n","import type { AnyModel } from \"../types/element\";\nimport { hidden } from \"../utils/hidden\";\nimport type { StripFunctions, StripSymbols } from \"../utils/type-utils\";\n\nexport type RuntimeModelInput = {\n prebuild: StripFunctions<AnyModel>;\n runtime: {\n // biome-ignore lint/suspicious/noExplicitAny: any is ok here\n normalize: (raw: any) => object;\n };\n};\n\nexport const createRuntimeModel = (input: RuntimeModelInput): AnyModel =>\n ({\n typename: input.prebuild.typename,\n fragment: hidden(),\n normalize: input.runtime.normalize,\n }) satisfies StripSymbols<AnyModel> as unknown as AnyModel;\n","import type { AnyGraphqlRuntimeAdapter } from \"../types/runtime\";\nimport type { Hidden } from \"../utils/hidden\";\nimport { hidden } from \"../utils/hidden\";\n\ntype RuntimeAdapterFactory<TRuntimeAdapter extends AnyGraphqlRuntimeAdapter> = (tools: {\n type: <T>() => Hidden<T>;\n}) => TRuntimeAdapter;\n\nexport const createRuntimeAdapter = <TRuntimeAdapter extends AnyGraphqlRuntimeAdapter>(\n factory: RuntimeAdapterFactory<TRuntimeAdapter>,\n) => factory({ type: hidden });\n","import { createRuntimeComposedOperation } from \"./composed-operation\";\nimport { createRuntimeInlineOperation } from \"./inline-operation\";\nimport { createRuntimeModel } from \"./model\";\nimport { getComposedOperation, getInlineOperation } from \"./runtime-registry\";\nimport { createRuntimeSlice } from \"./slice\";\n\nexport type { RuntimeComposedOperationInput } from \"./composed-operation\";\nexport type { RuntimeInlineOperationInput } from \"./inline-operation\";\nexport type { RuntimeModelInput } from \"./model\";\nexport { createRuntimeAdapter } from \"./runtime-adapter\";\nexport {\n __getRegisteredComposedOperations,\n __getRegisteredInlineOperations,\n __resetRuntimeRegistry,\n} from \"./runtime-registry\";\nexport type { RuntimeSliceInput } from \"./slice\";\n\nexport const gqlRuntime = {\n model: createRuntimeModel,\n composedOperation: createRuntimeComposedOperation,\n inlineOperation: createRuntimeInlineOperation,\n slice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C9B,gBAAgB,QAAQ;EACxB,UAAU,MAAM,SAAS;EAC1B;AAED,yBAAwB,UAAU;AAElC,QAAO;;;;;ACVT,MAAa,sBAAsB,WAChC;CACC,UAAU,MAAM,SAAS;CACzB,UAAU,QAAQ;CAClB,WAAW,MAAM,QAAQ;CAC1B;;;;ACTH,MAAa,wBACX,YACG,QAAQ,EAAE,MAAM,QAAQ,CAAC;;;;ACO9B,MAAa,aAAa;CACxB,OAAO;CACP,mBAAmB;CACnB,iBAAiB;CACjB,OAAO;CACP;CACA;CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soda-gql/core",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "license": "MIT",
@@ -33,7 +33,8 @@
33
33
  "./package.json": "./package.json"
34
34
  },
35
35
  "dependencies": {
36
- "graphql": "16.*"
36
+ "graphql": "^16.11.0",
37
+ "@graphql-typed-document-node/core": "^3.2.0"
37
38
  },
38
39
  "devDependencies": {},
39
40
  "peerDependencies": {}