ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

Error: endpoint data missing from graphql config when using gatsby with vscode

Categories: Gatsbyjs GraphQL VSCode

Most likely you installed the GraphQL extension for VSCode to add syntax highlighting to your graphql queries. Then you noticed the codelens 'Execute Query' and got one of the following errors:

  • Error: endpoint data missing from graphql config
  • ConfigNotFoundError: ".graphqlconfig" file is not available in the provided config directory

To solve this issue, you need to create a .graphqlconfig file in your project root folder.

Tricky part is figuring out what you need to put in there for using Gatsby.

So here is an example:

{
  "name": "Gatsby Schema",
  "schemaPath": "schema.graphql",
  "extensions": {
    "endpoints": {
      "Remote GraphQL Endpoint": {
        "url": "http://localhost:8000/___graphql",
        "headers": {
          "user-agent": "JS GraphQL"
        },
        "introspect": true
      }
    }
  }
}