Default Values
The
@default
directive specifies a default value for a field.Schema
type Review @model {
rating: Int! @default(value: 5)
published: Boolean @default(value: false)
status: Status @default(value: PENDING_REVIEW)
}
enum Status {
PENDING_REVIEW
APPROVED
}
The default value must be of the same type as the field specified.
Last modified 4mo ago