mongodb - Hasura GraphQL doesn't have mutation option - Stack Overflow

I'm new to Hasura. I just setup Hasura and connect it with MongoDB.I follow the instruction accor

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 badge
Add a comment  | 

1 Answer 1

Reset to default 0

Its 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/

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742388078a4434463.html

相关推荐

  • mongodb - Hasura GraphQL doesn't have mutation option - Stack Overflow

    I'm new to Hasura. I just setup Hasura and connect it with MongoDB.I follow the instruction accor

    17小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信