graphql-go / graphql

An implementation of GraphQL for Go / Golang
MIT License
9.86k stars 838 forks source link

How to read frontend error messages? #619

Closed mpldr closed 2 years ago

mpldr commented 2 years ago

Hello, my schema gives me this error:

{
  "data": null,
  "errors": [
    {
      "message": "Unknown type \"__Type\".",
      "locations": [
        {
          "line": 20,
          "column": 24
        }
      ]
    },
    {
      "message": "Unknown type \"__InputValue\".",
      "locations": [
        {
          "line": 53,
          "column": 26
        }
      ]
    },
    {
      "message": "Unknown type \"__Type\".",
      "locations": [
        {
          "line": 60,
          "column": 23
        }
      ]
    }
  ]
}

My main point of confusion is on how to "use" this error message. What lines is that referring to? In what file? What on earth is __Type? Some hidden built-in?

Sorry if this sounds somewhat desperate… I am at this point about an hour into just trying random stuff hoping to fix it.

halfnibble commented 2 years ago

@mpldr It would be helpful if you posted your request data and the relevant Go code.

Also, this is probably more suited for StackOverflow unless you have a particular bug to report. I recommend you create a StackOverflow question, link it here, and then close this GitHub issue.

mpldr commented 2 years ago

I think there was an issue with my scheme, which for some reason made it misbehave… writing pretty much the same out as a scheme and it worked fine again…