howtographql / graphql-js

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

Node.js + GrapQL Error #65

Closed LOGANLEEE closed 4 years ago

LOGANLEEE commented 4 years ago

Page: https://www.howtographql.com/graphql-js/6-authentication/

mutation {
  post(
    url: "www.graphqlconf.org"
    description: "An awesome GraphQL conference"
  ) {
    id
  }
}
{
  "data": null,
  "errors": [
    {
      "message": "Variable '$data' expected value of type 'LinkCreateInput!' but got: {\"url\":\"www.graphqlconf.org\",\"description\":\"An awesome GraphQL conference\",\"postedBy\":{\"connect\":{\"id\":\"cjyx7ckbt000l0766ugilpppy\"}}}. Reason: 'postedBy' Field 'postedBy' is not defined in the input type 'LinkCreateInput'. (line 1, column 11):\nmutation ($data: LinkCreateInput!) {\n          ^",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "post"
      ]
    }
  ]
}

I just did try on GraphQL server that I cloned from this repo.

shepardo commented 4 years ago

Looks like a misconfiguration, but what was the fix?