@soda-gql/core 0.10.2 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{index-Cbo0WJHs.d.ts → index-BcA2XPEk.d.ts} +175 -224
- package/dist/index-BcA2XPEk.d.ts.map +1 -0
- package/dist/index-Bj60NxMb.d.cts.map +1 -1
- package/dist/{index-gHe-Lwi7.d.cts → index-CatAewXz.d.cts} +175 -224
- package/dist/index-CatAewXz.d.cts.map +1 -0
- package/dist/index-DbANHktR.d.ts.map +1 -1
- package/dist/index.cjs +86 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +87 -87
- package/dist/index.js.map +1 -1
- package/dist/runtime.d.cts +1 -1
- package/dist/runtime.d.cts.map +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/index-Cbo0WJHs.d.ts.map +0 -1
- package/dist/index-gHe-Lwi7.d.cts.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as InputInferrableTypeSpecifier, A as InputDefinition, At as ConstValue, B as UnionMemberName, C as AnyFieldName, Ct as DecrementDepth, D as InferInputKind, Dt as InputDepthOverrides, E as EnumDefinition, Et as GetInputTypeDepth, F as OperationType, Ft as getCurrentFieldPath, G as NestedValueElement, H as AnyVarRef, I as PickTypeSpecifierByFieldName, It as isListType, J as createVarRefFromNestedValue, K as VarRef, L as ResolveInputProfileFromMeta, Lt as withFieldPath, M as ObjectDefinition, Mt as FieldPath, N as ObjectFieldRecord, Nt as FieldPathSegment, O as InferInputProfile, Ot as IsDepthExhausted, P as OperationRoots, Pt as appendToPath, Q as InputEnumSpecifier, R as ScalarDefinition, S as AllInputTypeNames, St as ValidTypeModifier, T as AnyTypeName, Tt as DepthCounter, U as AnyVarRefBrand, V as UnionTypeRecord, W as NestedValue, X as AnyDefaultValue, Y as createVarRefFromVariable, Z as AnyTypeSpecifier, _ as FragmentMetadataBuilder, _t as PrimitiveTypeProfile, a as DefaultMetadataAdapter, at as OutputEnumSpecifier, b as MetadataBuilderTools, bt as GetSignature, c as ExtractAdapterTypes, ct as OutputScalarSpecifier, d as MetadataAdapter, dt as OutputTypeSpecifiers, et as InputInputObjectSpecifier, f as OperationDocumentTransformArgs, ft as OutputTypenameSpecifier, g as ExtractMetadata, gt as ObjectTypeProfile, h as defaultMetadataAdapter, ht as GetModifiedType, i as DefaultAdapter, it as InputTypeSpecifiers, j as InputFieldRecord, jt as ConstValues, k as InferOutputProfile, kt as NumberToDepth, l as ExtractUnifiedAdapterTypes, lt as OutputTypeKind, m as createDefaultAdapter, mt as GetConstAssignableType, n as AnyAdapter, nt as InputTypeKind, o as DocumentTransformArgs, ot as OutputInferrableTypeSpecifier, p as OperationDocumentTransformer, pt as OutputUnionSpecifier, q as VarRefInner, r as AnyMetadataAdapter, rt as InputTypeSpecifier, s as DocumentTransformer, st as OutputObjectSpecifier, t as Adapter, tt as InputScalarSpecifier, u as FragmentMetaInfo, ut as OutputTypeSpecifier, v as FragmentMetadataBuilderTools, vt as TypeProfile, w as AnyGraphqlSchema, wt as DefaultDepth, x as OperationMetadata, xt as TypeModifier, y as MetadataBuilder, yt as ApplyTypeModifier, z as UnionDefinition } from "./index-Bj60NxMb.cjs";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as AnyOperation, $t as buildOperationTypeNode, A as GqlElementComposer, At as AttachmentToProperty, B as VarBuilderMethods, Bt as isDirectiveRef, C as getScalarInputType, Cn as AnyDirectiveRef, Ct as NestedUnionFieldsBuilder, D as AnyGqlContext, Dn as DirectiveRefInner, Dt as SwitchIfOmittable, E as createOperationComposerFactory, En as DirectiveRef, Et as OptionalArg, F as InputTypeMethods, Ft as DirectiveMethod, G as FragmentUsageRecord, Gt as StripFunctions, H as createVarBuilder, Ht as ColocatedEntries, I as ResolveTypeFromMeta, It as StandardDirectives, J as FragmentBuilderFor, Jt as UnionToIntersection, K as recordFragmentUsage, Kt as StripSymbols, L as SchemaAwareGetNameAt, Lt as createDirectiveBuilder, M as GqlElementComposerWithSchema, Mt as AnyDirectiveMethod, N as createGqlElementComposer, Nt as DirectiveArgValue, O as ExtractMetadataAdapter, Ot as empty, P as InputTypeMethod, Pt as DirectiveBuilder, Q as createFieldFactories, Qt as buildDocument, R as SchemaAwareGetValueAt, Rt as createDirectiveMethod, S as getEnumType, Sn as GetAssignableType, St as NestedObjectFieldsBuilderTools, T as graphqlTypeToTypeScript, Tn as DirectiveLocation, Tt as IfOmittable, U as createVarMethod, Ut as ColocatedFields, V as VarSpecifier, Vt as ColocateHelper, W as createVarMethodFactory, Wt as createColocateHelper, X as createVarAssignments, Xt as buildArgumentValue, Y as createGqlFragmentComposers, Yt as EnumLookup, Z as createVarRefs, Zt as buildConstValueNode, _ as calculateFieldType, _n as AnyConstDirectiveAttachments, _t as FieldSelectionFactoryReturn, a as HasPrebuiltFragment, an as AnyNestedUnion, at as FragmentInferMeta, b as generateInputType, bn as ConstAssignableInput, bt as FieldsBuilderTools, c as PrebuiltFragmentInput, cn as InferFields, ct as GqlElementContext, d as PrebuiltOperationOutput, dn as AnyAssignableInputValue, dt as AnyFieldSelectionFactoryReturn, en as buildWithTypeModifier, et as AnyOperationOf, f as PrebuiltTypeRegistry, fn as AnyAssigningInput, ft as FieldSelectionFactories, g as applyTypeModifier, gn as FieldArgumentValue, gt as FieldSelectionFactoryPrimitiveReturn, h as TypeFormatters, hn as DeclaredVariables, ht as FieldSelectionFactoryObjectReturn, i as EmptyPrebuiltTypeRegistry, in as AnyNestedObject, it as Fragment, j as GqlElementComposerOptions, jt as AttachmentsTupleToIntersection, k as FragmentBuildersAll, kt as AttachmentShape, l as PrebuiltFragmentOutput, ln as AnyDirectiveAttachments, lt as GqlElementDefinitionFactory, m as GenerateInputObjectTypeOptions, mn as AssignableInputByFieldName, mt as FieldSelectionFactoryFieldArguments, n as Hidden, nn as AnyFieldSelection, nt as OperationInferMeta, o as HasPrebuiltOperation, on as FieldSelectionTemplateOf, ot as GqlElement, p as PrebuiltUnknownElement, pn as AssignableInput, pt as FieldSelectionFactory, q as withFragmentUsageCollection, qt as Tuple, r as hidden, rn as AnyFields, rt as AnyFragment, s as PrebuiltEntryNotFound, sn as InferField, st as GqlElementAttachment, t as wrapByKey, tn as AbstractFieldSelection, tt as Operation, u as PrebuiltOperationInput, un as AnyAssignableInput, ut as AnyFieldSelectionFactory, v as calculateFieldsType, vn as AnyConstAssignableInput, vt as FieldSelectionFactoryUnionReturn, w as getScalarOutputType, wn as AnyDirectiveRefBrand, wt as EmptyObject, x as generateInputTypeFromSpecifiers, xn as ConstAssignableInputValue, xt as NestedObjectFieldsBuilder, y as generateInputObjectType, yn as AnyConstAssignableInputValue, yt as FieldsBuilder, z as VarBuilder, zt as createStandardDirectives } from "./index-CatAewXz.cjs";
|
|
3
3
|
import { n as defineOperationRoots, r as defineScalar, t as defineEnum } from "./schema-builder-YC3vPw7X.cjs";
|
|
4
4
|
|
|
5
5
|
//#region packages/core/src/types/type-foundation/modified-type-name.d.ts
|
|
@@ -11,5 +11,5 @@ declare function parseModifiedTypeName<TNameCandidate extends [string], TName ex
|
|
|
11
11
|
modifier: TModifier;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
|
-
export { AbstractFieldSelection, Adapter, AllInputTypeNames, AnyAdapter, AnyAssignableInput, AnyAssignableInputValue, AnyAssigningInput, AnyConstAssignableInput, AnyConstAssignableInputValue, AnyConstDirectiveAttachments, AnyDefaultValue, AnyDirectiveAttachments, AnyDirectiveMethod, AnyDirectiveRef, AnyDirectiveRefBrand, AnyFieldName, AnyFieldSelection, AnyFieldSelectionFactory, AnyFieldSelectionFactoryReturn, AnyFields, AnyFragment, AnyGqlContext, AnyGraphqlSchema, AnyMetadataAdapter, AnyNestedObject, AnyNestedUnion, AnyOperation, AnyOperationOf, AnyTypeName, AnyTypeSpecifier, AnyVarRef, AnyVarRefBrand, ApplyTypeModifier, AssignableInput, AssignableInputByFieldName, AttachmentShape, AttachmentToProperty, AttachmentsTupleToIntersection, ColocateHelper, ColocatedEntries, ColocatedFields, ConstAssignableInput, ConstAssignableInputValue, ConstValue, ConstValues, DeclaredVariables, DecrementDepth, DefaultAdapter, DefaultDepth, DefaultMetadataAdapter, DepthCounter, DirectiveArgValue, DirectiveBuilder, DirectiveLocation, DirectiveMethod, DirectiveRef, DirectiveRefInner, DocumentTransformArgs, DocumentTransformer, EmptyObject, EmptyPrebuiltTypeRegistry, EnumDefinition, ExtractAdapterTypes, ExtractMetadata, ExtractMetadataAdapter, ExtractUnifiedAdapterTypes, FieldArgumentValue, FieldPath, FieldPathSegment, FieldSelectionFactories, FieldSelectionFactory, FieldSelectionFactoryFieldArguments, FieldSelectionFactoryObjectReturn, FieldSelectionFactoryPrimitiveReturn, FieldSelectionFactoryReturn, FieldSelectionFactoryUnionReturn, FieldSelectionTemplateOf, FieldsBuilder, FieldsBuilderTools, Fragment, FragmentBuilderFor, FragmentBuildersAll, FragmentInferMeta, FragmentMetaInfo, FragmentMetadataBuilder, FragmentMetadataBuilderTools, FragmentUsageRecord, GenerateInputObjectTypeOptions, GetAssignableType, GetConstAssignableType, GetInputTypeDepth, GetModifiedType, GetSignature, GqlElement, GqlElementAttachment, GqlElementComposer, GqlElementComposerOptions, GqlElementComposerWithSchema, GqlElementContext, GqlElementDefinitionFactory, HasPrebuiltFragment, HasPrebuiltOperation, Hidden, IfOmittable, InferField, InferFields, InferInputKind, InferInputProfile, InferOutputProfile, InputDefinition, InputDepthOverrides, InputEnumSpecifier, InputFieldRecord, InputInferrableTypeSpecifier, InputInputObjectSpecifier, InputScalarSpecifier, InputTypeKind, InputTypeMethod, InputTypeMethods, InputTypeSpecifier, InputTypeSpecifiers, IsDepthExhausted, MetadataAdapter, MetadataBuilder, MetadataBuilderTools, ModifiedTypeName, NestedObjectFieldsBuilder, NestedObjectFieldsBuilderTools, NestedUnionFieldsBuilder, NestedValue, NestedValueElement, NumberToDepth, ObjectDefinition, ObjectFieldRecord, ObjectTypeProfile, Operation, OperationDocumentTransformArgs, OperationDocumentTransformer, OperationInferMeta, OperationMetadata, OperationRoots, OperationType, OptionalArg, OutputEnumSpecifier, OutputInferrableTypeSpecifier, OutputObjectSpecifier, OutputScalarSpecifier, OutputTypeKind, OutputTypeSpecifier, OutputTypeSpecifiers, OutputTypenameSpecifier, OutputUnionSpecifier, PickTypeSpecifierByFieldName, PrebuiltEntryNotFound, PrebuiltFragmentInput, PrebuiltFragmentOutput,
|
|
14
|
+
export { AbstractFieldSelection, Adapter, AllInputTypeNames, AnyAdapter, AnyAssignableInput, AnyAssignableInputValue, AnyAssigningInput, AnyConstAssignableInput, AnyConstAssignableInputValue, AnyConstDirectiveAttachments, AnyDefaultValue, AnyDirectiveAttachments, AnyDirectiveMethod, AnyDirectiveRef, AnyDirectiveRefBrand, AnyFieldName, AnyFieldSelection, AnyFieldSelectionFactory, AnyFieldSelectionFactoryReturn, AnyFields, AnyFragment, AnyGqlContext, AnyGraphqlSchema, AnyMetadataAdapter, AnyNestedObject, AnyNestedUnion, AnyOperation, AnyOperationOf, AnyTypeName, AnyTypeSpecifier, AnyVarRef, AnyVarRefBrand, ApplyTypeModifier, AssignableInput, AssignableInputByFieldName, AttachmentShape, AttachmentToProperty, AttachmentsTupleToIntersection, ColocateHelper, ColocatedEntries, ColocatedFields, ConstAssignableInput, ConstAssignableInputValue, ConstValue, ConstValues, DeclaredVariables, DecrementDepth, DefaultAdapter, DefaultDepth, DefaultMetadataAdapter, DepthCounter, DirectiveArgValue, DirectiveBuilder, DirectiveLocation, DirectiveMethod, DirectiveRef, DirectiveRefInner, DocumentTransformArgs, DocumentTransformer, EmptyObject, EmptyPrebuiltTypeRegistry, EnumDefinition, EnumLookup, ExtractAdapterTypes, ExtractMetadata, ExtractMetadataAdapter, ExtractUnifiedAdapterTypes, FieldArgumentValue, FieldPath, FieldPathSegment, FieldSelectionFactories, FieldSelectionFactory, FieldSelectionFactoryFieldArguments, FieldSelectionFactoryObjectReturn, FieldSelectionFactoryPrimitiveReturn, FieldSelectionFactoryReturn, FieldSelectionFactoryUnionReturn, FieldSelectionTemplateOf, FieldsBuilder, FieldsBuilderTools, Fragment, FragmentBuilderFor, FragmentBuildersAll, FragmentInferMeta, FragmentMetaInfo, FragmentMetadataBuilder, FragmentMetadataBuilderTools, FragmentUsageRecord, GenerateInputObjectTypeOptions, GetAssignableType, GetConstAssignableType, GetInputTypeDepth, GetModifiedType, GetSignature, GqlElement, GqlElementAttachment, GqlElementComposer, GqlElementComposerOptions, GqlElementComposerWithSchema, GqlElementContext, GqlElementDefinitionFactory, HasPrebuiltFragment, HasPrebuiltOperation, Hidden, IfOmittable, InferField, InferFields, InferInputKind, InferInputProfile, InferOutputProfile, InputDefinition, InputDepthOverrides, InputEnumSpecifier, InputFieldRecord, InputInferrableTypeSpecifier, InputInputObjectSpecifier, InputScalarSpecifier, InputTypeKind, InputTypeMethod, InputTypeMethods, InputTypeSpecifier, InputTypeSpecifiers, IsDepthExhausted, MetadataAdapter, MetadataBuilder, MetadataBuilderTools, ModifiedTypeName, NestedObjectFieldsBuilder, NestedObjectFieldsBuilderTools, NestedUnionFieldsBuilder, NestedValue, NestedValueElement, NumberToDepth, ObjectDefinition, ObjectFieldRecord, ObjectTypeProfile, Operation, OperationDocumentTransformArgs, OperationDocumentTransformer, OperationInferMeta, OperationMetadata, OperationRoots, OperationType, OptionalArg, OutputEnumSpecifier, OutputInferrableTypeSpecifier, OutputObjectSpecifier, OutputScalarSpecifier, OutputTypeKind, OutputTypeSpecifier, OutputTypeSpecifiers, OutputTypenameSpecifier, OutputUnionSpecifier, PickTypeSpecifierByFieldName, PrebuiltEntryNotFound, PrebuiltFragmentInput, PrebuiltFragmentOutput, PrebuiltOperationInput, PrebuiltOperationOutput, PrebuiltTypeRegistry, PrebuiltUnknownElement, PrimitiveTypeProfile, ResolveInputProfileFromMeta, ResolveTypeFromMeta, ScalarDefinition, SchemaAwareGetNameAt, SchemaAwareGetValueAt, StandardDirectives, StripFunctions, StripSymbols, SwitchIfOmittable, Tuple, TypeFormatters, TypeModifier, TypeProfile, UnionDefinition, UnionMemberName, UnionToIntersection, UnionTypeRecord, ValidTypeModifier, VarBuilder, VarBuilderMethods, VarRef, VarRefInner, VarSpecifier, appendToPath, applyTypeModifier, buildArgumentValue, buildConstValueNode, buildDocument, buildOperationTypeNode, buildWithTypeModifier, calculateFieldType, calculateFieldsType, createColocateHelper, createDefaultAdapter, createDirectiveBuilder, createDirectiveMethod, createFieldFactories, createGqlElementComposer, createGqlFragmentComposers, createOperationComposerFactory, createStandardDirectives, createVarAssignments, createVarBuilder, createVarMethod, createVarMethodFactory, createVarRefFromNestedValue, createVarRefFromVariable, createVarRefs, defaultMetadataAdapter, defineEnum, defineOperationRoots, defineScalar, empty, generateInputObjectType, generateInputType, generateInputTypeFromSpecifiers, getCurrentFieldPath, getEnumType, getScalarInputType, getScalarOutputType, graphqlTypeToTypeScript, hidden, isDirectiveRef, isListType, parseModifiedTypeName, recordFragmentUsage, withFieldPath, withFragmentUsageCollection, wrapByKey };
|
|
15
15
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as InputInferrableTypeSpecifier, A as InputDefinition, At as ConstValue, B as UnionMemberName, C as AnyFieldName, Ct as DecrementDepth, D as InferInputKind, Dt as InputDepthOverrides, E as EnumDefinition, Et as GetInputTypeDepth, F as OperationType, Ft as getCurrentFieldPath, G as NestedValueElement, H as AnyVarRef, I as PickTypeSpecifierByFieldName, It as isListType, J as createVarRefFromNestedValue, K as VarRef, L as ResolveInputProfileFromMeta, Lt as withFieldPath, M as ObjectDefinition, Mt as FieldPath, N as ObjectFieldRecord, Nt as FieldPathSegment, O as InferInputProfile, Ot as IsDepthExhausted, P as OperationRoots, Pt as appendToPath, Q as InputEnumSpecifier, R as ScalarDefinition, S as AllInputTypeNames, St as ValidTypeModifier, T as AnyTypeName, Tt as DepthCounter, U as AnyVarRefBrand, V as UnionTypeRecord, W as NestedValue, X as AnyDefaultValue, Y as createVarRefFromVariable, Z as AnyTypeSpecifier, _ as FragmentMetadataBuilder, _t as PrimitiveTypeProfile, a as DefaultMetadataAdapter, at as OutputEnumSpecifier, b as MetadataBuilderTools, bt as GetSignature, c as ExtractAdapterTypes, ct as OutputScalarSpecifier, d as MetadataAdapter, dt as OutputTypeSpecifiers, et as InputInputObjectSpecifier, f as OperationDocumentTransformArgs, ft as OutputTypenameSpecifier, g as ExtractMetadata, gt as ObjectTypeProfile, h as defaultMetadataAdapter, ht as GetModifiedType, i as DefaultAdapter, it as InputTypeSpecifiers, j as InputFieldRecord, jt as ConstValues, k as InferOutputProfile, kt as NumberToDepth, l as ExtractUnifiedAdapterTypes, lt as OutputTypeKind, m as createDefaultAdapter, mt as GetConstAssignableType, n as AnyAdapter, nt as InputTypeKind, o as DocumentTransformArgs, ot as OutputInferrableTypeSpecifier, p as OperationDocumentTransformer, pt as OutputUnionSpecifier, q as VarRefInner, r as AnyMetadataAdapter, rt as InputTypeSpecifier, s as DocumentTransformer, st as OutputObjectSpecifier, t as Adapter, tt as InputScalarSpecifier, u as FragmentMetaInfo, ut as OutputTypeSpecifier, v as FragmentMetadataBuilderTools, vt as TypeProfile, w as AnyGraphqlSchema, wt as DefaultDepth, x as OperationMetadata, xt as TypeModifier, y as MetadataBuilder, yt as ApplyTypeModifier, z as UnionDefinition } from "./index-DbANHktR.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as AnyOperation, $t as buildOperationTypeNode, A as GqlElementComposer, At as AttachmentToProperty, B as VarBuilderMethods, Bt as isDirectiveRef, C as getScalarInputType, Cn as AnyDirectiveRef, Ct as NestedUnionFieldsBuilder, D as AnyGqlContext, Dn as DirectiveRefInner, Dt as SwitchIfOmittable, E as createOperationComposerFactory, En as DirectiveRef, Et as OptionalArg, F as InputTypeMethods, Ft as DirectiveMethod, G as FragmentUsageRecord, Gt as StripFunctions, H as createVarBuilder, Ht as ColocatedEntries, I as ResolveTypeFromMeta, It as StandardDirectives, J as FragmentBuilderFor, Jt as UnionToIntersection, K as recordFragmentUsage, Kt as StripSymbols, L as SchemaAwareGetNameAt, Lt as createDirectiveBuilder, M as GqlElementComposerWithSchema, Mt as AnyDirectiveMethod, N as createGqlElementComposer, Nt as DirectiveArgValue, O as ExtractMetadataAdapter, Ot as empty, P as InputTypeMethod, Pt as DirectiveBuilder, Q as createFieldFactories, Qt as buildDocument, R as SchemaAwareGetValueAt, Rt as createDirectiveMethod, S as getEnumType, Sn as GetAssignableType, St as NestedObjectFieldsBuilderTools, T as graphqlTypeToTypeScript, Tn as DirectiveLocation, Tt as IfOmittable, U as createVarMethod, Ut as ColocatedFields, V as VarSpecifier, Vt as ColocateHelper, W as createVarMethodFactory, Wt as createColocateHelper, X as createVarAssignments, Xt as buildArgumentValue, Y as createGqlFragmentComposers, Yt as EnumLookup, Z as createVarRefs, Zt as buildConstValueNode, _ as calculateFieldType, _n as AnyConstDirectiveAttachments, _t as FieldSelectionFactoryReturn, a as HasPrebuiltFragment, an as AnyNestedUnion, at as FragmentInferMeta, b as generateInputType, bn as ConstAssignableInput, bt as FieldsBuilderTools, c as PrebuiltFragmentInput, cn as InferFields, ct as GqlElementContext, d as PrebuiltOperationOutput, dn as AnyAssignableInputValue, dt as AnyFieldSelectionFactoryReturn, en as buildWithTypeModifier, et as AnyOperationOf, f as PrebuiltTypeRegistry, fn as AnyAssigningInput, ft as FieldSelectionFactories, g as applyTypeModifier, gn as FieldArgumentValue, gt as FieldSelectionFactoryPrimitiveReturn, h as TypeFormatters, hn as DeclaredVariables, ht as FieldSelectionFactoryObjectReturn, i as EmptyPrebuiltTypeRegistry, in as AnyNestedObject, it as Fragment, j as GqlElementComposerOptions, jt as AttachmentsTupleToIntersection, k as FragmentBuildersAll, kt as AttachmentShape, l as PrebuiltFragmentOutput, ln as AnyDirectiveAttachments, lt as GqlElementDefinitionFactory, m as GenerateInputObjectTypeOptions, mn as AssignableInputByFieldName, mt as FieldSelectionFactoryFieldArguments, n as Hidden, nn as AnyFieldSelection, nt as OperationInferMeta, o as HasPrebuiltOperation, on as FieldSelectionTemplateOf, ot as GqlElement, p as PrebuiltUnknownElement, pn as AssignableInput, pt as FieldSelectionFactory, q as withFragmentUsageCollection, qt as Tuple, r as hidden, rn as AnyFields, rt as AnyFragment, s as PrebuiltEntryNotFound, sn as InferField, st as GqlElementAttachment, t as wrapByKey, tn as AbstractFieldSelection, tt as Operation, u as PrebuiltOperationInput, un as AnyAssignableInput, ut as AnyFieldSelectionFactory, v as calculateFieldsType, vn as AnyConstAssignableInput, vt as FieldSelectionFactoryUnionReturn, w as getScalarOutputType, wn as AnyDirectiveRefBrand, wt as EmptyObject, x as generateInputTypeFromSpecifiers, xn as ConstAssignableInputValue, xt as NestedObjectFieldsBuilder, y as generateInputObjectType, yn as AnyConstAssignableInputValue, yt as FieldsBuilder, z as VarBuilder, zt as createStandardDirectives } from "./index-BcA2XPEk.js";
|
|
3
3
|
import { n as defineOperationRoots, r as defineScalar, t as defineEnum } from "./schema-builder-B5zSZzZO.js";
|
|
4
4
|
|
|
5
5
|
//#region packages/core/src/types/type-foundation/modified-type-name.d.ts
|
|
@@ -11,5 +11,5 @@ declare function parseModifiedTypeName<TNameCandidate extends [string], TName ex
|
|
|
11
11
|
modifier: TModifier;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
|
-
export { AbstractFieldSelection, Adapter, AllInputTypeNames, AnyAdapter, AnyAssignableInput, AnyAssignableInputValue, AnyAssigningInput, AnyConstAssignableInput, AnyConstAssignableInputValue, AnyConstDirectiveAttachments, AnyDefaultValue, AnyDirectiveAttachments, AnyDirectiveMethod, AnyDirectiveRef, AnyDirectiveRefBrand, AnyFieldName, AnyFieldSelection, AnyFieldSelectionFactory, AnyFieldSelectionFactoryReturn, AnyFields, AnyFragment, AnyGqlContext, AnyGraphqlSchema, AnyMetadataAdapter, AnyNestedObject, AnyNestedUnion, AnyOperation, AnyOperationOf, AnyTypeName, AnyTypeSpecifier, AnyVarRef, AnyVarRefBrand, ApplyTypeModifier, AssignableInput, AssignableInputByFieldName, AttachmentShape, AttachmentToProperty, AttachmentsTupleToIntersection, ColocateHelper, ColocatedEntries, ColocatedFields, ConstAssignableInput, ConstAssignableInputValue, ConstValue, ConstValues, DeclaredVariables, DecrementDepth, DefaultAdapter, DefaultDepth, DefaultMetadataAdapter, DepthCounter, DirectiveArgValue, DirectiveBuilder, DirectiveLocation, DirectiveMethod, DirectiveRef, DirectiveRefInner, DocumentTransformArgs, DocumentTransformer, EmptyObject, EmptyPrebuiltTypeRegistry, EnumDefinition, ExtractAdapterTypes, ExtractMetadata, ExtractMetadataAdapter, ExtractUnifiedAdapterTypes, FieldArgumentValue, FieldPath, FieldPathSegment, FieldSelectionFactories, FieldSelectionFactory, FieldSelectionFactoryFieldArguments, FieldSelectionFactoryObjectReturn, FieldSelectionFactoryPrimitiveReturn, FieldSelectionFactoryReturn, FieldSelectionFactoryUnionReturn, FieldSelectionTemplateOf, FieldsBuilder, FieldsBuilderTools, Fragment, FragmentBuilderFor, FragmentBuildersAll, FragmentInferMeta, FragmentMetaInfo, FragmentMetadataBuilder, FragmentMetadataBuilderTools, FragmentUsageRecord, GenerateInputObjectTypeOptions, GetAssignableType, GetConstAssignableType, GetInputTypeDepth, GetModifiedType, GetSignature, GqlElement, GqlElementAttachment, GqlElementComposer, GqlElementComposerOptions, GqlElementComposerWithSchema, GqlElementContext, GqlElementDefinitionFactory, HasPrebuiltFragment, HasPrebuiltOperation, Hidden, IfOmittable, InferField, InferFields, InferInputKind, InferInputProfile, InferOutputProfile, InputDefinition, InputDepthOverrides, InputEnumSpecifier, InputFieldRecord, InputInferrableTypeSpecifier, InputInputObjectSpecifier, InputScalarSpecifier, InputTypeKind, InputTypeMethod, InputTypeMethods, InputTypeSpecifier, InputTypeSpecifiers, IsDepthExhausted, MetadataAdapter, MetadataBuilder, MetadataBuilderTools, ModifiedTypeName, NestedObjectFieldsBuilder, NestedObjectFieldsBuilderTools, NestedUnionFieldsBuilder, NestedValue, NestedValueElement, NumberToDepth, ObjectDefinition, ObjectFieldRecord, ObjectTypeProfile, Operation, OperationDocumentTransformArgs, OperationDocumentTransformer, OperationInferMeta, OperationMetadata, OperationRoots, OperationType, OptionalArg, OutputEnumSpecifier, OutputInferrableTypeSpecifier, OutputObjectSpecifier, OutputScalarSpecifier, OutputTypeKind, OutputTypeSpecifier, OutputTypeSpecifiers, OutputTypenameSpecifier, OutputUnionSpecifier, PickTypeSpecifierByFieldName, PrebuiltEntryNotFound, PrebuiltFragmentInput, PrebuiltFragmentOutput,
|
|
14
|
+
export { AbstractFieldSelection, Adapter, AllInputTypeNames, AnyAdapter, AnyAssignableInput, AnyAssignableInputValue, AnyAssigningInput, AnyConstAssignableInput, AnyConstAssignableInputValue, AnyConstDirectiveAttachments, AnyDefaultValue, AnyDirectiveAttachments, AnyDirectiveMethod, AnyDirectiveRef, AnyDirectiveRefBrand, AnyFieldName, AnyFieldSelection, AnyFieldSelectionFactory, AnyFieldSelectionFactoryReturn, AnyFields, AnyFragment, AnyGqlContext, AnyGraphqlSchema, AnyMetadataAdapter, AnyNestedObject, AnyNestedUnion, AnyOperation, AnyOperationOf, AnyTypeName, AnyTypeSpecifier, AnyVarRef, AnyVarRefBrand, ApplyTypeModifier, AssignableInput, AssignableInputByFieldName, AttachmentShape, AttachmentToProperty, AttachmentsTupleToIntersection, ColocateHelper, ColocatedEntries, ColocatedFields, ConstAssignableInput, ConstAssignableInputValue, ConstValue, ConstValues, DeclaredVariables, DecrementDepth, DefaultAdapter, DefaultDepth, DefaultMetadataAdapter, DepthCounter, DirectiveArgValue, DirectiveBuilder, DirectiveLocation, DirectiveMethod, DirectiveRef, DirectiveRefInner, DocumentTransformArgs, DocumentTransformer, EmptyObject, EmptyPrebuiltTypeRegistry, EnumDefinition, EnumLookup, ExtractAdapterTypes, ExtractMetadata, ExtractMetadataAdapter, ExtractUnifiedAdapterTypes, FieldArgumentValue, FieldPath, FieldPathSegment, FieldSelectionFactories, FieldSelectionFactory, FieldSelectionFactoryFieldArguments, FieldSelectionFactoryObjectReturn, FieldSelectionFactoryPrimitiveReturn, FieldSelectionFactoryReturn, FieldSelectionFactoryUnionReturn, FieldSelectionTemplateOf, FieldsBuilder, FieldsBuilderTools, Fragment, FragmentBuilderFor, FragmentBuildersAll, FragmentInferMeta, FragmentMetaInfo, FragmentMetadataBuilder, FragmentMetadataBuilderTools, FragmentUsageRecord, GenerateInputObjectTypeOptions, GetAssignableType, GetConstAssignableType, GetInputTypeDepth, GetModifiedType, GetSignature, GqlElement, GqlElementAttachment, GqlElementComposer, GqlElementComposerOptions, GqlElementComposerWithSchema, GqlElementContext, GqlElementDefinitionFactory, HasPrebuiltFragment, HasPrebuiltOperation, Hidden, IfOmittable, InferField, InferFields, InferInputKind, InferInputProfile, InferOutputProfile, InputDefinition, InputDepthOverrides, InputEnumSpecifier, InputFieldRecord, InputInferrableTypeSpecifier, InputInputObjectSpecifier, InputScalarSpecifier, InputTypeKind, InputTypeMethod, InputTypeMethods, InputTypeSpecifier, InputTypeSpecifiers, IsDepthExhausted, MetadataAdapter, MetadataBuilder, MetadataBuilderTools, ModifiedTypeName, NestedObjectFieldsBuilder, NestedObjectFieldsBuilderTools, NestedUnionFieldsBuilder, NestedValue, NestedValueElement, NumberToDepth, ObjectDefinition, ObjectFieldRecord, ObjectTypeProfile, Operation, OperationDocumentTransformArgs, OperationDocumentTransformer, OperationInferMeta, OperationMetadata, OperationRoots, OperationType, OptionalArg, OutputEnumSpecifier, OutputInferrableTypeSpecifier, OutputObjectSpecifier, OutputScalarSpecifier, OutputTypeKind, OutputTypeSpecifier, OutputTypeSpecifiers, OutputTypenameSpecifier, OutputUnionSpecifier, PickTypeSpecifierByFieldName, PrebuiltEntryNotFound, PrebuiltFragmentInput, PrebuiltFragmentOutput, PrebuiltOperationInput, PrebuiltOperationOutput, PrebuiltTypeRegistry, PrebuiltUnknownElement, PrimitiveTypeProfile, ResolveInputProfileFromMeta, ResolveTypeFromMeta, ScalarDefinition, SchemaAwareGetNameAt, SchemaAwareGetValueAt, StandardDirectives, StripFunctions, StripSymbols, SwitchIfOmittable, Tuple, TypeFormatters, TypeModifier, TypeProfile, UnionDefinition, UnionMemberName, UnionToIntersection, UnionTypeRecord, ValidTypeModifier, VarBuilder, VarBuilderMethods, VarRef, VarRefInner, VarSpecifier, appendToPath, applyTypeModifier, buildArgumentValue, buildConstValueNode, buildDocument, buildOperationTypeNode, buildWithTypeModifier, calculateFieldType, calculateFieldsType, createColocateHelper, createDefaultAdapter, createDirectiveBuilder, createDirectiveMethod, createFieldFactories, createGqlElementComposer, createGqlFragmentComposers, createOperationComposerFactory, createStandardDirectives, createVarAssignments, createVarBuilder, createVarMethod, createVarMethodFactory, createVarRefFromNestedValue, createVarRefFromVariable, createVarRefs, defaultMetadataAdapter, defineEnum, defineOperationRoots, defineScalar, empty, generateInputObjectType, generateInputType, generateInputTypeFromSpecifiers, getCurrentFieldPath, getEnumType, getScalarInputType, getScalarOutputType, graphqlTypeToTypeScript, hidden, isDirectiveRef, isListType, parseModifiedTypeName, recordFragmentUsage, withFieldPath, withFragmentUsageCollection, wrapByKey };
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -70,8 +70,12 @@ var DirectiveRef = class {
|
|
|
70
70
|
*
|
|
71
71
|
* Handles primitives, arrays, objects, and variable references.
|
|
72
72
|
* Returns null for undefined values (field is omitted).
|
|
73
|
+
*
|
|
74
|
+
* @param value - The value to convert
|
|
75
|
+
* @param enumLookup - Context for enum detection. String values will be output
|
|
76
|
+
* as Kind.ENUM if typeSpecifier indicates an enum type.
|
|
73
77
|
*/
|
|
74
|
-
const buildArgumentValue = (value) => {
|
|
78
|
+
const buildArgumentValue = (value, enumLookup) => {
|
|
75
79
|
if (value === void 0) return null;
|
|
76
80
|
if (value === null) return { kind: Kind.NULL };
|
|
77
81
|
if (value instanceof VarRef) {
|
|
@@ -83,17 +87,22 @@ const buildArgumentValue = (value) => {
|
|
|
83
87
|
value: inner.name
|
|
84
88
|
}
|
|
85
89
|
};
|
|
86
|
-
if (inner.type === "nested-value") return buildArgumentValue(inner.value);
|
|
90
|
+
if (inner.type === "nested-value") return buildArgumentValue(inner.value, enumLookup);
|
|
87
91
|
throw new Error(`Unknown var ref type: ${inner}`);
|
|
88
92
|
}
|
|
89
93
|
if (Array.isArray(value)) return {
|
|
90
94
|
kind: Kind.LIST,
|
|
91
|
-
values: value.map((item) => buildArgumentValue(item)).filter((item) => item !== null)
|
|
95
|
+
values: value.map((item) => buildArgumentValue(item, enumLookup)).filter((item) => item !== null)
|
|
92
96
|
};
|
|
93
97
|
if (typeof value === "object") return {
|
|
94
98
|
kind: Kind.OBJECT,
|
|
95
|
-
fields: Object.entries(value).map(([key,
|
|
96
|
-
|
|
99
|
+
fields: Object.entries(value).map(([key, fieldValue]) => {
|
|
100
|
+
let fieldTypeSpecifier = null;
|
|
101
|
+
if (enumLookup.typeSpecifier?.kind === "input") fieldTypeSpecifier = enumLookup.schema.input[enumLookup.typeSpecifier.name]?.fields[key] ?? null;
|
|
102
|
+
const valueNode = buildArgumentValue(fieldValue, {
|
|
103
|
+
schema: enumLookup.schema,
|
|
104
|
+
typeSpecifier: fieldTypeSpecifier
|
|
105
|
+
});
|
|
97
106
|
return valueNode ? {
|
|
98
107
|
kind: Kind.OBJECT_FIELD,
|
|
99
108
|
name: {
|
|
@@ -104,10 +113,16 @@ const buildArgumentValue = (value) => {
|
|
|
104
113
|
} : null;
|
|
105
114
|
}).filter((item) => item !== null)
|
|
106
115
|
};
|
|
107
|
-
if (typeof value === "string")
|
|
108
|
-
kind
|
|
109
|
-
|
|
110
|
-
|
|
116
|
+
if (typeof value === "string") {
|
|
117
|
+
if (enumLookup.typeSpecifier?.kind === "enum") return {
|
|
118
|
+
kind: Kind.ENUM,
|
|
119
|
+
value
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
kind: Kind.STRING,
|
|
123
|
+
value
|
|
124
|
+
};
|
|
125
|
+
}
|
|
111
126
|
if (typeof value === "number") return {
|
|
112
127
|
kind: !Number.isInteger(value) || value.toString().includes(".") ? Kind.FLOAT : Kind.INT,
|
|
113
128
|
value: value.toString()
|
|
@@ -118,8 +133,11 @@ const buildArgumentValue = (value) => {
|
|
|
118
133
|
};
|
|
119
134
|
throw new Error(`Unknown value type: ${typeof value}`);
|
|
120
135
|
};
|
|
121
|
-
const buildArguments = (args) => Object.entries(args ?? {}).map(([name, value]) => {
|
|
122
|
-
const valueNode = buildArgumentValue(value
|
|
136
|
+
const buildArguments = (args, argumentSpecifiers, schema) => Object.entries(args ?? {}).map(([name, value]) => {
|
|
137
|
+
const valueNode = buildArgumentValue(value, {
|
|
138
|
+
schema,
|
|
139
|
+
typeSpecifier: argumentSpecifiers[name] ?? null
|
|
140
|
+
});
|
|
123
141
|
return valueNode ? {
|
|
124
142
|
kind: Kind.ARGUMENT,
|
|
125
143
|
name: {
|
|
@@ -148,9 +166,15 @@ const validateDirectiveLocation = (directive, expectedLocation) => {
|
|
|
148
166
|
*
|
|
149
167
|
* @param directives - Array of directive references (or unknown values)
|
|
150
168
|
* @param location - The location context for validation
|
|
169
|
+
* @param schema - The schema for type lookups
|
|
151
170
|
* @returns Array of DirectiveNode for the GraphQL AST
|
|
171
|
+
*
|
|
172
|
+
* NOTE: Directive argument enum support is not yet implemented.
|
|
173
|
+
* Schema does not currently include directive definitions, so enum arguments
|
|
174
|
+
* in directives will be output as strings. This can be enhanced when
|
|
175
|
+
* directive definitions are added to the schema.
|
|
152
176
|
*/
|
|
153
|
-
const buildDirectives = (directives, location) => {
|
|
177
|
+
const buildDirectives = (directives, location, schema) => {
|
|
154
178
|
return directives.filter((d) => d instanceof DirectiveRef).map((directive) => {
|
|
155
179
|
validateDirectiveLocation(directive, location);
|
|
156
180
|
const inner = DirectiveRef.getInner(directive);
|
|
@@ -160,11 +184,11 @@ const buildDirectives = (directives, location) => {
|
|
|
160
184
|
kind: Kind.NAME,
|
|
161
185
|
value: inner.name
|
|
162
186
|
},
|
|
163
|
-
arguments: buildArguments(inner.arguments)
|
|
187
|
+
arguments: buildArguments(inner.arguments, {}, schema)
|
|
164
188
|
};
|
|
165
189
|
});
|
|
166
190
|
};
|
|
167
|
-
const buildUnionSelection = (union) => Object.entries(union).map(([typeName, object]) => {
|
|
191
|
+
const buildUnionSelection = (union, schema) => Object.entries(union).map(([typeName, object]) => {
|
|
168
192
|
return object ? {
|
|
169
193
|
kind: Kind.INLINE_FRAGMENT,
|
|
170
194
|
typeCondition: {
|
|
@@ -176,12 +200,12 @@ const buildUnionSelection = (union) => Object.entries(union).map(([typeName, obj
|
|
|
176
200
|
},
|
|
177
201
|
selectionSet: {
|
|
178
202
|
kind: Kind.SELECTION_SET,
|
|
179
|
-
selections: buildField(object)
|
|
203
|
+
selections: buildField(object, schema)
|
|
180
204
|
}
|
|
181
205
|
} : null;
|
|
182
206
|
}).filter((item) => item !== null);
|
|
183
|
-
const buildField = (field) => Object.entries(field).map(([alias, { args, field: field$1, object, union, directives }]) => {
|
|
184
|
-
const builtDirectives = buildDirectives(directives, "FIELD");
|
|
207
|
+
const buildField = (field, schema) => Object.entries(field).map(([alias, { args, field: field$1, object, union, directives, type }]) => {
|
|
208
|
+
const builtDirectives = buildDirectives(directives, "FIELD", schema);
|
|
185
209
|
return {
|
|
186
210
|
kind: Kind.FIELD,
|
|
187
211
|
name: {
|
|
@@ -192,14 +216,14 @@ const buildField = (field) => Object.entries(field).map(([alias, { args, field:
|
|
|
192
216
|
kind: Kind.NAME,
|
|
193
217
|
value: alias
|
|
194
218
|
} : void 0,
|
|
195
|
-
arguments: buildArguments(args),
|
|
219
|
+
arguments: buildArguments(args, type.arguments, schema),
|
|
196
220
|
directives: builtDirectives.length > 0 ? builtDirectives : void 0,
|
|
197
221
|
selectionSet: object ? {
|
|
198
222
|
kind: Kind.SELECTION_SET,
|
|
199
|
-
selections: buildField(object)
|
|
223
|
+
selections: buildField(object, schema)
|
|
200
224
|
} : union ? {
|
|
201
225
|
kind: Kind.SELECTION_SET,
|
|
202
|
-
selections: buildUnionSelection(union)
|
|
226
|
+
selections: buildUnionSelection(union, schema)
|
|
203
227
|
} : void 0
|
|
204
228
|
};
|
|
205
229
|
});
|
|
@@ -208,30 +232,27 @@ const buildField = (field) => Object.entries(field).map(([alias, { args, field:
|
|
|
208
232
|
*
|
|
209
233
|
* Unlike `buildArgumentValue`, this only handles literal values
|
|
210
234
|
* (no variable references). Used for default values.
|
|
235
|
+
*
|
|
236
|
+
* @param value - The constant value to convert
|
|
237
|
+
* @param enumLookup - Context for enum detection. String values will be output
|
|
238
|
+
* as Kind.ENUM if typeSpecifier indicates an enum type.
|
|
211
239
|
*/
|
|
212
|
-
const buildConstValueNode = (value) => {
|
|
240
|
+
const buildConstValueNode = (value, enumLookup) => {
|
|
213
241
|
if (value === void 0) return null;
|
|
214
242
|
if (value === null) return { kind: Kind.NULL };
|
|
215
|
-
if (typeof value === "string") return {
|
|
216
|
-
kind: Kind.STRING,
|
|
217
|
-
value
|
|
218
|
-
};
|
|
219
|
-
if (typeof value === "boolean") return {
|
|
220
|
-
kind: Kind.BOOLEAN,
|
|
221
|
-
value
|
|
222
|
-
};
|
|
223
|
-
if (typeof value === "number") return {
|
|
224
|
-
kind: !Number.isInteger(value) || value.toString().includes(".") ? Kind.FLOAT : Kind.INT,
|
|
225
|
-
value: value.toString()
|
|
226
|
-
};
|
|
227
243
|
if (Array.isArray(value)) return {
|
|
228
244
|
kind: Kind.LIST,
|
|
229
|
-
values: value.map((item) => buildConstValueNode(item)).filter((item) => item !== null)
|
|
245
|
+
values: value.map((item) => buildConstValueNode(item, enumLookup)).filter((item) => item !== null)
|
|
230
246
|
};
|
|
231
247
|
if (typeof value === "object") return {
|
|
232
248
|
kind: Kind.OBJECT,
|
|
233
|
-
fields: Object.entries(value).map(([key,
|
|
234
|
-
|
|
249
|
+
fields: Object.entries(value).map(([key, fieldValue]) => {
|
|
250
|
+
let fieldTypeSpecifier = null;
|
|
251
|
+
if (enumLookup.typeSpecifier?.kind === "input") fieldTypeSpecifier = enumLookup.schema.input[enumLookup.typeSpecifier.name]?.fields[key] ?? null;
|
|
252
|
+
const valueNode = buildConstValueNode(fieldValue, {
|
|
253
|
+
schema: enumLookup.schema,
|
|
254
|
+
typeSpecifier: fieldTypeSpecifier
|
|
255
|
+
});
|
|
235
256
|
return valueNode ? {
|
|
236
257
|
kind: Kind.OBJECT_FIELD,
|
|
237
258
|
name: {
|
|
@@ -242,6 +263,24 @@ const buildConstValueNode = (value) => {
|
|
|
242
263
|
} : null;
|
|
243
264
|
}).filter((item) => item !== null)
|
|
244
265
|
};
|
|
266
|
+
if (typeof value === "string") {
|
|
267
|
+
if (enumLookup.typeSpecifier?.kind === "enum") return {
|
|
268
|
+
kind: Kind.ENUM,
|
|
269
|
+
value
|
|
270
|
+
};
|
|
271
|
+
return {
|
|
272
|
+
kind: Kind.STRING,
|
|
273
|
+
value
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
if (typeof value === "boolean") return {
|
|
277
|
+
kind: Kind.BOOLEAN,
|
|
278
|
+
value
|
|
279
|
+
};
|
|
280
|
+
if (typeof value === "number") return {
|
|
281
|
+
kind: !Number.isInteger(value) || value.toString().includes(".") ? Kind.FLOAT : Kind.INT,
|
|
282
|
+
value: value.toString()
|
|
283
|
+
};
|
|
245
284
|
throw new Error(`Unknown value type: ${typeof value}`);
|
|
246
285
|
};
|
|
247
286
|
/**
|
|
@@ -313,7 +352,7 @@ const buildWithTypeModifier = (modifier, buildType) => {
|
|
|
313
352
|
}
|
|
314
353
|
return curr.type;
|
|
315
354
|
};
|
|
316
|
-
const buildVariables = (variables) => {
|
|
355
|
+
const buildVariables = (variables, schema) => {
|
|
317
356
|
return Object.entries(variables).map(([name, ref]) => ({
|
|
318
357
|
kind: Kind.VARIABLE_DEFINITION,
|
|
319
358
|
variable: {
|
|
@@ -323,7 +362,10 @@ const buildVariables = (variables) => {
|
|
|
323
362
|
value: name
|
|
324
363
|
}
|
|
325
364
|
},
|
|
326
|
-
defaultValue: ref.defaultValue && buildConstValueNode(ref.defaultValue.default
|
|
365
|
+
defaultValue: ref.defaultValue && buildConstValueNode(ref.defaultValue.default, {
|
|
366
|
+
schema,
|
|
367
|
+
typeSpecifier: ref
|
|
368
|
+
}) || void 0,
|
|
327
369
|
type: buildWithTypeModifier(ref.modifier, () => ({
|
|
328
370
|
kind: Kind.NAMED_TYPE,
|
|
329
371
|
name: {
|
|
@@ -351,11 +393,11 @@ const buildOperationTypeNode = (operation) => {
|
|
|
351
393
|
* a GraphQL document AST. The result can be used with any GraphQL
|
|
352
394
|
* client that supports TypedDocumentNode.
|
|
353
395
|
*
|
|
354
|
-
* @param options - Operation configuration (name, type, variables, fields)
|
|
396
|
+
* @param options - Operation configuration (name, type, variables, fields, schema)
|
|
355
397
|
* @returns TypedDocumentNode with inferred input/output types
|
|
356
398
|
*/
|
|
357
399
|
const buildDocument = (options) => {
|
|
358
|
-
const { operationName, operationType, variables, fields } = options;
|
|
400
|
+
const { operationName, operationType, variables, fields, schema } = options;
|
|
359
401
|
return {
|
|
360
402
|
kind: Kind.DOCUMENT,
|
|
361
403
|
definitions: [{
|
|
@@ -365,10 +407,10 @@ const buildDocument = (options) => {
|
|
|
365
407
|
kind: Kind.NAME,
|
|
366
408
|
value: operationName
|
|
367
409
|
},
|
|
368
|
-
variableDefinitions: buildVariables(variables),
|
|
410
|
+
variableDefinitions: buildVariables(variables, schema),
|
|
369
411
|
selectionSet: {
|
|
370
412
|
kind: Kind.SELECTION_SET,
|
|
371
|
-
selections: buildField(fields)
|
|
413
|
+
selections: buildField(fields, schema)
|
|
372
414
|
}
|
|
373
415
|
}]
|
|
374
416
|
};
|
|
@@ -793,7 +835,6 @@ var GqlElement = class GqlElement {
|
|
|
793
835
|
* @template TVariables - Variables required when spreading
|
|
794
836
|
* @template TFields - The selected fields structure
|
|
795
837
|
* @template TOutput - Inferred output type from selected fields
|
|
796
|
-
* @template TKey - Optional unique key for prebuilt type lookup
|
|
797
838
|
*/
|
|
798
839
|
var Fragment = class Fragment extends GqlElement {
|
|
799
840
|
constructor(define) {
|
|
@@ -1063,7 +1104,8 @@ const createOperationComposerFactory = (schema, adapter, transformDocument) => {
|
|
|
1063
1104
|
operationName,
|
|
1064
1105
|
operationType,
|
|
1065
1106
|
variables,
|
|
1066
|
-
fields
|
|
1107
|
+
fields,
|
|
1108
|
+
schema
|
|
1067
1109
|
});
|
|
1068
1110
|
const variableNames = Object.keys(variables);
|
|
1069
1111
|
if (!fragmentUsages.some((u) => u.metadataBuilder) && !options.metadata && !transformDocument && !options.transformDocument) return {
|
|
@@ -1407,48 +1449,6 @@ const createGqlElementComposer = (schema, options) => {
|
|
|
1407
1449
|
return composerWithSchema;
|
|
1408
1450
|
};
|
|
1409
1451
|
|
|
1410
|
-
//#endregion
|
|
1411
|
-
//#region packages/core/src/composer/prebuilt-composer.ts
|
|
1412
|
-
/**
|
|
1413
|
-
* Creates a prebuilt GQL element composer for a given schema.
|
|
1414
|
-
*
|
|
1415
|
-
* This composer has the same runtime behavior as `createGqlElementComposer`,
|
|
1416
|
-
* but the returned elements have their types resolved from the PrebuiltTypeRegistry
|
|
1417
|
-
* instead of using complex type inference.
|
|
1418
|
-
*
|
|
1419
|
-
* Use this when bundling with tools like tsdown that may lose type information.
|
|
1420
|
-
*
|
|
1421
|
-
* @param schema - The GraphQL schema definition
|
|
1422
|
-
* @param options - Configuration including input type methods and optional adapter
|
|
1423
|
-
* @returns Prebuilt element composer function
|
|
1424
|
-
*
|
|
1425
|
-
* @example
|
|
1426
|
-
* ```typescript
|
|
1427
|
-
* // Generated by codegen in prebuilt/index.ts
|
|
1428
|
-
* import type { PrebuiltTypes } from "./types";
|
|
1429
|
-
*
|
|
1430
|
-
* const gql = createPrebuiltGqlElementComposer<
|
|
1431
|
-
* Schema,
|
|
1432
|
-
* PrebuiltTypes,
|
|
1433
|
-
* FragmentBuilders,
|
|
1434
|
-
* DirectiveMethods,
|
|
1435
|
-
* Context
|
|
1436
|
-
* >(schema, { inputTypeMethods });
|
|
1437
|
-
*
|
|
1438
|
-
* // Types are resolved from PrebuiltTypes registry
|
|
1439
|
-
* const GetUser = gql(({ query }) =>
|
|
1440
|
-
* query.operation({
|
|
1441
|
-
* name: "GetUser",
|
|
1442
|
-
* fields: ({ f }) => ({ ...f.user({ id: "1" })(({ f }) => ({ ...f.id() })) }),
|
|
1443
|
-
* })
|
|
1444
|
-
* );
|
|
1445
|
-
* // GetUser.$infer.output is PrebuiltTypes["operations"]["GetUser"]["output"]
|
|
1446
|
-
* ```
|
|
1447
|
-
*/
|
|
1448
|
-
const createPrebuiltGqlElementComposer = (schema, options) => {
|
|
1449
|
-
return createGqlElementComposer(schema, options);
|
|
1450
|
-
};
|
|
1451
|
-
|
|
1452
1452
|
//#endregion
|
|
1453
1453
|
//#region packages/core/src/prebuilt/type-calculator.ts
|
|
1454
1454
|
/**
|
|
@@ -1701,5 +1701,5 @@ const generateInputTypeFromSpecifiers = (schema, specifiers, options = {}) => {
|
|
|
1701
1701
|
};
|
|
1702
1702
|
|
|
1703
1703
|
//#endregion
|
|
1704
|
-
export { Fragment, GqlElement, Operation, VarRef, appendToPath, applyTypeModifier, buildArgumentValue, buildConstValueNode, buildDocument, buildOperationTypeNode, buildWithTypeModifier, calculateFieldType, calculateFieldsType, createColocateHelper, createDefaultAdapter, createDirectiveBuilder, createDirectiveMethod, createFieldFactories, createGqlElementComposer, createGqlFragmentComposers, createOperationComposerFactory,
|
|
1704
|
+
export { Fragment, GqlElement, Operation, VarRef, appendToPath, applyTypeModifier, buildArgumentValue, buildConstValueNode, buildDocument, buildOperationTypeNode, buildWithTypeModifier, calculateFieldType, calculateFieldsType, createColocateHelper, createDefaultAdapter, createDirectiveBuilder, createDirectiveMethod, createFieldFactories, createGqlElementComposer, createGqlFragmentComposers, createOperationComposerFactory, createStandardDirectives, createVarAssignments, createVarBuilder, createVarMethod, createVarMethodFactory, createVarRefFromVariable, createVarRefs, defaultMetadataAdapter, defineEnum, defineOperationRoots, defineScalar, generateInputObjectType, generateInputType, generateInputTypeFromSpecifiers, getCurrentFieldPath, getEnumType, getScalarInputType, getScalarOutputType, graphqlTypeToTypeScript, isDirectiveRef, isListType, recordFragmentUsage, withFieldPath, withFragmentUsageCollection };
|
|
1705
1705
|
//# sourceMappingURL=index.js.map
|