It would be great to have functionality to add custom headers for authorisation purposes within GraphQL.
I'm working on the PR at the moment.

Hi @eugenehp - thanks for the suggestion! We have discussed a custom header feature request in the past: #114 for one of the examples. Would it be more plausible for your use case to define a custom graphQLFetcher that deals with custom headers?
Hi @asiandrummer yes, absolutely. I'll take a look into it. I already played with the example directory and got it working. What would be the best way to define custom graphQLFetcher to work with the HTTP headers?


I think you may have already looked at it, but refer to this example from the example code we have. It defines a custom graphQLFetcher with a set of custom headers.
The main reason why we'd prefer this is because we want GraphiQL to be independent of the network configurations. See #96 and #59 for more conversations about this please.
@asiandrummer Thanks Hyo. I'm moving this here so we can have a way to place GraphiQL and custom versions of it as middleware.
how i can use the middleware to input the headers ? I've tried plugins for chrome and app for mac, and none of them is working ? it's a pity no input headers in the original graphiql, looks dogmatic decision
@webmobiles it's difficult to answer your question without knowing which middleware you're talking about and the plugins you've tried/without mentioning them. I heard that GraphiQL for Mac already supports a custom header, but have not seen it/used it myself.
I think Lee's comment here, in addition to multiple responses we've given to explain this, best describes why we wouldn't support custom headers in GraphiQL.
In many cases, we're using GraphiQL for debugging an API server in development. I think it's required that adding a field to the interface rather than change the behaviour programmatically.
@balthild You can checkout https://github.com/imolorhe/altair as well.
@imolorhe Great project!
Most helpful comment
I'm working on the PR at the moment.