DiscriminatedVariantField
Defined in: packages/core/src/fields/variant/types.ts:133
Resolved configuration for a discriminated variant() field.
Extends
Section titled “Extends”BaseField<TCollectionSlug,TFieldMeta>
Type Parameters
Section titled “Type Parameters”TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends VexResourceSlug = VexResourceSlug
TFieldMeta
Section titled “TFieldMeta”TFieldMeta extends object = { }
Properties
Section titled “Properties”admin:
VariantFieldAdminConfig<TCollectionSlug>
Defined in: packages/core/src/fields/variant/types.ts:138
Resolved admin UI configuration with all defaults applied.
Overrides
Section titled “Overrides”defaultValue?
Section titled “defaultValue?”
optionaldefaultValue?:Record<string,unknown>
Defined in: packages/core/src/fields/variant/types.ts:142
Pre-filled value shown in the admin form when creating a new field. Does not apply to database values
Overrides
Section titled “Overrides”dependsOn?
Section titled “dependsOn?”
optionaldependsOn?: readonlystring[]
Defined in: packages/core/src/fields/baseTypes.ts:663
Other fields whose change re-runs this field’s validate() on a partial
write.
Inherited from
Section titled “Inherited from”description?
Section titled “description?”
optionaldescription?:string
Defined in: packages/core/src/fields/baseTypes.ts:651
Semantic description of the field. Used in three places:
- Helper text rendered below the field input in the admin form UI.
- As the Zod
.meta({ description })value for form validation. - As the JSDoc comment on the generated document interface property.
To write a separate JSDoc comment, use interfaceDescription in addition.
Inherited from
Section titled “Inherited from”discriminator
Section titled “discriminator”discriminator:
string
Defined in: packages/core/src/fields/variant/types.ts:139
index?
Section titled “index?”
optionalindex?:ResolvedFieldIndexConfigInput
Defined in: packages/core/src/fields/baseTypes.ts:655
Convex index name for this field, or the object form for a compound index.
Inherited from
Section titled “Inherited from”interfaceDescription?
Section titled “interfaceDescription?”
optionalinterfaceDescription?:string
Defined in: packages/core/src/fields/baseTypes.ts:653
The JSDoc comment on the generated document interface property
Inherited from
Section titled “Inherited from”BaseField.interfaceDescription
interfaceName?
Section titled “interfaceName?”
optionalinterfaceName?:string
Defined in: packages/core/src/fields/variant/types.ts:141
interfaceType
Section titled “interfaceType”interfaceType:
string
Defined in: packages/core/src/fields/baseTypes.ts:657
TypeScript type string written to generated document interfaces (e.g. "string", "number", "string[]").
Inherited from
Section titled “Inherited from”label:
string
Defined in: packages/core/src/fields/baseTypes.ts:631
Display label shown in the admin form. Always set — inferred from the field key if not provided.
Inherited from
Section titled “Inherited from”meta:
TFieldMeta
Defined in: packages/core/src/fields/baseTypes.ts:658
Inherited from
Section titled “Inherited from”nullable
Section titled “nullable”nullable:
boolean
Defined in: packages/core/src/fields/baseTypes.ts:635
Whether null is a legal value for this field, in addition to its normal type.
Inherited from
Section titled “Inherited from”required
Section titled “required”required:
boolean
Defined in: packages/core/src/fields/baseTypes.ts:633
Whether this field is required in the database schema.
Inherited from
Section titled “Inherited from”
readonlytype:"variant"
Defined in: packages/core/src/fields/variant/types.ts:137
variants
Section titled “variants”variants:
Record<string,VariantMemberConfig>
Defined in: packages/core/src/fields/variant/types.ts:140
Methods
Section titled “Methods”validate()?
Section titled “validate()?”
optionalvalidate(props):void|Promise<void>
Defined in: packages/core/src/fields/variant/types.ts:143
Server-only async validation, run after the generated Zod schema passes.
Parameters
Section titled “Parameters”FieldValidateProps<TCollectionSlug, Record<string, unknown>>
Returns
Section titled “Returns”void | Promise<void>
Overrides
Section titled “Overrides”BaseField.validate