AEB-labs / graphql-weaver

A tool to combine, link and transform GraphQL schemas
MIT License
240 stars 20 forks source link

[FEATURE REQUEST]: Ability to include HTTP headers #50

Open go4cas opened 5 years ago

go4cas commented 5 years ago

I think it would be super useful if one could include headers when defining the endpoints.

Something like:

endpoints: [{
  namespace: 'model',
  typePrefix: 'Model',
  url: 'http://localhost:8080/graphql' // url to a GraphQL endpoint,
  headers: {
    'Authorization': 'Bearer **********************',
    'content-type': 'application/json'
  }
}

https://github.com/AEB-labs/graphql-weaver/issues/6 explains how to implement this by extending the HttpGraphQLClient, but I think it'll be a great addition to the core lib.

Yogu commented 5 years ago

I think that's a good idea, and also a good first issue. I'd love to merge a pull request that implements this. If you have question regarding this, feel free to ask.