Chris Geirman
Chris Geirman

Reputation: 9684

How to Create Computed Values in @default Directives

Can anyone point me in the right direction? Using Prisma's SDL I’d like to create a computed value with the @default directive like this…

type Event {
  id: ID! @unique

  title: String!
  slug: String! @unique @default(value: titleToSlug())
}

Upvotes: 2

Views: 709

Answers (1)

marktani
marktani

Reputation: 7808

Dynamic default values are currently not supported, and can be handled in the application server layer. You can create a feature request for dynamic default values here.

The directive is called @default and not @defaultValue as described in the documentation.

Upvotes: 2

Related Questions