-
Notifications
You must be signed in to change notification settings - Fork 323

Description
As of graphql/graphiql#1543, GraphiQL has embedded support for editing the request headers sent to the GraphQL endpoint. However, Spring GraphQL currently does not enable the feature even though its GraphQL fetcher should support it. Sending arbitrary request headers can be useful—for example—in adapting older codebases to Spring GraphQL and providing options for how to handle authorisation.
This should add a new tab to GraphiQL, to the right of "Query variables", called "Request headers." This tab accepts a JSON payload where the keys correspond to header names and the values correspond to header values.
Enabling the GraphiQL request header editor should be easy. It should only involve updating graphql-spring-boot-starter/src/main/resources/graphiql/index.html
. I've already checked out a local Spring GraphQL and implemented a proof-of-concept. If the decision is made to enable the request header, I would be willing to implement the change and send a polished pull request.
If enabling the feature for all configurations is too much, I would also support putting the feature behind a property,