admin管理员组文章数量:1336633
I'm new to Hasura. I just setup Hasura and connect it with MongoDB. I follow the instruction according to the guide here: / The database is connected, and the queries are working(execept the mutation). However, there's a problem with Hasura GraphQL interface as image below:
in the "Add New" there's no mutation option. Also when I write a simple mutation by myself, the error shows "no mutations exist" as image below:
I'm thinking if it is due to the write permission in MongoDB is set to false. But how can I set it up? Need some help. Thanks
I'm new to Hasura. I just setup Hasura and connect it with MongoDB. I follow the instruction according to the guide here: https://www.mongodb/developer/products/atlas/graphql-apis-hasura/ The database is connected, and the queries are working(execept the mutation). However, there's a problem with Hasura GraphQL interface as image below:
in the "Add New" there's no mutation option. Also when I write a simple mutation by myself, the error shows "no mutations exist" as image below:
I'm thinking if it is due to the write permission in MongoDB is set to false. But how can I set it up? Need some help. Thanks
Share Improve this question asked Nov 20, 2024 at 0:47 Link LinLink Lin 211 bronze badge1 Answer
Reset to default 0Its a bit late, for for anyone else I struggled with the same thing as most documentation are for Hasura v2.
If you are using the new DDN v3 hasura with mongo, I found that mutations are not auto-created. Refer to this: https://hasura.io/docs/3.0/graphql-api/mutations/
mutations are used to modify data by invoking commands in your Hasura DDN project
You create commands as you would for mongo, for example calling an update command on the 'artist' collection with variables styled for hasura:
"command": {
"update": "artist",
"updates": [{
"q": {"_id": "{{id}}"},
"u": {
"name": "{{name}}"
}
}]
}
Then apply them to your schema like so: https://hasura.io/docs/3.0/data-modeling/command/
本文标签: mongodbHasura GraphQL doesn39t have mutation optionStack Overflow
版权声明:本文标题:mongodb - Hasura GraphQL doesn't have mutation option - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742388078a2465439.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论