Default values

The @default directive specifies a default value for a field.

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.

Was this page helpful?