如何在@default 指令中创建计算值
How to Create Computed Values in @default Directives
谁能指出我正确的方向?使用 Prisma's SDL
我想用这样的 @default
指令创建一个计算值...
type Event {
id: ID! @unique
title: String!
slug: String! @unique @default(value: titleToSlug())
}
目前不支持动态默认值,可以在应用服务器层处理。您可以为动态默认值 here.
创建功能请求
该指令被称为 @default
,而不是 in the documentation 中描述的 @defaultValue
。
谁能指出我正确的方向?使用 Prisma's SDL
我想用这样的 @default
指令创建一个计算值...
type Event {
id: ID! @unique
title: String!
slug: String! @unique @default(value: titleToSlug())
}
目前不支持动态默认值,可以在应用服务器层处理。您可以为动态默认值 here.
创建功能请求该指令被称为 @default
,而不是 in the documentation 中描述的 @defaultValue
。