howtographql / graphql-js

https://www.howtographql.com/graphql-js/1-getting-started/
363 stars 126 forks source link

Vote Mutation error #64

Open Baystef opened 5 years ago

Baystef commented 5 years ago

I tried running the mutation.Vote query in the graphQL playground, but I keep getting an error, My code looks exactly the same as the one on the repo. Here is my graphQL query

mutation {
    vote(linkId: "cjx6dqv0qpywy0b51522a0bju") {
         link {
             id 
             url
             description
          }
          user { 
              name
               email
          }
     }
}

But I keep getting these error below

{
  "data": {
    "vote": null
  },
  "errors": [
    {
      "message": "Variable '$data' expected value of type 'VoteCreateInput!' but got: {\"user\":{\"connect\":{\"id\":\"cjx6dnszyemtp0b611ur27uqz\"}},\"link\":{\"connect\":{\"id\":\"cjx6dqv0qpywy0b5152za0bju\"}}}. Reason: 'Link' Expected non-null value, found null. (line 1, column 11):\nmutation ($data: VoteCreateInput!) {\n          ^",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "vote"
      ]
    }
  ]
}