nicolaslopezj / atom-graphql-autocomplete

Autocomplete and lint from a GraphQL endpoint in atom.
MIT License
48 stars 7 forks source link

No Authentication? #17

Closed leonschwanitz closed 4 years ago

leonschwanitz commented 6 years ago

Unfortunately I can't use this tool, because headers have to be passed. Can you include an option for this? :)

elitan commented 5 years ago

You can set headers in the .graphqlrc.

Ex:

{
  "request": {
    "url": "http://localhost:8082/v1alpha1/graphql",
    "headers": {
      "Authorization": "Bearer <token>"
    }
  }
}

Ex for Hasura

{
  "request": {
    "url": "http://localhost:8082/v1alpha1/graphql",
    "headers": {
      "x-hasura-admin-secret": "admin-secret",
      "x-hasura-user-role": "user"
    }
  }
}