[英]How do you update/create a null field in a new record with Prisma
I'm setting up permissions for user on a CRUD app, I want to give myself the permission of ADMIN
but I can't seem to do it. 我正在为CRUD应用程序上的用户设置权限,我想给自己一个
ADMIN
的权限,但我似乎无法做到这一点。 I have set up my data type for a user
as follows: 我为
user
设置了我的数据类型,如下所示:
datamodel.graphql
: datamodel.graphql
:
type User {
id: ID! @unique
name: String!
email: String! @unique
password: String!
resetToken: String
resetTokenExpiry: String
permissions: [Permission]
}
schema.graphql
: schema.graphql
:
type User {
id: ID!
name: String!
email: String!
permissions: [Permission!]!
}
When using my Prisma console, I can fill out all the fields except for permissions
. 使用我的Prisma控制台时,我可以填写除
permissions
之外的所有字段。
And when trying to update an existing user's permissions, I can't seem to type anything in that field to update it. 在尝试更新现有用户的权限时,我似乎无法在该字段中键入任何内容来更新它。 Is my schema wrong?
我的架构错了吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.