Skip to content

Enable GraphiQL header editor #136

@ghost

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions