Skip to content
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

Allow GraphiQL headers to be specified when constructing the playground handler #2739

Closed
mihaip opened this issue Jul 28, 2023 · 0 comments
Closed

Comments

@mihaip
Copy link
Contributor

mihaip commented Jul 28, 2023

The GraphiQL.createFetcher function supports an optional headers argument to allow HTTP headers that are sent when doing endpoint requests (see https://github.com/graphql/graphiql/blob/main/packages/graphiql-toolkit/docs/create-fetcher.md#headers). It would be nice if there was a way to configure this when creating it, ideally passed from the playground.Handler or similar Go endpoint. While headers can be edited in the UI, for our application we generate the necessary headers programmatically already, and being able to pass them in when creating the playground handler would save the developer a copy/paste step.

Happy to submit a PR to implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant