graphiql
graphiql copied to clipboard
[graphiql] Headers disappear with persistent enabled
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
The default behavior (at least on 3.0.0) seems broken:
- Set Persist headers to On in the UI Add headers
- Reload, observe that headers are persisted, but that the setting has reverted
- Reload again, observe that headers have now vanished
Expected Behavior
Headers should persist if this option is enabled by the user, and the option should stick.
Steps To Reproduce
See description.
Environment
- GraphiQL Version: 3.0.0
- OS: any
- Browser: any
- Bundler:
-
react
Version: -
graphql
Version:
Anything else?
No response
coming back to this asap, hopefully this weekend, just noting where I probably broke this for later: https://github.com/graphql/graphiql/pull/3371
I thought I had implemented an e2e test for this?
fwiw, we just need to make this enabled by default, this was planned for the last major version as a breaking change but it definitely should happen for the next. the only reason we don't is because of the security issue
If possible, fix the header saving
A PR is welcome here, as the end to end tests seem to show this working, and my grant scope of work has me focused on the LSP server & vscode extensions in this repo
in the meantime, if you want this to be enabled by default for users, specify shouldPersistHeaders prop
(Moving my comment from the original issue)
I see that Persist headers
in UI also goes back to Off
upon refresh. In other words, the Persist headers
setting isn't persisted across refreshes. That also probably explains why headers are restored on the first reload but lost on the second.