holds the JS data type of the field
union of strings representing already-invoked method names. Used to improve Intellisense
type of the authorization rules attached to the field
specific ModelFieldType of the field
Optional
[___auth]?: AuthInternal non-omittable method that allows BaseModelField
to retain a reference to T
type arg in ModelField
.
Since all public methods are omittable, the evaluated BaseModelField
loses type information unless
some property on the type is guaranteed to reference T
Context: https://github.com/aws-amplify/amplify-data/pull/406/files#r1869481467
Converts a field type definition to an array of the field type.
Configures field-level authorization rules. Pass in an array of authorizations (allow => allow.____)
to mix and match
multiple authorization rules for this field.
Sets a default value for the scalar type.
Optional
value: ModelFieldTypeParamOuterthe default value
Marks a field as required.
Configures field-level validation rules.
A function that receives a validation builder object for the field type
a.integer().validate(v => v.gt(0, 'Integer must be greater than 0'))
a.float().validate(v => v.gt(0.99, 'Float must be greater than 0.99'))
a.string().validate(v => v.minLength(5, 'String must be at least 5 characters'))
Public API for the chainable builder methods exposed by Model Field. The type is narrowing e.g., after calling .array() it will be omitted from intellisense suggestions