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

Do not cache the GraphiQL query, at least in examples #269

Open
aantron opened this issue Apr 27, 2023 · 2 comments
Open

Do not cache the GraphiQL query, at least in examples #269

aantron opened this issue Apr 27, 2023 · 2 comments

Comments

@aantron
Copy link
Owner

aantron commented Apr 27, 2023

This led to the invalid issue #261, and, in general, can confuse users.

Is there a GraphiQL option that can disable caching?

@dangdennis
Copy link
Contributor

dangdennis commented Apr 30, 2023

Perhaps this is an opportunity to upgrade graphiql from 1.4.1 to 2.4.1, to keep up with their api docs. Versions < 1.4.3 are vulnerable to XSS attacks - link

Live example on netlify: link

Looking at graphiql 2.4.1's docs, if you follow drill down through their docs, there might be a couple viable options.

  1. Set .maxHistoryLength to 0 within in the HistoryContextProviderProps within the examples.
  2. Or just remind users to clear out the cache here? There's a button in the settings menu to clear cache.

Screenshot 2023-04-29 at 8 39 57 PM

@dangdennis
Copy link
Contributor

dangdennis commented Apr 30, 2023

If I understand correctly, if examples were able to set these properties on the javascript side, we'd have to expose the api in ocaml and ultimately string replace the inlined javascript object. this doesn't feel great.

An easier option is just insert some javascript in the examples to clear local storage.

I'll draft a PR just to upgrade graphiql.

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

2 participants