-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable GraphiQL header editor #136
Comments
We haven't completely made up our mind about the extent of our GraphiQL integration (see #20): should we just ship a very basic version and just update it as GraphiQL releases new versions? Should we consider an in-depth integration with a dedicated module that we build? In any case, this sounds like a good idea - even for the default use case. Feel free to submit a PR, I can assist with a review/some polishing. This issue will be closed and superseded when your PR is created. Thanks! |
Closing in favor of #142 |
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,
The text was updated successfully, but these errors were encountered: