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

Currently can't set headers to persist in graphiql #1776

Closed
alexdibattista opened this issue Jan 17, 2022 · 3 comments
Closed

Currently can't set headers to persist in graphiql #1776

alexdibattista opened this issue Jan 17, 2022 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@alexdibattista
Copy link

alexdibattista commented Jan 17, 2022

What happened?

After adding a header to Graphiql and refreshing the page the header is removed from request headers section. Since we are using a auth header we can't load the documentation explorer which is helpful for local development.

What did you expect?

The header to persist when refreshing the page.

Minimal graphql.schema and models to reproduce

  • not needed.

versions

  • gqlgen version 0.15.1
  • go version 1.17.5

It would be nice to have a way to set the prop shouldPersistHeaders with graphiql for development purposes.

@alexdibattista alexdibattista changed the title graphiql is not persisting headers Currently can't set headers to peresist in graphiql Jan 17, 2022
@StevenACoffman StevenACoffman added help wanted Extra attention is needed good first issue Good for newcomers labels Jan 25, 2022
@StevenACoffman
Copy link
Collaborator

So this is set in https://github.com/99designs/gqlgen/blob/master/graphql/playground/playground.go#L46

And I think it is something like this:

        React.createElement(GraphiQL, {
          fetcher: graphQLFetcher,
          headerEditorEnabled: true,
          shouldPersistHeaders: true
        }),

@StevenACoffman StevenACoffman changed the title Currently can't set headers to peresist in graphiql Currently can't set headers to persist in graphiql Jan 26, 2022
@StevenACoffman
Copy link
Collaborator

@alexdibattista Can you test if the PR #1856 works for you?

@alexdibattista
Copy link
Author

@StevenACoffman Sorry, I missed your reply. I tested against master and it works. Thanks for the quick turnaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants