adrianhajdin / project_graphql_blog

With featured and recent posts, categories. full markdown articles, author information, comments, and much more, this fully responsive CMS Blog App is the best Blog Application that you can currently find on YouTube. And what's best of all is that you and your clients can manage the blog from a dedicated Content Management System.
https://jsmastery.pro
1.47k stars 347 forks source link

400 error on GQL request for getComments() #6

Closed tatianajiselle closed 2 years ago

tatianajiselle commented 2 years ago
Unhandled Runtime Error

Error: input:1: Field "post" is not defined by type CommentWhereInput. Did you mean NOT?
: {"response":{"errors":[{"message":"input:1: Field \"post\" is not defined by type CommentWhereInput. Did you mean NOT?\n"}],"data":null,"extensions":{"requestId":"ckxi37prcpivc0b69etjss2ns"},"status":400,"headers":{"map":{"cache-control":"private, no-store","content-length":"179","content-type":"application/json"}}},"request":{"query":"\n    query GetComments($slug:String!) {\n      comments(where: {post: {slug:$slug}}){\n        name\n        createdAt\n        comment\n      }\n    }\n  ","variables":{"slug":"test-post-2"}}}

Appears to happen due to the post object as input to the gql query on the where clause. Still debugging, seems to happen when i pull down the gql project from github and change the .env to my token and cms url.

Wondering if i am missing a part of the setup for comments?

Thanks in advance.

Mansukh-jsx commented 2 years ago

How did you solve it?