Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientError: Mutation failed due to permission errors #48

Open
khanhthanhdev opened this issue Sep 18, 2022 · 1 comment
Open

ClientError: Mutation failed due to permission errors #48

khanhthanhdev opened this issue Sep 18, 2022 · 1 comment

Comments

@khanhthanhdev
Copy link

'''error - ClientError: Mutation failed due to permission errors: {"response":{"errors":[{"message":"Mutation failed due to permission errors","extensions":{"code":"403","failedActions":[{"action":"create","model":"Comment","stage":"DRAFT"},{"action":"update","model":"Post","stage":"DRAFT"}]}}],"data":null,"extensions":{"requestId":"cl87cg1f45rwc0ezs00jhmkep"},"status":403,"headers":{}},"request":{"query":"\n mutation CreateComment($name: String!, $email: String!, $comment: String!, $slug: String!) {\n createComment(data: {name: $name, email: $email, comment: $comment, post: {connect: {slug: $slug}}}) { id }\n }\n ","variables":{"name":"Trần Khánh Thành","email":"thanhkt27507@gmail.com","comment":"test comment","slug":"twg-la-gi"}}}
at D:\test-blog\project_graphql_blog\node_modules\graphql-request\dist\index.js:254:31
at step (D:\test-blog\project_graphql_blog\node_modules\graphql-request\dist\index.js:63:23)
at Object.next (D:\test-blog\project_graphql_blog\node_modules\graphql-request\dist\index.js:44:53)
at fulfilled (D:\test-blog\project_graphql_blog\node_modules\graphql-request\dist\index.js:35:58)'''

I clone project and follow the video at 2:47:00 . How to fix this error. I'm trying to fix this bug

@ariyannandi
Copy link

You need to give all the required permissions to your CMS token. It fixed the issue for me. Go to settings > Permanent Auth Tokens and then edit the token you are using and then give the permissions. Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants