@soda-gql/core 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1112 @@
1
+ import { ConstValueNode, FormattedExecutionResult, GraphQLFormattedError, NamedTypeNode, OperationTypeNode, TypeNode, TypedQueryDocumentNode, ValueNode } from "graphql";
2
+
3
+ //#region packages/core/src/types/schema/const-value.d.ts
4
+ type ConstValue = string | number | boolean | null | undefined | {
5
+ readonly [key: string]: ConstValue;
6
+ } | readonly ConstValue[];
7
+ type ConstValues = {
8
+ readonly [key: string]: ConstValue;
9
+ };
10
+ //#endregion
11
+ //#region packages/core/src/utils/hidden.d.ts
12
+ declare const hidden: <T>() => (() => T);
13
+ type Hidden<T> = () => T;
14
+ //#endregion
15
+ //#region packages/core/src/types/schema/type-modifier.d.ts
16
+ type AnyTypeModifier = string;
17
+ type TypeModifier = "?" | `!${string}` | `[]${string}`;
18
+ type ListTypeModifierSuffix = "[]" | "[]!";
19
+ type StripTailingListFromTypeModifier<TModifier extends TypeModifier> = TModifier extends `${infer TInner extends TypeModifier}${ListTypeModifierSuffix}` ? TInner : TModifier;
20
+ type ApplyTypeModifier<TModifier extends TypeModifier, TInner> = TModifier extends "!" ? TInner : TModifier extends "?" | "" ? TInner | null | undefined : TModifier extends `![]${infer TNext extends TypeModifier}` ? ApplyTypeModifier<TNext, TInner[]> : TModifier extends `[]${infer TNext extends TypeModifier}` ? ApplyTypeModifier<TNext, (TInner | null | undefined)[]> : never;
21
+ type ApplyTypeModifierToKeys<T extends {
22
+ [key: string]: {
23
+ modifier: TypeModifier;
24
+ };
25
+ }> = { readonly [K in keyof T as T[K]["modifier"] extends `${string}!` ? K : never]-?: T[K] } & { readonly [K in keyof T as T[K]["modifier"] extends `${string}!` ? never : K]+?: T[K] };
26
+ type ModifiedTypeName<TNameCandidate extends string, TName extends TNameCandidate, TModifier extends AnyTypeModifier> = (`${TName}:${TModifier}` & NoInfer<TypeModifierValidation<TModifier>>) | NoInfer<`${TName}:${TypeModifierSuggestion<TModifier>}`>;
27
+ type TypeModifierSuggestion<TModifier extends AnyTypeModifier> = [TModifier, TypeModifier] extends [TypeModifier, TModifier] ? "?" | "!" | "[]" : TModifier extends "?" ? "?" : TModifier extends `${string}!` ? `${TModifier}[]` : TModifier extends `${string}[]` ? `${TModifier}[]` | `${TModifier}!` : never;
28
+ type TypeModifierValidation<TModifier extends AnyTypeModifier> = TModifier extends "?" | "!" ? string : TModifier extends `${"!" | ""}[]${infer TNext extends TypeModifier | ""}` ? TNext extends "" ? string : TypeModifierValidation<TNext> : {
29
+ _: "If you see this message on type error, modifier format is wrong.";
30
+ };
31
+ declare const parseModifiedTypeName: <TName extends string, TModifier extends AnyTypeModifier>(nameAndModifier: ModifiedTypeName<string, TName, TModifier>) => {
32
+ name: TName;
33
+ modifier: TModifier;
34
+ };
35
+ //#endregion
36
+ //#region packages/core/src/types/schema/type-specifier.d.ts
37
+ type AnyDefaultValue = {
38
+ default: ConstValue;
39
+ };
40
+ type InputTypeKind = "scalar" | "enum" | "input";
41
+ type OutputTypeKind = "scalar" | "enum" | "object" | "union" | "typename";
42
+ type AnyTypeSpecifier = {
43
+ readonly kind: string;
44
+ readonly name: string;
45
+ readonly modifier: TypeModifier;
46
+ readonly directives: AnyConstDirectiveAttachments;
47
+ readonly defaultValue?: AnyDefaultValue | null;
48
+ readonly arguments?: InputTypeSpecifiers;
49
+ };
50
+ type AbstractInputTypeSpecifier<TKind extends InputTypeKind> = {
51
+ readonly kind: TKind;
52
+ readonly name: string;
53
+ readonly modifier: TypeModifier;
54
+ readonly directives: AnyConstDirectiveAttachments;
55
+ readonly defaultValue: AnyDefaultValue | null;
56
+ };
57
+ type InputTypeSpecifiers = {
58
+ [key: string]: InputTypeSpecifier;
59
+ };
60
+ type InputTypeSpecifier = InputScalarSpecifier | InputEnumSpecifier | InputInputObjectSpecifier;
61
+ type InputInferrableTypeSpecifier = InputScalarSpecifier | InputEnumSpecifier;
62
+ type InputScalarSpecifier = AbstractInputTypeSpecifier<"scalar">;
63
+ type InputEnumSpecifier = AbstractInputTypeSpecifier<"enum">;
64
+ type InputInputObjectSpecifier = AbstractInputTypeSpecifier<"input">;
65
+ type AbstractOutputTypeSpecifier<TKind extends OutputTypeKind> = {
66
+ readonly kind: TKind;
67
+ readonly name: string;
68
+ readonly modifier: TypeModifier;
69
+ readonly directives: AnyConstDirectiveAttachments;
70
+ readonly arguments: InputTypeSpecifiers;
71
+ };
72
+ type OutputTypeSpecifiers = {
73
+ [key: string]: OutputTypeSpecifier;
74
+ };
75
+ type OutputTypeSpecifier = OutputScalarSpecifier | OutputEnumSpecifier | OutputObjectSpecifier | OutputUnionSpecifier | OutputTypenameSpecifier;
76
+ type OutputInferrableTypeSpecifier = OutputScalarSpecifier | OutputEnumSpecifier | OutputTypenameSpecifier;
77
+ type OutputScalarSpecifier = AbstractOutputTypeSpecifier<"scalar">;
78
+ type OutputEnumSpecifier = AbstractOutputTypeSpecifier<"enum">;
79
+ type OutputObjectSpecifier = AbstractOutputTypeSpecifier<"object">;
80
+ type OutputUnionSpecifier = AbstractOutputTypeSpecifier<"union">;
81
+ type OutputTypenameSpecifier = AbstractOutputTypeSpecifier<"typename">;
82
+ type StripTailingListFromTypeSpecifier<TTypeSpecifier extends AnyTypeSpecifier> = TTypeSpecifier extends {
83
+ defaultValue: AnyDefaultValue | null;
84
+ } ? {
85
+ readonly kind: TTypeSpecifier["kind"];
86
+ readonly name: TTypeSpecifier["name"];
87
+ readonly modifier: StripTailingListFromTypeModifier<TTypeSpecifier["modifier"]>;
88
+ readonly directives: TTypeSpecifier["directives"];
89
+ readonly defaultValue: TTypeSpecifier["modifier"] extends `${string}${ListTypeModifierSuffix}` ? null : TTypeSpecifier["defaultValue"];
90
+ } : TTypeSpecifier extends {
91
+ arguments: InputTypeSpecifiers;
92
+ } ? {
93
+ readonly kind: TTypeSpecifier["kind"];
94
+ readonly name: TTypeSpecifier["name"];
95
+ readonly modifier: StripTailingListFromTypeModifier<TTypeSpecifier["modifier"]>;
96
+ readonly directives: TTypeSpecifier["directives"];
97
+ readonly arguments: TTypeSpecifier["arguments"];
98
+ } : never;
99
+ //#endregion
100
+ //#region packages/core/src/types/schema/const-assignable-input.d.ts
101
+ type AnyConstAssignableInputValue = ConstValue;
102
+ type AnyConstAssignableInput = {
103
+ readonly [key: string]: AnyConstAssignableInputValue;
104
+ };
105
+ type ConstAssignableInput<TSchema extends AnyGraphqlSchema, TRefs extends InputTypeSpecifiers> = { readonly [K in keyof ApplyTypeModifierToKeys<TRefs>]: ConstAssignableInputValue<TSchema, TRefs[K]> };
106
+ type ConstAssignableInputValue<TSchema extends AnyGraphqlSchema, TRef extends InputTypeSpecifier> = TRef["modifier"] extends `${string}${ListTypeModifierSuffix}` ? ConstAssignableInputValue<TSchema, StripTailingListFromTypeSpecifier<TRef>>[] : (TRef extends InputInputObjectSpecifier ? ConstAssignableInput<TSchema, InputFieldRecord<TSchema, TRef>> : never) | (TRef extends InputInferrableTypeSpecifier ? InferInputTypeRef<TSchema, TRef> : never);
107
+ //#endregion
108
+ //#region packages/core/src/types/schema/const-directives.d.ts
109
+ type AnyConstDirectiveAttachments = {
110
+ readonly [key: string]: AnyConstAssignableInputValue;
111
+ };
112
+ //#endregion
113
+ //#region packages/core/src/types/schema/schema.d.ts
114
+ type OperationType = keyof OperationRoots;
115
+ type AnyTypeName = string;
116
+ type AnyFieldName = string;
117
+ type AnyGraphqlSchema = {
118
+ readonly operations: OperationRoots;
119
+ readonly scalar: {
120
+ readonly [name: string]: ScalarDefinition<any>;
121
+ };
122
+ readonly enum: {
123
+ readonly [name: string]: EnumDefinition<any>;
124
+ };
125
+ readonly input: {
126
+ readonly [name: string]: InputDefinition;
127
+ };
128
+ readonly object: {
129
+ readonly [name: string]: ObjectDefinition;
130
+ };
131
+ readonly union: {
132
+ readonly [name: string]: UnionDefinition;
133
+ };
134
+ };
135
+ type OperationRoots = {
136
+ readonly query: string | null;
137
+ readonly mutation: string | null;
138
+ readonly subscription: string | null;
139
+ };
140
+ type ScalarDefinition<T extends {
141
+ input: unknown;
142
+ output: unknown;
143
+ }> = {
144
+ readonly _type: Hidden<{
145
+ input: T["input"];
146
+ output: T["output"];
147
+ }>;
148
+ readonly name: string;
149
+ readonly directives: AnyConstDirectiveAttachments;
150
+ };
151
+ type EnumDefinition<T extends string> = {
152
+ readonly _type: Hidden<T>;
153
+ readonly name: string;
154
+ readonly values: { readonly [_ in T]: true };
155
+ readonly directives: AnyConstDirectiveAttachments;
156
+ };
157
+ type InputDefinition = {
158
+ readonly name: string;
159
+ readonly fields: InputTypeSpecifiers;
160
+ readonly directives: AnyConstDirectiveAttachments;
161
+ };
162
+ type ObjectDefinition = {
163
+ readonly name: string;
164
+ readonly fields: OutputTypeSpecifiers;
165
+ readonly directives: AnyConstDirectiveAttachments;
166
+ };
167
+ type UnionDefinition = {
168
+ readonly name: string;
169
+ readonly types: {
170
+ [typename: string]: true;
171
+ };
172
+ readonly directives: AnyConstDirectiveAttachments;
173
+ };
174
+ type InferInputTypeRef<TSchema extends AnyGraphqlSchema, TSpecifier extends InputInferrableTypeSpecifier> = (TSpecifier extends {
175
+ defaultValue: null;
176
+ } ? never : undefined) | (TSpecifier extends InputScalarSpecifier ? ApplyTypeModifier<TSpecifier["modifier"], ReturnType<TSchema["scalar"][TSpecifier["name"]]["_type"]>["input"]> : TSpecifier extends InputEnumSpecifier ? ApplyTypeModifier<TSpecifier["modifier"], ReturnType<TSchema["enum"][TSpecifier["name"]]["_type"]>> : never);
177
+ type InferOutputTypeRef<TSchema extends AnyGraphqlSchema, TSpecifier extends OutputInferrableTypeSpecifier> = TSpecifier extends OutputScalarSpecifier ? ApplyTypeModifier<TSpecifier["modifier"], ReturnType<TSchema["scalar"][TSpecifier["name"]]["_type"]>["output"]> : TSpecifier extends OutputEnumSpecifier ? ApplyTypeModifier<TSpecifier["modifier"], ReturnType<TSchema["enum"][TSpecifier["name"]]["_type"]>> : TSpecifier extends OutputTypenameSpecifier ? ApplyTypeModifier<TSpecifier["modifier"], TSpecifier["name"]> : never;
178
+ type PickTypeSpecifierByFieldName<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"], TFieldName extends keyof TSchema["object"][TTypeName]["fields"]> = TSchema["object"][TTypeName]["fields"][TFieldName];
179
+ type InputFieldRecord<TSchema extends AnyGraphqlSchema, TSpecifier extends InputTypeSpecifier> = TSchema["input"][TSpecifier["name"]]["fields"];
180
+ type ObjectFieldRecord<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"]> = { readonly [TFieldName in keyof TSchema["object"][TTypeName]["fields"]]: TSchema["object"][TTypeName]["fields"][TFieldName] };
181
+ type UnionTypeRecord<TSchema extends AnyGraphqlSchema, TSpecifier extends OutputUnionSpecifier> = { readonly [TTypeName in UnionMemberName<TSchema, TSpecifier>]: TSchema["object"][TTypeName] };
182
+ type UnionMemberName<TSchema extends AnyGraphqlSchema, TSpecifier extends OutputUnionSpecifier> = Extract<keyof TSchema["object"], keyof TSchema["union"][TSpecifier["name"]]["types"]> & string;
183
+ //#endregion
184
+ //#region packages/core/src/utils/prettify.d.ts
185
+ type Prettify<T> = { [K in keyof T]: T[K] } & {};
186
+ declare const prettify: <T extends object>(obj: T) => Prettify<T>;
187
+ //#endregion
188
+ //#region packages/core/src/types/fragment/var-ref.d.ts
189
+ /** Nominal reference placeholder used inside `AnyVariableAssignments`. */
190
+ type AnyVarRef = VarRef<any>;
191
+ type AnyVarRefMeta = {
192
+ readonly kind: string;
193
+ readonly name: string;
194
+ readonly modifier: unknown;
195
+ };
196
+ type VarRefBy<TRef extends InputTypeSpecifier> = VarRef<VarRefMetaBy<TRef>>;
197
+ type VarRefMetaBy<TRef extends InputTypeSpecifier> = Prettify<{
198
+ readonly kind: TRef["kind"];
199
+ readonly name: TRef["name"];
200
+ readonly modifier: ApplyTypeModifier<TRef["modifier"], "_"> | (TRef["defaultValue"] extends AnyDefaultValue ? null | undefined : never);
201
+ }>;
202
+ declare const __VAR_REF_BRAND__: unique symbol;
203
+ /** Nominal reference used to defer variable binding while carrying type info. */
204
+ declare class VarRef<TMeta extends AnyVarRefMeta> {
205
+ readonly name: string;
206
+ readonly [__VAR_REF_BRAND__]: Hidden<TMeta>;
207
+ private constructor();
208
+ static create<TRef extends InputTypeSpecifier>(name: string): VarRefBy<TRef>;
209
+ }
210
+ //#endregion
211
+ //#region packages/core/src/types/fragment/assignable-input.d.ts
212
+ type AnyAssignableInputValue = ConstValue | AnyVarRef | {
213
+ [key: string]: AnyAssignableInputValue;
214
+ } | AnyAssignableInputValue[] | undefined | null;
215
+ type AnyAssignableInput = {
216
+ readonly [key: string]: AnyAssignableInputValue;
217
+ };
218
+ type AssignableInput<TSchema extends AnyGraphqlSchema, TRefs extends InputTypeSpecifiers> = { readonly [K in keyof ApplyTypeModifierToKeys<TRefs>]: AssignableInputValue<TSchema, TRefs[K]> };
219
+ type AssignableInputValue<TSchema extends AnyGraphqlSchema, TRef extends InputTypeSpecifier> = VarRefBy<TRef> | (TRef["modifier"] extends `${string}${ListTypeModifierSuffix}` ? AssignableInputValue<TSchema, StripTailingListFromTypeSpecifier<TRef>>[] : (TRef extends InputInputObjectSpecifier ? AssignableInput<TSchema, InputFieldRecord<TSchema, TRef>> : never) | (TRef extends InputInferrableTypeSpecifier ? InferInputTypeRef<TSchema, TRef> : never));
220
+ type AssignableInputByFieldName<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"], TFieldName extends keyof TSchema["object"][TTypeName]["fields"]> = AssignableInput<TSchema, TSchema["object"][TTypeName]["fields"][TFieldName]["arguments"]>;
221
+ //#endregion
222
+ //#region packages/core/src/types/fragment/directives.d.ts
223
+ type AnyDirectiveAttachments = {
224
+ readonly [key: string]: AnyAssignableInput;
225
+ };
226
+ //#endregion
227
+ //#region packages/core/src/types/fragment/field-selection.d.ts
228
+ /**
229
+ * Canonical representation of the field selections we collect during model and
230
+ * slice definition. Each alias maps to a typed field reference that still
231
+ * remembers its parent type, arguments, directives, and nested selections.
232
+ */
233
+ type AnyFieldSelection = {
234
+ readonly parent: AnyTypeName;
235
+ readonly field: AnyFieldName;
236
+ readonly type: OutputTypeSpecifier;
237
+ readonly args: AnyAssignableInput;
238
+ readonly directives: AnyDirectiveAttachments;
239
+ readonly object: AnyNestedObject | null;
240
+ readonly union: AnyNestedUnion | null;
241
+ };
242
+ /** Nested selection produced when resolving an object field. */
243
+ type AnyNestedObject = {
244
+ readonly [alias: string]: AnyFieldSelection;
245
+ };
246
+ /** Nested selection produced when resolving a union field. */
247
+ type AnyNestedUnion = {
248
+ readonly [typeName: string]: AnyNestedObject | undefined;
249
+ };
250
+ /** Map of alias → field reference used by builders and inference. */
251
+ type AnyFields = {
252
+ readonly [alias: string]: AnyFieldSelection;
253
+ };
254
+ /** Strongly typed field reference produced for concrete schema members. */
255
+ type AbstractFieldSelection<TTypeName extends AnyTypeName, TFieldName extends AnyFieldName, TRef extends OutputTypeSpecifier, TArgs extends AnyAssignableInput, TDirectives extends AnyDirectiveAttachments, TExtras extends {
256
+ object: AnyNestedObject;
257
+ } | {
258
+ union: AnyNestedUnion;
259
+ } | {
260
+ _?: never;
261
+ }> = {
262
+ readonly parent: TTypeName;
263
+ readonly field: TFieldName;
264
+ readonly type: TRef;
265
+ readonly args: TArgs;
266
+ readonly directives: TDirectives;
267
+ readonly object: TExtras extends {
268
+ object: infer TObject;
269
+ } ? TObject : null;
270
+ readonly union: TExtras extends {
271
+ union: infer TUnion;
272
+ } ? TUnion : null;
273
+ };
274
+ /** Convenience alias to obtain a typed field reference from the schema. */
275
+ type FieldSelectionTemplateOf<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string, TFieldName extends keyof TSchema["object"][TTypeName]["fields"] & string> = PickTypeSpecifierByFieldName<TSchema, TTypeName, TFieldName> extends infer TRef extends OutputTypeSpecifier ? AbstractFieldSelection<TTypeName, TFieldName, TRef, AssignableInputByFieldName<TSchema, TTypeName, TFieldName>, AnyDirectiveAttachments, (TRef extends OutputObjectSpecifier ? {
276
+ object: AnyNestedObject;
277
+ } : never) | (TRef extends OutputUnionSpecifier ? {
278
+ union: AnyNestedUnion;
279
+ } : never)> : never;
280
+ /** Resolve the data shape produced by a set of field selections. */
281
+ type InferFields<TSchema extends AnyGraphqlSchema, TFields extends AnyFields> = Prettify<{ readonly [TAliasName in keyof TFields]: InferField<TSchema, TFields[TAliasName]> }>;
282
+ /** Resolve the data shape for a single field reference, including nested objects/unions. */
283
+ type InferField<TSchema extends AnyGraphqlSchema, TSelection extends AnyFieldSelection> = (TSelection extends {
284
+ type: infer TRef extends OutputObjectSpecifier;
285
+ object: infer TNested extends AnyNestedObject;
286
+ } ? ApplyTypeModifier<TRef["modifier"], InferFields<TSchema, TNested>> : never) | (TSelection extends {
287
+ type: infer TRef extends OutputUnionSpecifier;
288
+ union: infer TNested extends AnyNestedUnion;
289
+ } ? ApplyTypeModifier<TRef["modifier"], { [TTypename in keyof TNested]: undefined extends TNested[TTypename] ? never : InferFields<TSchema, NonNullable<TNested[TTypename]>> }[keyof TNested]> : never) | (TSelection extends {
290
+ type: infer TRef extends OutputInferrableTypeSpecifier;
291
+ } ? InferOutputTypeRef<TSchema, TRef> : never);
292
+ //#endregion
293
+ //#region packages/core/src/types/fragment/field-path.d.ts
294
+ type AnyFieldPath = string;
295
+ /**
296
+ * Computes strongly typed "$.foo.bar" style selectors for a set of fields so
297
+ * slice result transforms can reference response paths safely.
298
+ */
299
+ type AvailableFieldPathOf<TSchema extends AnyGraphqlSchema, TFields extends AnyFields> = AvailableFieldPathsInner<TSchema, TFields, "$">;
300
+ /** Recursive helper used to build path strings for nested selections. */
301
+ type AvailableFieldPathsInner<TSchema extends AnyGraphqlSchema, TFields extends AnyFields, TCurr extends AnyFieldPath> = { readonly [TAliasName in keyof TFields & string]: `${TCurr}.${TAliasName}` | (TFields[TAliasName] extends {
302
+ object: infer TNested extends AnyNestedObject;
303
+ } ? AvailableFieldPathsInner<TSchema, TNested, `${TCurr}.${TAliasName}`> : never) }[keyof TFields & string];
304
+ /** Resolve the TypeScript type located at a given field path. */
305
+ type InferByFieldPath<TSchema extends AnyGraphqlSchema, TFields extends AnyFields, TPath extends AnyFieldPath> = string extends keyof TFields ? any : TPath extends "$" ? never : InferByFieldPathInner<TSchema, TFields, TPath, "$">;
306
+ /** Internal helper that walks a field tree while matching a path literal. */
307
+ type InferByFieldPathInner<TSchema extends AnyGraphqlSchema, TFields extends AnyFields, TPathTarget extends AnyFieldPath, TPathCurrent extends AnyFieldPath> = { readonly [TAliasName in keyof TFields]: TAliasName extends string ? `${TPathCurrent}.${TAliasName}` extends TPathTarget ? InferField<TSchema, TFields[TAliasName]> : TFields[TAliasName] extends {
308
+ object: infer TNested extends AnyNestedObject;
309
+ } ? InferByFieldPathInner<TSchema, TNested, TPathTarget, `${TPathCurrent}.${TAliasName}`> : never : never }[keyof TFields];
310
+ //#endregion
311
+ //#region packages/core/src/composer/build-document.d.ts
312
+ declare const buildArgumentValue: (value: AnyAssignableInputValue) => ValueNode | null;
313
+ declare const buildConstValueNode: (value: ConstValue) => ConstValueNode | null;
314
+ declare const buildWithTypeModifier: (modifier: TypeModifier, buildType: () => NamedTypeNode) => TypeNode;
315
+ declare const buildOperationTypeNode: (operation: OperationType) => OperationTypeNode;
316
+ declare const buildDocument: <TSchema extends AnyGraphqlSchema, TFields extends AnyFields, TVarDefinitions extends InputTypeSpecifiers>(options: {
317
+ operationName: string;
318
+ operationType: OperationType;
319
+ variables: TVarDefinitions;
320
+ fields: TFields;
321
+ }) => TypedQueryDocumentNode<InferFields<TSchema, TFields>, ConstAssignableInput<TSchema, TVarDefinitions>>;
322
+ //#endregion
323
+ //#region packages/core/src/types/element/gql-element.d.ts
324
+ declare const GQL_ELEMENT_FACTORY: unique symbol;
325
+ declare const GQL_ELEMENT_CONTEXT: unique symbol;
326
+ type GqlElementContext = {
327
+ canonicalId: string;
328
+ };
329
+ type GqlElementDefinitionFactory<T> = (context: GqlElementContext | null) => T;
330
+ declare abstract class GqlElement<TDefinition> {
331
+ private [GQL_ELEMENT_FACTORY];
332
+ private [GQL_ELEMENT_CONTEXT];
333
+ protected constructor(define: GqlElementDefinitionFactory<TDefinition>);
334
+ static setContext<TElement extends GqlElement<any>>(element: TElement, context: GqlElementContext): void;
335
+ static evaluate(element: GqlElement<any>): void;
336
+ static get<TValue>(element: GqlElement<TValue>): TValue;
337
+ }
338
+ //#endregion
339
+ //#region packages/core/src/utils/type-utils.d.ts
340
+ type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never;
341
+ type Tuple<T> = [T, ...T[]];
342
+ type StripFunctions<T extends object> = { [K in keyof T as T[K] extends ((...args: any[]) => any) ? never : K]: T[K] };
343
+ type StripSymbols<T extends object> = { [K in keyof T as K extends symbol ? never : K]: T[K] };
344
+ //#endregion
345
+ //#region packages/core/src/types/runtime/runtime-adapter.d.ts
346
+ /**
347
+ * Defines the runtime surface that the typed layer depends on. Implementations
348
+ * adapt framework-specific error payloads without leaking those types into the
349
+ * generated code.
350
+ */
351
+ type AnyGraphqlRuntimeAdapter = {
352
+ nonGraphqlErrorType: Hidden<any>;
353
+ };
354
+ //#endregion
355
+ //#region packages/core/src/types/runtime/execution-result.d.ts
356
+ type NormalizedExecutionResult<TRuntimeAdapter extends AnyGraphqlRuntimeAdapter, TData, TExtensions> = EmptyResult | GraphqlExecutionResult<TData, TExtensions> | NonGraphqlErrorResult<TRuntimeAdapter>;
357
+ type EmptyResult = {
358
+ type: "empty";
359
+ };
360
+ type GraphqlExecutionResult<TData, TExtensions> = {
361
+ type: "graphql";
362
+ body: FormattedExecutionResult<TData, TExtensions>;
363
+ };
364
+ type NonGraphqlErrorResult<TRuntimeAdapter extends AnyGraphqlRuntimeAdapter> = {
365
+ type: "non-graphql-error";
366
+ error: ReturnType<TRuntimeAdapter["nonGraphqlErrorType"]>;
367
+ };
368
+ type NormalizedError<TRuntimeAdapter extends AnyGraphqlRuntimeAdapter> = {
369
+ type: "graphql-error";
370
+ errors: GraphQLFormattedError[];
371
+ } | {
372
+ type: "non-graphql-error";
373
+ error: ReturnType<TRuntimeAdapter["nonGraphqlErrorType"]>;
374
+ } | {
375
+ type: "parse-error";
376
+ errors: Error[];
377
+ };
378
+ //#endregion
379
+ //#region packages/core/src/types/runtime/sliced-execution-result.d.ts
380
+ type AnySlicedExecutionResult = SlicedExecutionResult<any, AnyGraphqlRuntimeAdapter>;
381
+ /**
382
+ * Internal discriminated union describing the Result-like wrapper exposed to
383
+ * slice selection callbacks. The adapter decides how raw errors are
384
+ * materialized.
385
+ */
386
+ type AnySlicedExecutionResultRecord = {
387
+ [path: string]: AnySlicedExecutionResult;
388
+ };
389
+ type SafeUnwrapResult<TTransformed, TError> = {
390
+ data?: never;
391
+ error?: never;
392
+ } | {
393
+ data: TTransformed;
394
+ error?: never;
395
+ } | {
396
+ data?: never;
397
+ error: TError;
398
+ };
399
+ /** Utility signature returned by the safe unwrap helper. */
400
+ type SlicedExecutionResultCommon<TData, TError> = {
401
+ safeUnwrap<TTransformed>(transform: (data: TData) => TTransformed): SafeUnwrapResult<TTransformed, TError>;
402
+ };
403
+ /** Public union used by selection callbacks to inspect data, empty, or error states. */
404
+ type SlicedExecutionResult<TData, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter> = SlicedExecutionResultEmpty<TData, TRuntimeAdapter> | SlicedExecutionResultSuccess<TData, TRuntimeAdapter> | SlicedExecutionResultError<TData, TRuntimeAdapter>;
405
+ /** Runtime guard interface shared by all slice result variants. */
406
+ declare class SlicedExecutionResultGuards<TData, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter> {
407
+ private readonly type;
408
+ isSuccess(): this is SlicedExecutionResultSuccess<TData, TRuntimeAdapter>;
409
+ isError(): this is SlicedExecutionResultError<TData, TRuntimeAdapter>;
410
+ isEmpty(): this is SlicedExecutionResultEmpty<TData, TRuntimeAdapter>;
411
+ constructor(type: "success" | "error" | "empty");
412
+ }
413
+ /** Variant representing an empty payload (no data, no error). */
414
+ declare class SlicedExecutionResultEmpty<TData, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter> extends SlicedExecutionResultGuards<TData, TRuntimeAdapter> implements SlicedExecutionResultCommon<TData, NormalizedError<TRuntimeAdapter>> {
415
+ constructor();
416
+ unwrap(): null;
417
+ safeUnwrap(): {
418
+ data: undefined;
419
+ error: undefined;
420
+ };
421
+ }
422
+ /** Variant representing a successful payload. */
423
+ declare class SlicedExecutionResultSuccess<TData, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter> extends SlicedExecutionResultGuards<TData, TRuntimeAdapter> implements SlicedExecutionResultCommon<TData, NormalizedError<TRuntimeAdapter>> {
424
+ readonly data: TData;
425
+ readonly extensions?: unknown | undefined;
426
+ constructor(data: TData, extensions?: unknown | undefined);
427
+ unwrap(): TData;
428
+ safeUnwrap<TTransformed>(transform: (data: TData) => TTransformed): {
429
+ data: TTransformed;
430
+ error: undefined;
431
+ };
432
+ }
433
+ /** Variant representing an error payload created by the adapter. */
434
+ declare class SlicedExecutionResultError<TData, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter> extends SlicedExecutionResultGuards<TData, TRuntimeAdapter> implements SlicedExecutionResultCommon<TData, NormalizedError<TRuntimeAdapter>> {
435
+ readonly error: NormalizedError<TRuntimeAdapter>;
436
+ readonly extensions?: unknown | undefined;
437
+ constructor(error: NormalizedError<TRuntimeAdapter>, extensions?: unknown | undefined);
438
+ unwrap(): never;
439
+ safeUnwrap(): {
440
+ data: undefined;
441
+ error: NormalizedError<TRuntimeAdapter>;
442
+ };
443
+ }
444
+ //#endregion
445
+ //#region packages/core/src/types/runtime/projection.d.ts
446
+ /** Shape of a single selection slice projection. */
447
+ type AnyProjection = Projection<any>;
448
+ declare const __PROJECTION_BRAND__: unique symbol;
449
+ /**
450
+ * Nominal type representing any slice selection regardless of schema specifics.
451
+ * Encodes how individual slices map a concrete field path to a projection
452
+ * function. Multiple selections allow slices to expose several derived values.
453
+ */
454
+ declare class Projection<TProjected> {
455
+ readonly projector: (result: AnySlicedExecutionResult) => TProjected;
456
+ readonly [__PROJECTION_BRAND__]: Hidden<never>;
457
+ constructor(paths: Tuple<string>, projector: (result: AnySlicedExecutionResult) => TProjected);
458
+ readonly paths: ProjectionPath[];
459
+ }
460
+ type ProjectionPath = {
461
+ full: string;
462
+ segments: Tuple<string>;
463
+ };
464
+ type InferExecutionResultProjection<TProjection extends AnyProjection> = ReturnType<TProjection["projector"]>;
465
+ //#endregion
466
+ //#region packages/core/src/utils/empty-object.d.ts
467
+ declare const __EMPTY_SYMBOL__: unique symbol;
468
+ type EmptyObject = {
469
+ readonly [__EMPTY_SYMBOL__]: never;
470
+ };
471
+ type IsEmptyObject<T> = keyof (T & EmptyObject) extends keyof EmptyObject ? true : false;
472
+ type IfEmpty<TTarget, TType> = IsEmptyObject<TTarget> extends true ? TType : never;
473
+ type SwitchIfEmpty<TTarget, TTrue, TFalse> = IsEmptyObject<TTarget> extends true ? TTrue : TFalse;
474
+ declare const empty: () => EmptyObject;
475
+ //#endregion
476
+ //#region packages/core/src/types/element/slice.d.ts
477
+ type AnySlice = AnySliceOf<"query"> | AnySliceOf<"mutation"> | AnySliceOf<"subscription">;
478
+ type AnySliceOf<TOperationType extends OperationType> = Slice<TOperationType, any, AnyFields, AnyProjection>;
479
+ type SliceDefinition<TOperationType extends OperationType, TVariables extends Partial<AnyAssignableInput> | void, TFields extends Partial<AnyFields>, TProjection extends AnyProjection> = {
480
+ readonly operationType: TOperationType;
481
+ readonly embed: (variables: TVariables) => SlicePayload<TVariables, TFields, TProjection>;
482
+ };
483
+ declare const __OPERATION_SLICE_BRAND__: unique symbol;
484
+ declare class Slice<TOperationType extends OperationType, TVariables extends Partial<AnyAssignableInput> | void, TFields extends Partial<AnyFields>, TProjection extends AnyProjection> extends GqlElement<SliceDefinition<TOperationType, TVariables, TFields, TProjection>> implements SliceDefinition<TOperationType, TVariables, TFields, TProjection> {
485
+ readonly [__OPERATION_SLICE_BRAND__]: Hidden<{
486
+ operationType: TOperationType;
487
+ output: InferExecutionResultProjection<TProjection>;
488
+ }>;
489
+ private constructor();
490
+ get operationType(): TOperationType;
491
+ get embed(): (variables: TVariables) => SlicePayload<TVariables, TFields, TProjection>;
492
+ static create<TSchema extends AnyGraphqlSchema, TOperationType extends OperationType, TVariableDefinitions extends InputTypeSpecifiers, TFields extends AnyFields, TProjection extends AnyProjection>(define: () => {
493
+ operationType: TOperationType;
494
+ embed: (variables: SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>) => SlicePayload<SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>, TFields, TProjection>;
495
+ }): Slice<TOperationType, SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>, TFields & {
496
+ [key: symbol]: never;
497
+ }, TProjection>;
498
+ }
499
+ type AnySlicePayloads = {
500
+ [key: string]: AnySlicePayload;
501
+ };
502
+ type AnySlicePayload = SlicePayload<AnyAssignableInput | void, AnyFields, AnyProjection>;
503
+ type SlicePayload<TVariables extends Partial<AnyAssignableInput> | void, TFields extends Partial<AnyFields>, TProjection extends AnyProjection> = {
504
+ variables: TVariables;
505
+ getFields: () => TFields;
506
+ projection: TProjection;
507
+ };
508
+ type InferOutputOfSlice<TSlice extends AnySliceOf<any>> = ReturnType<TSlice[typeof __OPERATION_SLICE_BRAND__]>["output"];
509
+ //#endregion
510
+ //#region packages/core/src/types/element/composed-operation.d.ts
511
+ type AnyComposedOperation = AnyComposedOperationOf<"query"> | AnyComposedOperationOf<"mutation"> | AnyComposedOperationOf<"subscription">;
512
+ type AnyComposedOperationOf<TOperationType extends OperationType> = ComposedOperation<AnyGraphqlRuntimeAdapter, TOperationType, string, string[], any, any, any>;
513
+ declare const __COMPOSED_OPERATION_BRAND__: unique symbol;
514
+ type ComposedOperationDefinition<TRuntimeAdapter extends AnyGraphqlRuntimeAdapter, TOperationType extends OperationType, TOperationName extends string, TVariableNames extends string[], TVariables extends AnyConstAssignableInput, TRawData extends object, TProjectedData extends object> = {
515
+ readonly operationType: TOperationType;
516
+ readonly operationName: TOperationName;
517
+ readonly variableNames: TVariableNames;
518
+ readonly projectionPathGraph: ProjectionPathGraphNode;
519
+ readonly document: TypedQueryDocumentNode<TRawData, TVariables>;
520
+ readonly parse: (result: NormalizedExecutionResult<TRuntimeAdapter, TRawData, any>) => TProjectedData;
521
+ };
522
+ declare class ComposedOperation<TRuntimeAdapter extends AnyGraphqlRuntimeAdapter, TOperationType extends OperationType, TOperationName extends string, TVariableNames extends string[], TVariables extends AnyConstAssignableInput, TRawData extends object, TProjectedData extends object> extends GqlElement<ComposedOperationDefinition<TRuntimeAdapter, TOperationType, TOperationName, TVariableNames, TVariables, TRawData, TProjectedData>> implements ComposedOperationDefinition<TRuntimeAdapter, TOperationType, TOperationName, TVariableNames, TVariables, TRawData, TProjectedData> {
523
+ readonly [__COMPOSED_OPERATION_BRAND__]: Hidden<{
524
+ operationType: TOperationType;
525
+ }>;
526
+ private constructor();
527
+ get operationType(): TOperationType;
528
+ get operationName(): TOperationName;
529
+ get variableNames(): TVariableNames;
530
+ get projectionPathGraph(): ProjectionPathGraphNode;
531
+ get document(): TypedQueryDocumentNode<TRawData, TVariables>;
532
+ get parse(): (result: NormalizedExecutionResult<TRuntimeAdapter, TRawData, any>) => TProjectedData;
533
+ static create<TSchema extends AnyGraphqlSchema, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter, TOperationType extends OperationType, TOperationName extends string, TVariableDefinitions extends InputTypeSpecifiers, TSliceFragments extends AnySlicePayloads>(define: (context: GqlElementContext | null) => {
534
+ operationType: TOperationType;
535
+ operationName: TOperationName;
536
+ variableNames: (keyof TVariableDefinitions & string)[];
537
+ projectionPathGraph: ProjectionPathGraphNode;
538
+ document: TypedQueryDocumentNode<InferComposedOperationRawData<TSchema, TSliceFragments>, ConstAssignableInput<TSchema, TVariableDefinitions>>;
539
+ parse: (result: NormalizedExecutionResult<TRuntimeAdapter, InferComposedOperationRawData<TSchema, TSliceFragments>, any>) => { [K in keyof TSliceFragments]: InferExecutionResultProjection<TSliceFragments[K]["projection"]> };
540
+ }): ComposedOperation<TRuntimeAdapter, TOperationType, TOperationName, (keyof TVariableDefinitions & string)[], ConstAssignableInput<TSchema, TVariableDefinitions>, ((ConcatSlicePayloads<TSliceFragments> extends infer T_2 extends AnyFields ? { readonly [TAliasName in keyof T_2]: InferField<TSchema_1, T_2[TAliasName]> } : never) extends infer T_1 ? { [K_1 in keyof T_1]: T_1[K_1] } : never) extends infer T ? { [K in keyof T]: T[K] } : never, { [K_2 in keyof TSliceFragments]: InferExecutionResultProjection<TSliceFragments[K_2]["projection"]> }>;
541
+ }
542
+ type ProjectionPathGraphNode = {
543
+ readonly matches: {
544
+ label: string;
545
+ path: string;
546
+ exact: boolean;
547
+ }[];
548
+ readonly children: {
549
+ readonly [segment: string]: ProjectionPathGraphNode;
550
+ };
551
+ };
552
+ type ConcatSlicePayloads<TSlicePayloads extends AnySlicePayloads> = Prettify<UnionToIntersection<{ [TLabel in keyof TSlicePayloads & string]: TSlicePayloads[TLabel] extends {
553
+ getFields: () => infer TFields;
554
+ } ? { [K in keyof TFields & string as `${TLabel}_${K}`]: TFields[K] } : {} }[keyof TSlicePayloads & string]>> & AnyFields;
555
+ type InferComposedOperationRawData<TSchema extends AnyGraphqlSchema, TSlicePayloads extends AnySlicePayloads> = Prettify<InferFields<TSchema, ConcatSlicePayloads<TSlicePayloads>>>;
556
+ type ComposedOperationDefinitionBuilder<TSchema extends AnyGraphqlSchema, TVarDefinitions extends InputTypeSpecifiers, TSliceContents extends AnySlicePayloads> = (tools: {
557
+ $: NoInfer<AssignableInput<TSchema, TVarDefinitions>>;
558
+ }) => TSliceContents;
559
+ //#endregion
560
+ //#region packages/core/src/types/element/execution-result-projection-builder.d.ts
561
+ type AnyExecutionResultProjectionsBuilder = ExecutionResultProjectionsBuilder<AnyGraphqlSchema, AnyGraphqlRuntimeAdapter, any, any>;
562
+ type ExecutionResultProjectionsBuilder<TSchema extends AnyGraphqlSchema, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter, TFields extends AnyFields, TProjection extends AnyProjection> = (tools: {
563
+ select: ResultSelector<TSchema, TRuntimeAdapter, TFields>;
564
+ }) => TProjection;
565
+ type ResultSelector<TSchema extends AnyGraphqlSchema, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter, TFields extends AnyFields> = <TPaths extends Tuple<AvailableFieldPathOf<TSchema, TFields>>, TProjected>(paths: TPaths, projector: (result: NoInfer<SlicedExecutionResult<InferByResultSelectorPaths<TSchema, TFields, TPaths>, TRuntimeAdapter>>) => TProjected) => NoInfer<Projection<TProjected>>;
566
+ type InferByResultSelectorPaths<TSchema extends AnyGraphqlSchema, TFields extends AnyFields, TPaths extends Tuple<AvailableFieldPathOf<TSchema, TFields>>> = TPaths extends string[] ? { [K in keyof TPaths]: TPaths[K] extends string ? InferByFieldPath<TSchema, TFields, TPaths[K]> : never } : never;
567
+ //#endregion
568
+ //#region packages/core/src/types/element/fields-builder.d.ts
569
+ declare const mergeFields: <TFieldEntries extends AnyFields[]>(fields: TFieldEntries) => MergeFields<TFieldEntries>;
570
+ type MergeFields<TFieldEntries extends AnyFields[]> = UnionToIntersection<TFieldEntries[number]> extends infer TFieldsIntersection ? { [TFieldName in keyof TFieldsIntersection]: TFieldsIntersection[TFieldName] extends AnyFieldSelection ? TFieldsIntersection[TFieldName] : never } & {} : never;
571
+ /**
572
+ * Builder signature exposed to userland `model` and `slice` helpers. The
573
+ * tooling `f`/`fields`/`_` aliases provide ergonomic access to GraphQL fields
574
+ * while preserving the original schema information for inference.
575
+ */
576
+ type FieldsBuilder<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string, TVariableDefinitions extends InputTypeSpecifiers, TFields extends AnyFields[]> = (tools: NoInfer<FieldsBuilderTools<TSchema, TTypeName, TVariableDefinitions>>) => TFields;
577
+ type FieldsBuilderTools<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string, TVariableDefinitions extends InputTypeSpecifiers> = {
578
+ f: FieldSelectionFactories<TSchema, TTypeName>;
579
+ $: AssignableInput<TSchema, TVariableDefinitions>;
580
+ };
581
+ /** Narrow builder used when a field resolves to an object and we need nested selections. */
582
+ type NestedObjectFieldsBuilder<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string, TFields extends AnyNestedObject[]> = (tools: NoInfer<NestedObjectFieldsBuilderTools<TSchema, TTypeName>>) => TFields;
583
+ type NestedObjectFieldsBuilderTools<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string> = {
584
+ f: FieldSelectionFactories<TSchema, TTypeName>;
585
+ };
586
+ type NestedUnionFieldsBuilder<TSchema extends AnyGraphqlSchema, TMemberName extends string, TUnionFields extends AnyNestedUnion> = { [TTypename in keyof TUnionFields & TMemberName]?: NestedObjectFieldsBuilder<TSchema, TTypename, NonNullable<TUnionFields[TTypename]>[]> };
587
+ /** Map each field to a factory capable of emitting fully-typed references. */
588
+ type FieldSelectionFactories<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string> = { [TFieldName in keyof ObjectFieldRecord<TSchema, TTypeName>]: TFieldName extends string ? FieldSelectionFactory<TSchema, FieldSelectionTemplateOf<TSchema, TTypeName, TFieldName>> : never };
589
+ type AnyFieldSelectionFactory = <TAlias extends string | null = null>(fieldArgs: AnyAssignableInput | void, extras?: {
590
+ alias?: TAlias;
591
+ directives?: AnyDirectiveAttachments;
592
+ }) => AnyFieldSelectionFactoryReturn<TAlias>;
593
+ type FieldSelectionFactory<TSchema extends AnyGraphqlSchema, TSelection extends AnyFieldSelection> = <TAlias extends string | null = null>(fieldArgs: TSelection["args"] | IfEmpty<TSelection["args"], void | null>, extras?: {
594
+ alias?: TAlias;
595
+ directives?: TSelection["directives"];
596
+ }) => FieldSelectionFactoryReturn<TSchema, TSelection, TAlias>;
597
+ type AnyFieldSelectionFactoryReturn<TAlias extends string | null> = FieldSelectionFactoryReturn<AnyGraphqlSchema, AnyFieldSelection & {
598
+ type: OutputObjectSpecifier;
599
+ }, TAlias> | FieldSelectionFactoryReturn<AnyGraphqlSchema, AnyFieldSelection & {
600
+ type: OutputUnionSpecifier;
601
+ }, TAlias> | FieldSelectionFactoryReturn<AnyGraphqlSchema, AnyFieldSelection & {
602
+ type: OutputTypenameSpecifier | OutputScalarSpecifier | OutputEnumSpecifier;
603
+ }, TAlias>;
604
+ type FieldSelectionFactoryReturn<TSchema extends AnyGraphqlSchema, TSelection extends AnyFieldSelection, TAlias extends string | null> = TSelection extends {
605
+ type: OutputObjectSpecifier;
606
+ } ? FieldSelectionFactoryObjectReturn<TSchema, TSelection, TAlias> : TSelection extends {
607
+ type: OutputUnionSpecifier;
608
+ } ? FieldSelectionFactoryUnionReturn<TSchema, TSelection, TAlias> : TSelection extends {
609
+ type: OutputTypenameSpecifier | OutputScalarSpecifier | OutputEnumSpecifier;
610
+ } ? FieldSelectionFactoryPrimitiveReturn<TSelection, TAlias> : never;
611
+ type FieldSelectionFactoryObjectReturn<TSchema extends AnyGraphqlSchema, TSelection extends AnyFieldSelection & {
612
+ type: OutputObjectSpecifier;
613
+ }, TAlias extends string | null> = <TNested extends AnyNestedObject[]>(nest: NestedObjectFieldsBuilder<TSchema, TSelection["type"]["name"], TNested>) => { [_ in TAlias extends null ? TSelection["field"] : TAlias]: AbstractFieldSelection<TSelection["parent"], TSelection["field"], TSelection["type"], TSelection["args"], TSelection["directives"], {
614
+ object: MergeFields<TNested>;
615
+ }> };
616
+ type FieldSelectionFactoryUnionReturn<TSchema extends AnyGraphqlSchema, TSelection extends AnyFieldSelection & {
617
+ type: OutputUnionSpecifier;
618
+ }, TAlias extends string | null> = <TNested extends AnyNestedUnion>(nest: NestedUnionFieldsBuilder<TSchema, UnionMemberName<TSchema, TSelection["type"]>, TNested>) => { [_ in TAlias extends null ? TSelection["field"] : TAlias]: AbstractFieldSelection<TSelection["parent"], TSelection["field"], TSelection["type"], TSelection["args"], TSelection["directives"], {
619
+ union: TNested;
620
+ }> };
621
+ type FieldSelectionFactoryPrimitiveReturn<TSelection extends AnyFieldSelection & {
622
+ type: OutputTypenameSpecifier | OutputScalarSpecifier | OutputEnumSpecifier;
623
+ }, TAlias extends string | null> = { [_ in TAlias extends null ? TSelection["field"] : TAlias]: AbstractFieldSelection<TSelection["parent"], TSelection["field"], TSelection["type"], TSelection["args"], TSelection["directives"], {}> };
624
+ type FieldSelectionFactoryFieldArguments<TFieldSelectionTemplate extends AnyFieldSelection> = TFieldSelectionTemplate["args"] | IfEmpty<TFieldSelectionTemplate["args"], void | null>;
625
+ //#endregion
626
+ //#region packages/core/src/types/element/inline-operation.d.ts
627
+ type AnyInlineOperation = AnyInlineOperationOf<"query"> | AnyInlineOperationOf<"mutation"> | AnyInlineOperationOf<"subscription">;
628
+ type AnyInlineOperationOf<TOperationType extends OperationType> = InlineOperation<TOperationType, string, string[], any, AnyFields, any>;
629
+ declare const __INLINE_OPERATION_BRAND__: unique symbol;
630
+ type InlineOperationArtifact<TOperationType extends OperationType, TOperationName extends string, TVariableNames extends string[], TVariables extends AnyConstAssignableInput, TFields extends Partial<AnyFields>, TData extends object> = {
631
+ readonly operationType: TOperationType;
632
+ readonly operationName: TOperationName;
633
+ readonly variableNames: TVariableNames;
634
+ readonly documentSource: () => TFields;
635
+ readonly document: TypedQueryDocumentNode<TData, TVariables>;
636
+ };
637
+ declare class InlineOperation<TOperationType extends OperationType, TOperationName extends string, TVariableNames extends string[], TVariables extends AnyConstAssignableInput, TFields extends Partial<AnyFields>, TData extends object> extends GqlElement<InlineOperationArtifact<TOperationType, TOperationName, TVariableNames, TVariables, TFields, TData>> implements InlineOperationArtifact<TOperationType, TOperationName, TVariableNames, TVariables, TFields, TData> {
638
+ readonly [__INLINE_OPERATION_BRAND__]: Hidden<{
639
+ operationType: TOperationType;
640
+ }>;
641
+ private constructor();
642
+ get operationType(): TOperationType;
643
+ get operationName(): TOperationName;
644
+ get variableNames(): TVariableNames;
645
+ get documentSource(): () => TFields;
646
+ get document(): TypedQueryDocumentNode<TData, TVariables>;
647
+ static create<TSchema extends AnyGraphqlSchema, TOperationType extends OperationType, TOperationName extends string, TVariableDefinitions extends InputTypeSpecifiers, TFields extends AnyFields>(define: (context: GqlElementContext | null) => {
648
+ operationType: TOperationType;
649
+ operationName: TOperationName;
650
+ variableNames: (keyof TVariableDefinitions & string)[];
651
+ documentSource: () => TFields;
652
+ document: TypedQueryDocumentNode<InferFields<TSchema, TFields>, ConstAssignableInput<TSchema, TVariableDefinitions>>;
653
+ }): InlineOperation<TOperationType, TOperationName, (keyof TVariableDefinitions & string)[], ConstAssignableInput<TSchema, TVariableDefinitions>, TFields, { [K in keyof { readonly [TAliasName in keyof TFields]: InferField<TSchema, TFields[TAliasName]> }]: { readonly [TAliasName in keyof TFields]: InferField<TSchema, TFields[TAliasName]> }[K] }>;
654
+ }
655
+ //#endregion
656
+ //#region packages/core/src/types/element/model.d.ts
657
+ type AnyModel = Model<string, any, AnyFields, any, any>;
658
+ type ModelArtifact<TTypeName extends string, TVariables extends Partial<AnyAssignableInput> | void, TFields extends Partial<AnyFields>, TRaw extends object, TNormalized extends object> = {
659
+ readonly typename: TTypeName;
660
+ readonly fragment: (variables: TVariables) => TFields;
661
+ readonly normalize: (raw: TRaw) => TNormalized;
662
+ };
663
+ declare const __MODEL_BRAND__: unique symbol;
664
+ declare class Model<TTypeName extends string, TVariables extends Partial<AnyAssignableInput> | void, TFields extends Partial<AnyFields>, TRaw extends object, TNormalized extends object> extends GqlElement<ModelArtifact<TTypeName, TVariables, TFields, TRaw, TNormalized>> implements ModelArtifact<TTypeName, TVariables, TFields, TRaw, TNormalized> {
665
+ readonly [__MODEL_BRAND__]: Hidden<{
666
+ input: TVariables;
667
+ output: TNormalized;
668
+ }>;
669
+ private constructor();
670
+ get typename(): TTypeName;
671
+ get fragment(): (variables: TVariables) => TFields;
672
+ get normalize(): (raw: TRaw) => TNormalized;
673
+ static create<TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string, TVariableDefinitions extends InputTypeSpecifiers, TFields extends AnyFields, TNormalized extends object>(define: () => {
674
+ typename: TTypeName;
675
+ fragment: (variables: SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>) => TFields;
676
+ normalize: (raw: NoInfer<InferFields<TSchema, TFields>>) => TNormalized;
677
+ }): Model<TTypeName, SwitchIfEmpty<TVariableDefinitions, void, AssignableInput<TSchema, TVariableDefinitions>>, TFields & {
678
+ [key: symbol]: never;
679
+ }, { [K in keyof { readonly [TAliasName in keyof TFields]: InferField<TSchema, TFields[TAliasName]> }]: { readonly [TAliasName in keyof TFields]: InferField<TSchema, TFields[TAliasName]> }[K] } & {
680
+ [key: symbol]: never;
681
+ }, TNormalized>;
682
+ }
683
+ //#endregion
684
+ //#region packages/core/src/composer/input.d.ts
685
+ declare const mergeVarDefinitions: <TVarDefinitions extends InputTypeSpecifiers[]>(definitions: TVarDefinitions) => MergeVarDefinitions<TVarDefinitions>;
686
+ type MergeVarDefinitions<TVarDefinitions extends InputTypeSpecifiers[]> = UnionToIntersection<TVarDefinitions[number]> extends infer TDefinitions ? { readonly [K in keyof TDefinitions]: TDefinitions[K] } & {} : never;
687
+ declare const createVarAssignments: <TSchema extends AnyGraphqlSchema, TVariableDefinitions extends InputTypeSpecifiers>(definitions: TVariableDefinitions, provided: AnyAssignableInput | void) => AssignableInput<TSchema, TVariableDefinitions>;
688
+ declare const createVarRefs: <TSchema extends AnyGraphqlSchema, TVarDefinitions extends InputTypeSpecifiers>(definitions: TVarDefinitions) => AssignableInput<TSchema, TVarDefinitions>;
689
+ //#endregion
690
+ //#region packages/core/src/composer/composed-operation.d.ts
691
+ declare const createComposedOperationComposerFactory: <TSchema extends AnyGraphqlSchema, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter>() => <TOperationType extends OperationType>(operationType: TOperationType) => <TOperationName extends string, TSliceFragments extends AnySlicePayloads, TVarDefinitions extends InputTypeSpecifiers[] = [{}]>(options: {
692
+ operationName: TOperationName;
693
+ variables?: TVarDefinitions;
694
+ }, builder: ComposedOperationDefinitionBuilder<TSchema, MergeVarDefinitions<TVarDefinitions>, TSliceFragments>) => ComposedOperation<TRuntimeAdapter, TOperationType, TOperationName, (keyof MergeVarDefinitions<TVarDefinitions> & string)[], ConstAssignableInput<TSchema, MergeVarDefinitions<TVarDefinitions>>, ((ConcatSlicePayloads<TSliceFragments> extends infer T_2 extends AnyFields ? { readonly [TAliasName in keyof T_2]: InferField<TSchema_1, T_2[TAliasName]> } : never) extends infer T_1 ? { [K_1 in keyof T_1]: T_1[K_1] } : never) extends infer T ? { [K in keyof T]: T[K] } : never, { [K_2 in keyof TSliceFragments]: ReturnType<TSliceFragments[K_2]["projection"]["projector"]> }>;
695
+ //#endregion
696
+ //#region packages/core/src/composer/fields-builder.d.ts
697
+ declare const createFieldFactories: <TSchema extends AnyGraphqlSchema, TTypeName extends keyof TSchema["object"] & string>(schema: TSchema, typeName: TTypeName) => FieldSelectionFactories<TSchema, TTypeName>;
698
+ //#endregion
699
+ //#region packages/core/src/composer/gql-composer.d.ts
700
+ type GqlElementComposer<TComposers, THelper> = <TResult extends AnyModel | AnySlice | AnyComposedOperation | AnyInlineOperation>(composeElement: (composers: TComposers, helper: THelper) => TResult) => TResult;
701
+ declare const createGqlElementComposer: <TSchema extends AnyGraphqlSchema, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter>(schema: NoInfer<TSchema>) => GqlElementComposer<{
702
+ model: Omit<{ readonly [TTypeName in keyof TSchema["object"]]: TTypeName extends string ? <TFieldEntries extends AnyFields[], TNormalized extends object, TVarDefinitions extends InputTypeSpecifiers[] = [{}]>(options: {
703
+ variables?: TVarDefinitions | undefined;
704
+ }, builder: FieldsBuilder<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, TFieldEntries>, normalize: (raw: NoInfer<(MergeFields<TFieldEntries> extends infer T_1 extends AnyFields ? { readonly [TAliasName in keyof T_1]: InferField<TSchema_1, T_1[TAliasName]> } : never) extends infer T ? { [K in keyof T]: T[K] } : never>) => TNormalized) => Model<TTypeName, SwitchIfEmpty<MergeVarDefinitions<TVarDefinitions>, void, AssignableInput<TSchema, MergeVarDefinitions<TVarDefinitions>>>, MergeFields<TFieldEntries> & {
705
+ [key: symbol]: never;
706
+ }, ((MergeFields<TFieldEntries> extends infer T_1 extends AnyFields ? { readonly [TAliasName in keyof T_1]: InferField<TSchema_1, T_1[TAliasName]> } : never) extends infer T ? { [K in keyof T]: T[K] } : never) & {
707
+ [key: symbol]: never;
708
+ }, TNormalized> : never }, TSchema["operations"][keyof OperationRoots] & keyof TSchema["object"]>;
709
+ query: {
710
+ slice: <TFieldEntries extends AnyFields[], TProjection extends AnyProjection, TVarDefinitions_1 extends InputTypeSpecifiers[] = [{}]>(options: {
711
+ variables?: TVarDefinitions_1 | undefined;
712
+ }, fieldBuilder: FieldsBuilder<TSchema, TSchema["operations"]["query"] & keyof TSchema["object"] & string, MergeVarDefinitions<TVarDefinitions_1>, TFieldEntries>, projectionBuilder: ExecutionResultProjectionsBuilder<TSchema, TRuntimeAdapter, MergeFields<TFieldEntries>, TProjection>) => Slice<"query", SwitchIfEmpty<MergeVarDefinitions<TVarDefinitions_1>, void, AssignableInput<TSchema, MergeVarDefinitions<TVarDefinitions_1>>>, MergeFields<TFieldEntries> & {
713
+ [key: symbol]: never;
714
+ }, TProjection>;
715
+ composed: <TOperationName extends string, TSliceFragments extends AnySlicePayloads, TVarDefinitions_2 extends InputTypeSpecifiers[] = [{}]>(options: {
716
+ operationName: TOperationName;
717
+ variables?: TVarDefinitions_2 | undefined;
718
+ }, builder: ComposedOperationDefinitionBuilder<TSchema, MergeVarDefinitions<TVarDefinitions_2>, TSliceFragments>) => ComposedOperation<TRuntimeAdapter, "query", TOperationName, (keyof MergeVarDefinitions<TVarDefinitions_2> & string)[], ConstAssignableInput<TSchema, MergeVarDefinitions<TVarDefinitions_2>>, ((ConcatSlicePayloads<TSliceFragments> extends infer T_2 extends AnyFields ? { readonly [TAliasName in keyof T_2]: InferField<TSchema_1, T_2[TAliasName]> } : never) extends infer T_1 ? { [K_1 in keyof T_1]: T_1[K_1] } : never) extends infer T ? { [K in keyof T]: T[K] } : never, { [K_2 in keyof TSliceFragments]: ReturnType<TSliceFragments[K_2]["projection"]["projector"]> }>;
719
+ inline: <TOperationName extends string, TFields extends AnyFields[], TVarDefinitions_3 extends InputTypeSpecifiers[] = [{}]>(options: {
720
+ operationName: TOperationName;
721
+ variables?: TVarDefinitions_3 | undefined;
722
+ }, fieldBuilder: FieldsBuilder<TSchema, TSchema["operations"]["query"] & keyof TSchema["object"] & string, MergeVarDefinitions<TVarDefinitions_3>, TFields>) => InlineOperation<"query", TOperationName, (keyof MergeVarDefinitions<TVarDefinitions_3> & string)[], ConstAssignableInput<TSchema, MergeVarDefinitions<TVarDefinitions_3>>, MergeFields<TFields>, (MergeFields<TFields> extends infer T_1 extends AnyFields ? { readonly [TAliasName in keyof T_1]: InferField<TSchema_1, T_1[TAliasName]> } : never) extends infer T ? { [K in keyof T]: T[K] } : never>;
723
+ };
724
+ mutation: {
725
+ slice: <TFieldEntries extends AnyFields[], TProjection extends AnyProjection, TVarDefinitions_1 extends InputTypeSpecifiers[] = [{}]>(options: {
726
+ variables?: TVarDefinitions_1 | undefined;
727
+ }, fieldBuilder: FieldsBuilder<TSchema, TSchema["operations"]["mutation"] & keyof TSchema["object"] & string, MergeVarDefinitions<TVarDefinitions_1>, TFieldEntries>, projectionBuilder: ExecutionResultProjectionsBuilder<TSchema, TRuntimeAdapter, MergeFields<TFieldEntries>, TProjection>) => Slice<"mutation", SwitchIfEmpty<MergeVarDefinitions<TVarDefinitions_1>, void, AssignableInput<TSchema, MergeVarDefinitions<TVarDefinitions_1>>>, MergeFields<TFieldEntries> & {
728
+ [key: symbol]: never;
729
+ }, TProjection>;
730
+ composed: <TOperationName extends string, TSliceFragments extends AnySlicePayloads, TVarDefinitions_2 extends InputTypeSpecifiers[] = [{}]>(options: {
731
+ operationName: TOperationName;
732
+ variables?: TVarDefinitions_2 | undefined;
733
+ }, builder: ComposedOperationDefinitionBuilder<TSchema, MergeVarDefinitions<TVarDefinitions_2>, TSliceFragments>) => ComposedOperation<TRuntimeAdapter, "mutation", TOperationName, (keyof MergeVarDefinitions<TVarDefinitions_2> & string)[], ConstAssignableInput<TSchema, MergeVarDefinitions<TVarDefinitions_2>>, ((ConcatSlicePayloads<TSliceFragments> extends infer T_2 extends AnyFields ? { readonly [TAliasName in keyof T_2]: InferField<TSchema_1, T_2[TAliasName]> } : never) extends infer T_1 ? { [K_1 in keyof T_1]: T_1[K_1] } : never) extends infer T ? { [K in keyof T]: T[K] } : never, { [K_2 in keyof TSliceFragments]: ReturnType<TSliceFragments[K_2]["projection"]["projector"]> }>;
734
+ inline: <TOperationName extends string, TFields extends AnyFields[], TVarDefinitions_3 extends InputTypeSpecifiers[] = [{}]>(options: {
735
+ operationName: TOperationName;
736
+ variables?: TVarDefinitions_3 | undefined;
737
+ }, fieldBuilder: FieldsBuilder<TSchema, TSchema["operations"]["mutation"] & keyof TSchema["object"] & string, MergeVarDefinitions<TVarDefinitions_3>, TFields>) => InlineOperation<"mutation", TOperationName, (keyof MergeVarDefinitions<TVarDefinitions_3> & string)[], ConstAssignableInput<TSchema, MergeVarDefinitions<TVarDefinitions_3>>, MergeFields<TFields>, (MergeFields<TFields> extends infer T_1 extends AnyFields ? { readonly [TAliasName in keyof T_1]: InferField<TSchema_1, T_1[TAliasName]> } : never) extends infer T ? { [K in keyof T]: T[K] } : never>;
738
+ };
739
+ subscription: {
740
+ slice: <TFieldEntries extends AnyFields[], TProjection extends AnyProjection, TVarDefinitions_1 extends InputTypeSpecifiers[] = [{}]>(options: {
741
+ variables?: TVarDefinitions_1 | undefined;
742
+ }, fieldBuilder: FieldsBuilder<TSchema, TSchema["operations"]["subscription"] & keyof TSchema["object"] & string, MergeVarDefinitions<TVarDefinitions_1>, TFieldEntries>, projectionBuilder: ExecutionResultProjectionsBuilder<TSchema, TRuntimeAdapter, MergeFields<TFieldEntries>, TProjection>) => Slice<"subscription", SwitchIfEmpty<MergeVarDefinitions<TVarDefinitions_1>, void, AssignableInput<TSchema, MergeVarDefinitions<TVarDefinitions_1>>>, MergeFields<TFieldEntries> & {
743
+ [key: symbol]: never;
744
+ }, TProjection>;
745
+ composed: <TOperationName extends string, TSliceFragments extends AnySlicePayloads, TVarDefinitions_2 extends InputTypeSpecifiers[] = [{}]>(options: {
746
+ operationName: TOperationName;
747
+ variables?: TVarDefinitions_2 | undefined;
748
+ }, builder: ComposedOperationDefinitionBuilder<TSchema, MergeVarDefinitions<TVarDefinitions_2>, TSliceFragments>) => ComposedOperation<TRuntimeAdapter, "subscription", TOperationName, (keyof MergeVarDefinitions<TVarDefinitions_2> & string)[], ConstAssignableInput<TSchema, MergeVarDefinitions<TVarDefinitions_2>>, ((ConcatSlicePayloads<TSliceFragments> extends infer T_2 extends AnyFields ? { readonly [TAliasName in keyof T_2]: InferField<TSchema_1, T_2[TAliasName]> } : never) extends infer T_1 ? { [K_1 in keyof T_1]: T_1[K_1] } : never) extends infer T ? { [K in keyof T]: T[K] } : never, { [K_2 in keyof TSliceFragments]: ReturnType<TSliceFragments[K_2]["projection"]["projector"]> }>;
749
+ inline: <TOperationName extends string, TFields extends AnyFields[], TVarDefinitions_3 extends InputTypeSpecifiers[] = [{}]>(options: {
750
+ operationName: TOperationName;
751
+ variables?: TVarDefinitions_3 | undefined;
752
+ }, fieldBuilder: FieldsBuilder<TSchema, TSchema["operations"]["subscription"] & keyof TSchema["object"] & string, MergeVarDefinitions<TVarDefinitions_3>, TFields>) => InlineOperation<"subscription", TOperationName, (keyof MergeVarDefinitions<TVarDefinitions_3> & string)[], ConstAssignableInput<TSchema, MergeVarDefinitions<TVarDefinitions_3>>, MergeFields<TFields>, (MergeFields<TFields> extends infer T_1 extends AnyFields ? { readonly [TAliasName in keyof T_1]: InferField<TSchema_1, T_1[TAliasName]> } : never) extends infer T ? { [K in keyof T]: T[K] } : never>;
753
+ };
754
+ }, {
755
+ $: <TVarName extends string>(varName: TVarName) => {
756
+ scalar: <const TTypeName_1 extends keyof TSchema["scalar"] & string, const TModifier extends TypeModifier, const TDefaultFn extends (() => ConstAssignableInputValue<TSchema, {
757
+ kind: "scalar";
758
+ name: TTypeName_1;
759
+ modifier: TModifier;
760
+ directives: {};
761
+ defaultValue: null;
762
+ }>) | null = null, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TTypeName_1, TModifier>, extras?: {
763
+ default?: (TDefaultFn & (() => ConstAssignableInputValue<TSchema, {
764
+ kind: "scalar";
765
+ name: TTypeName_1;
766
+ modifier: TModifier;
767
+ directives: {};
768
+ defaultValue: null;
769
+ }>)) | (NoInfer<TDefaultFn> extends null ? () => ConstAssignableInputValue<TSchema, {
770
+ kind: "scalar";
771
+ name: TTypeName_1;
772
+ modifier: TModifier;
773
+ directives: {};
774
+ defaultValue: null;
775
+ }> : never) | undefined;
776
+ directives?: TDirectives | undefined;
777
+ } | undefined) => { [K in TVarName]: {
778
+ kind: "scalar";
779
+ name: TTypeName_1;
780
+ modifier: TModifier;
781
+ defaultValue: TDefaultFn extends null ? null : {
782
+ default: ReturnType<NonNullable<TDefaultFn>>;
783
+ };
784
+ directives: TDirectives;
785
+ } };
786
+ enum: <const TTypeName_1 extends keyof TSchema["enum"] & string, const TModifier extends TypeModifier, const TDefaultFn extends (() => ConstAssignableInputValue<TSchema, {
787
+ kind: "enum";
788
+ name: TTypeName_1;
789
+ modifier: TModifier;
790
+ directives: {};
791
+ defaultValue: null;
792
+ }>) | null = null, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TTypeName_1, TModifier>, extras?: {
793
+ default?: (TDefaultFn & (() => ConstAssignableInputValue<TSchema, {
794
+ kind: "enum";
795
+ name: TTypeName_1;
796
+ modifier: TModifier;
797
+ directives: {};
798
+ defaultValue: null;
799
+ }>)) | (NoInfer<TDefaultFn> extends null ? () => ConstAssignableInputValue<TSchema, {
800
+ kind: "enum";
801
+ name: TTypeName_1;
802
+ modifier: TModifier;
803
+ directives: {};
804
+ defaultValue: null;
805
+ }> : never) | undefined;
806
+ directives?: TDirectives | undefined;
807
+ } | undefined) => { [K in TVarName]: {
808
+ kind: "enum";
809
+ name: TTypeName_1;
810
+ modifier: TModifier;
811
+ defaultValue: TDefaultFn extends null ? null : {
812
+ default: ReturnType<NonNullable<TDefaultFn>>;
813
+ };
814
+ directives: TDirectives;
815
+ } };
816
+ input: <const TTypeName_1 extends keyof TSchema["input"] & string, const TModifier extends TypeModifier, const TDefaultFn extends (() => ConstAssignableInputValue<TSchema, {
817
+ kind: "input";
818
+ name: TTypeName_1;
819
+ modifier: TModifier;
820
+ directives: {};
821
+ defaultValue: null;
822
+ }>) | null = null, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TTypeName_1, TModifier>, extras?: {
823
+ default?: (TDefaultFn & (() => ConstAssignableInputValue<TSchema, {
824
+ kind: "input";
825
+ name: TTypeName_1;
826
+ modifier: TModifier;
827
+ directives: {};
828
+ defaultValue: null;
829
+ }>)) | (NoInfer<TDefaultFn> extends null ? () => ConstAssignableInputValue<TSchema, {
830
+ kind: "input";
831
+ name: TTypeName_1;
832
+ modifier: TModifier;
833
+ directives: {};
834
+ defaultValue: null;
835
+ }> : never) | undefined;
836
+ directives?: TDirectives | undefined;
837
+ } | undefined) => { [K in TVarName]: {
838
+ kind: "input";
839
+ name: TTypeName_1;
840
+ modifier: TModifier;
841
+ defaultValue: TDefaultFn extends null ? null : {
842
+ default: ReturnType<NonNullable<TDefaultFn>>;
843
+ };
844
+ directives: TDirectives;
845
+ } };
846
+ byField: <const TTypeName_1 extends keyof TSchema["object"] & string, const TFieldName extends keyof TSchema["object"][TTypeName_1]["fields"] & string, const TArgName extends keyof TSchema["object"][TTypeName_1]["fields"][TFieldName]["arguments"] & string>(typeName: TTypeName_1, fieldName: TFieldName, argName: TArgName) => TSchema["object"][TTypeName_1]["fields"][TFieldName]["arguments"][TArgName];
847
+ };
848
+ }>;
849
+ //#endregion
850
+ //#region packages/core/src/composer/model.d.ts
851
+ declare const createGqlModelComposers: <TSchema extends AnyGraphqlSchema>(schema: NoInfer<TSchema>) => Omit<{ readonly [TTypeName in keyof TSchema["object"]]: TTypeName extends string ? <TFieldEntries extends AnyFields[], TNormalized extends object, TVarDefinitions extends InputTypeSpecifiers[] = [{}]>(options: {
852
+ variables?: TVarDefinitions | undefined;
853
+ }, builder: FieldsBuilder<TSchema, TTypeName, MergeVarDefinitions<TVarDefinitions>, TFieldEntries>, normalize: (raw: NoInfer<(MergeFields<TFieldEntries> extends infer T_1 extends AnyFields ? { readonly [TAliasName in keyof T_1]: InferField<TSchema_1, T_1[TAliasName]> } : never) extends infer T ? { [K in keyof T]: T[K] } : never>) => TNormalized) => Model<TTypeName, SwitchIfEmpty<MergeVarDefinitions<TVarDefinitions>, void, AssignableInput<TSchema, MergeVarDefinitions<TVarDefinitions>>>, MergeFields<TFieldEntries> & {
854
+ [key: symbol]: never;
855
+ }, ((MergeFields<TFieldEntries> extends infer T_1 extends AnyFields ? { readonly [TAliasName in keyof T_1]: InferField<TSchema_1, T_1[TAliasName]> } : never) extends infer T ? { [K in keyof T]: T[K] } : never) & {
856
+ [key: symbol]: never;
857
+ }, TNormalized> : never }, TSchema["operations"][keyof OperationRoots] & keyof TSchema["object"]>;
858
+ //#endregion
859
+ //#region packages/core/src/composer/projection-path-graph.d.ts
860
+ declare function createPathGraphFromSliceEntries(fragments: {
861
+ [key: string]: AnySlicePayload;
862
+ }): ProjectionPathGraphNode;
863
+ //#endregion
864
+ //#region packages/core/src/composer/slice.d.ts
865
+ declare const createSliceComposerFactory: <TSchema extends AnyGraphqlSchema, TRuntimeAdapter extends AnyGraphqlRuntimeAdapter>(schema: NoInfer<TSchema>) => <TOperationType extends OperationType>(operationType: TOperationType) => <TFieldEntries extends AnyFields[], TProjection extends AnyProjection, TVarDefinitions extends InputTypeSpecifiers[] = [{}]>(options: {
866
+ variables?: TVarDefinitions;
867
+ }, fieldBuilder: FieldsBuilder<TSchema, TSchema["operations"][TOperationType] & keyof TSchema["object"] & string, MergeVarDefinitions<TVarDefinitions>, TFieldEntries>, projectionBuilder: ExecutionResultProjectionsBuilder<TSchema, TRuntimeAdapter, MergeFields<TFieldEntries>, TProjection>) => Slice<TOperationType, SwitchIfEmpty<MergeVarDefinitions<TVarDefinitions>, void, AssignableInput<TSchema, MergeVarDefinitions<TVarDefinitions>>>, MergeFields<TFieldEntries> & {
868
+ [key: symbol]: never;
869
+ }, TProjection>;
870
+ //#endregion
871
+ //#region packages/core/src/composer/var-builder.d.ts
872
+ declare const createVarBuilder: <TSchema extends AnyGraphqlSchema>(schema: TSchema) => {
873
+ $: <TVarName extends string>(varName: TVarName) => {
874
+ scalar: <const TTypeName extends keyof TSchema["scalar"] & string, const TModifier extends TypeModifier, const TDefaultFn extends (() => ConstAssignableInputValue<TSchema, {
875
+ kind: "scalar";
876
+ name: TTypeName;
877
+ modifier: TModifier;
878
+ directives: {};
879
+ defaultValue: null;
880
+ }>) | null = null, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TTypeName, TModifier>, extras?: {
881
+ default?: (TDefaultFn & (() => ConstAssignableInputValue<TSchema, {
882
+ kind: "scalar";
883
+ name: TTypeName;
884
+ modifier: TModifier;
885
+ directives: {};
886
+ defaultValue: null;
887
+ }>)) | (NoInfer<TDefaultFn> extends null ? () => ConstAssignableInputValue<TSchema, {
888
+ kind: "scalar";
889
+ name: TTypeName;
890
+ modifier: TModifier;
891
+ directives: {};
892
+ defaultValue: null;
893
+ }> : never) | undefined;
894
+ directives?: TDirectives | undefined;
895
+ } | undefined) => { [K in TVarName]: {
896
+ kind: "scalar";
897
+ name: TTypeName;
898
+ modifier: TModifier;
899
+ defaultValue: TDefaultFn extends null ? null : {
900
+ default: ReturnType<NonNullable<TDefaultFn>>;
901
+ };
902
+ directives: TDirectives;
903
+ } };
904
+ enum: <const TTypeName extends keyof TSchema["enum"] & string, const TModifier extends TypeModifier, const TDefaultFn extends (() => ConstAssignableInputValue<TSchema, {
905
+ kind: "enum";
906
+ name: TTypeName;
907
+ modifier: TModifier;
908
+ directives: {};
909
+ defaultValue: null;
910
+ }>) | null = null, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TTypeName, TModifier>, extras?: {
911
+ default?: (TDefaultFn & (() => ConstAssignableInputValue<TSchema, {
912
+ kind: "enum";
913
+ name: TTypeName;
914
+ modifier: TModifier;
915
+ directives: {};
916
+ defaultValue: null;
917
+ }>)) | (NoInfer<TDefaultFn> extends null ? () => ConstAssignableInputValue<TSchema, {
918
+ kind: "enum";
919
+ name: TTypeName;
920
+ modifier: TModifier;
921
+ directives: {};
922
+ defaultValue: null;
923
+ }> : never) | undefined;
924
+ directives?: TDirectives | undefined;
925
+ } | undefined) => { [K in TVarName]: {
926
+ kind: "enum";
927
+ name: TTypeName;
928
+ modifier: TModifier;
929
+ defaultValue: TDefaultFn extends null ? null : {
930
+ default: ReturnType<NonNullable<TDefaultFn>>;
931
+ };
932
+ directives: TDirectives;
933
+ } };
934
+ input: <const TTypeName extends keyof TSchema["input"] & string, const TModifier extends TypeModifier, const TDefaultFn extends (() => ConstAssignableInputValue<TSchema, {
935
+ kind: "input";
936
+ name: TTypeName;
937
+ modifier: TModifier;
938
+ directives: {};
939
+ defaultValue: null;
940
+ }>) | null = null, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TTypeName, TModifier>, extras?: {
941
+ default?: (TDefaultFn & (() => ConstAssignableInputValue<TSchema, {
942
+ kind: "input";
943
+ name: TTypeName;
944
+ modifier: TModifier;
945
+ directives: {};
946
+ defaultValue: null;
947
+ }>)) | (NoInfer<TDefaultFn> extends null ? () => ConstAssignableInputValue<TSchema, {
948
+ kind: "input";
949
+ name: TTypeName;
950
+ modifier: TModifier;
951
+ directives: {};
952
+ defaultValue: null;
953
+ }> : never) | undefined;
954
+ directives?: TDirectives | undefined;
955
+ } | undefined) => { [K in TVarName]: {
956
+ kind: "input";
957
+ name: TTypeName;
958
+ modifier: TModifier;
959
+ defaultValue: TDefaultFn extends null ? null : {
960
+ default: ReturnType<NonNullable<TDefaultFn>>;
961
+ };
962
+ directives: TDirectives;
963
+ } };
964
+ byField: <const TTypeName extends keyof TSchema["object"] & string, const TFieldName extends keyof TSchema["object"][TTypeName]["fields"] & string, const TArgName extends keyof TSchema["object"][TTypeName]["fields"][TFieldName]["arguments"] & string>(typeName: TTypeName, fieldName: TFieldName, argName: TArgName) => TSchema["object"][TTypeName]["fields"][TFieldName]["arguments"][TArgName];
965
+ };
966
+ };
967
+ //#endregion
968
+ //#region packages/core/src/schema/schema-builder.d.ts
969
+ declare const defineScalar: <const TName extends string, TInput, TOutput, TDirectives extends AnyConstDirectiveAttachments>(name: TName, definition: (tool: {
970
+ type: typeof hidden;
971
+ }) => {
972
+ input: Hidden<TInput>;
973
+ output: Hidden<TOutput>;
974
+ directives: TDirectives;
975
+ }) => { [K in TName]: {
976
+ _type: Hidden<{
977
+ input: TInput;
978
+ output: TOutput;
979
+ }>;
980
+ name: TName;
981
+ directives: TDirectives;
982
+ } };
983
+ declare const define: <const TName extends string>(name: TName) => {
984
+ enum: <const TValues extends EnumDefinition<string>["values"], TDirectives extends AnyConstDirectiveAttachments>(values: TValues, directives: TDirectives) => {
985
+ _type: () => keyof TValues & string;
986
+ name: TName;
987
+ values: TValues;
988
+ directives: TDirectives;
989
+ };
990
+ input: <TFields extends InputDefinition["fields"], TDirectives_1 extends AnyConstDirectiveAttachments>(fields: TFields, directives: TDirectives_1) => {
991
+ name: TName;
992
+ fields: TFields;
993
+ directives: TDirectives_1;
994
+ };
995
+ object: <TFields extends ObjectDefinition["fields"], TDirectives_2 extends AnyConstDirectiveAttachments>(fields: TFields, directives: TDirectives_2) => {
996
+ name: TName;
997
+ fields: {
998
+ __typename: {
999
+ kind: "typename";
1000
+ name: `${TName}`;
1001
+ modifier: "!";
1002
+ arguments: {};
1003
+ directives: AnyConstDirectiveAttachments;
1004
+ };
1005
+ } & TFields;
1006
+ directives: TDirectives_2;
1007
+ };
1008
+ union: <TTypes extends UnionDefinition["types"], TDirectives_3 extends AnyConstDirectiveAttachments>(types: TTypes, directives: TDirectives_3) => {
1009
+ name: TName;
1010
+ types: TTypes;
1011
+ directives: TDirectives_3;
1012
+ };
1013
+ };
1014
+ declare const defineOperationRoots: <const TOperationRoots extends OperationRoots>(operationRoots: TOperationRoots) => TOperationRoots;
1015
+ //#endregion
1016
+ //#region packages/core/src/schema/type-specifier-builder.d.ts
1017
+ declare const unsafeInputType: {
1018
+ scalar: <const TName extends string, const TModifier extends TypeModifier, const TDefaultFactory extends (() => ConstValue) | null = null, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TName, TModifier>, extras: {
1019
+ default?: TDefaultFactory | undefined;
1020
+ directives?: TDirectives | undefined;
1021
+ }) => {
1022
+ kind: "scalar";
1023
+ name: TName;
1024
+ modifier: TModifier;
1025
+ defaultValue: TDefaultFactory extends null ? null : {
1026
+ default: ReturnType<NonNullable<TDefaultFactory>>;
1027
+ };
1028
+ directives: TDirectives;
1029
+ };
1030
+ enum: <const TName extends string, const TModifier extends TypeModifier, const TDefaultFactory extends (() => ConstValue) | null = null, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TName, TModifier>, extras: {
1031
+ default?: TDefaultFactory | undefined;
1032
+ directives?: TDirectives | undefined;
1033
+ }) => {
1034
+ kind: "enum";
1035
+ name: TName;
1036
+ modifier: TModifier;
1037
+ defaultValue: TDefaultFactory extends null ? null : {
1038
+ default: ReturnType<NonNullable<TDefaultFactory>>;
1039
+ };
1040
+ directives: TDirectives;
1041
+ };
1042
+ input: <const TName extends string, const TModifier extends TypeModifier, const TDefaultFactory extends (() => ConstValue) | null = null, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TName, TModifier>, extras: {
1043
+ default?: TDefaultFactory | undefined;
1044
+ directives?: TDirectives | undefined;
1045
+ }) => {
1046
+ kind: "input";
1047
+ name: TName;
1048
+ modifier: TModifier;
1049
+ defaultValue: TDefaultFactory extends null ? null : {
1050
+ default: ReturnType<NonNullable<TDefaultFactory>>;
1051
+ };
1052
+ directives: TDirectives;
1053
+ };
1054
+ };
1055
+ declare const unsafeOutputType: {
1056
+ scalar: <const TName extends string, const TModifier extends TypeModifier, const TArguments extends InputTypeSpecifiers = {}, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TName, TModifier>, extras: {
1057
+ arguments?: TArguments | undefined;
1058
+ directives?: TDirectives | undefined;
1059
+ }) => {
1060
+ kind: "scalar";
1061
+ name: TName;
1062
+ modifier: TModifier;
1063
+ arguments: InputTypeSpecifiers extends TArguments ? {} : TArguments;
1064
+ directives: TDirectives;
1065
+ };
1066
+ enum: <const TName extends string, const TModifier extends TypeModifier, const TArguments extends InputTypeSpecifiers = {}, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TName, TModifier>, extras: {
1067
+ arguments?: TArguments | undefined;
1068
+ directives?: TDirectives | undefined;
1069
+ }) => {
1070
+ kind: "enum";
1071
+ name: TName;
1072
+ modifier: TModifier;
1073
+ arguments: InputTypeSpecifiers extends TArguments ? {} : TArguments;
1074
+ directives: TDirectives;
1075
+ };
1076
+ object: <const TName extends string, const TModifier extends TypeModifier, const TArguments extends InputTypeSpecifiers = {}, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TName, TModifier>, extras: {
1077
+ arguments?: TArguments | undefined;
1078
+ directives?: TDirectives | undefined;
1079
+ }) => {
1080
+ kind: "object";
1081
+ name: TName;
1082
+ modifier: TModifier;
1083
+ arguments: InputTypeSpecifiers extends TArguments ? {} : TArguments;
1084
+ directives: TDirectives;
1085
+ };
1086
+ union: <const TName extends string, const TModifier extends TypeModifier, const TArguments extends InputTypeSpecifiers = {}, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TName, TModifier>, extras: {
1087
+ arguments?: TArguments | undefined;
1088
+ directives?: TDirectives | undefined;
1089
+ }) => {
1090
+ kind: "union";
1091
+ name: TName;
1092
+ modifier: TModifier;
1093
+ arguments: InputTypeSpecifiers extends TArguments ? {} : TArguments;
1094
+ directives: TDirectives;
1095
+ };
1096
+ typename: <const TName extends string, const TModifier extends TypeModifier, const TArguments extends InputTypeSpecifiers = {}, const TDirectives extends AnyConstDirectiveAttachments = {}>(type: ModifiedTypeName<string, TName, TModifier>, extras: {
1097
+ arguments?: TArguments | undefined;
1098
+ directives?: TDirectives | undefined;
1099
+ }) => {
1100
+ kind: "typename";
1101
+ name: TName;
1102
+ modifier: TModifier;
1103
+ arguments: InputTypeSpecifiers extends TArguments ? {} : TArguments;
1104
+ directives: TDirectives;
1105
+ };
1106
+ };
1107
+ //#endregion
1108
+ //#region packages/core/src/utils/wrap-by-key.d.ts
1109
+ declare const wrapByKey: <TName extends string, TValue>(name: TName, value: TValue) => { [K in TName]: TValue };
1110
+ //#endregion
1111
+ export { AbstractFieldSelection, AnyAssignableInput, AnyAssignableInputValue, AnyComposedOperation, AnyComposedOperationOf, AnyConstAssignableInput, AnyConstAssignableInputValue, AnyConstDirectiveAttachments, AnyDefaultValue, AnyDirectiveAttachments, AnyExecutionResultProjectionsBuilder, AnyFieldName, AnyFieldPath, AnyFieldSelection, AnyFieldSelectionFactory, AnyFieldSelectionFactoryReturn, AnyFields, AnyGraphqlRuntimeAdapter, AnyGraphqlSchema, AnyInlineOperation, AnyInlineOperationOf, AnyModel, AnyNestedObject, AnyNestedUnion, AnyProjection, AnySlice, AnySliceOf, AnySlicePayload, AnySlicePayloads, AnySlicedExecutionResult, AnySlicedExecutionResultRecord, AnyTypeModifier, AnyTypeName, AnyTypeSpecifier, AnyVarRef, ApplyTypeModifier, ApplyTypeModifierToKeys, AssignableInput, AssignableInputByFieldName, AssignableInputValue, AvailableFieldPathOf, ComposedOperation, ComposedOperationDefinitionBuilder, ConcatSlicePayloads, ConstAssignableInput, ConstAssignableInputValue, ConstValue, ConstValues, EmptyObject, EmptyResult, EnumDefinition, ExecutionResultProjectionsBuilder, FieldSelectionFactories, FieldSelectionFactory, FieldSelectionFactoryFieldArguments, FieldSelectionFactoryObjectReturn, FieldSelectionFactoryPrimitiveReturn, FieldSelectionFactoryReturn, FieldSelectionFactoryUnionReturn, FieldSelectionTemplateOf, FieldsBuilder, FieldsBuilderTools, GqlElement, GqlElementComposer, GqlElementContext, GqlElementDefinitionFactory, GraphqlExecutionResult, Hidden, IfEmpty, InferByFieldPath, InferComposedOperationRawData, InferExecutionResultProjection, InferField, InferFields, InferInputTypeRef, InferOutputOfSlice, InferOutputTypeRef, InlineOperation, InputDefinition, InputEnumSpecifier, InputFieldRecord, InputInferrableTypeSpecifier, InputInputObjectSpecifier, InputScalarSpecifier, InputTypeKind, InputTypeSpecifier, InputTypeSpecifiers, ListTypeModifierSuffix, MergeFields, MergeVarDefinitions, Model, ModifiedTypeName, NestedObjectFieldsBuilder, NestedObjectFieldsBuilderTools, NestedUnionFieldsBuilder, NonGraphqlErrorResult, NormalizedError, NormalizedExecutionResult, ObjectDefinition, ObjectFieldRecord, OperationRoots, OperationType, OutputEnumSpecifier, OutputInferrableTypeSpecifier, OutputObjectSpecifier, OutputScalarSpecifier, OutputTypeKind, OutputTypeSpecifier, OutputTypeSpecifiers, OutputTypenameSpecifier, OutputUnionSpecifier, PickTypeSpecifierByFieldName, Prettify, Projection, ProjectionPath, ProjectionPathGraphNode, SafeUnwrapResult, ScalarDefinition, Slice, SlicePayload, SlicedExecutionResult, SlicedExecutionResultEmpty, SlicedExecutionResultError, SlicedExecutionResultSuccess, StripFunctions, StripSymbols, StripTailingListFromTypeModifier, StripTailingListFromTypeSpecifier, SwitchIfEmpty, Tuple, TypeModifier, UnionDefinition, UnionMemberName, UnionToIntersection, UnionTypeRecord, VarRef, VarRefBy, buildArgumentValue, buildConstValueNode, buildDocument, buildOperationTypeNode, buildWithTypeModifier, createComposedOperationComposerFactory, createFieldFactories, createGqlElementComposer, createGqlModelComposers, createPathGraphFromSliceEntries, createSliceComposerFactory, createVarAssignments, createVarBuilder, createVarRefs, define, defineOperationRoots, defineScalar, empty, hidden, mergeFields, mergeVarDefinitions, parseModifiedTypeName, prettify, unsafeInputType, unsafeOutputType, wrapByKey };
1112
+ //# sourceMappingURL=index-DiEkx8-6.d.ts.map