【发布时间】:2021-03-09 19:23:15
【问题描述】:
我正在使用 Strapi 作为无头 CMS
我创建了一个客户内容类型并安装了 graphql 插件。
我正在尝试在 graphql 游乐场中创建一个突变以创建一个新客户
mutation createCustomer($username: String!, $email: String, $password: String){
createCustomer(username: $username, email: $email, password: $password){
_id username email password
}
}
我在查询变量中传递用户名等
{ "username": "user1" }
{ "email": "User1@test.com" }
{"password":"123456"}
我收到了错误
"message": "Unknown argument \"username\" on field \"createCustomer\" of type \"Mutation\".",
如果我查看文档,它看起来像。
如何编写突变来创建新客户
【问题讨论】:
-
你检查用户许可了吗?
-
是的,权限都设置好了