Do not cache the GraphiQL query, at least in examples
aantron opened this issue · 2 comments
This led to the invalid issue #261, and, in general, can confuse users.
Is there a GraphiQL option that can disable caching?
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.
- Set
.maxHistoryLength
to 0 within in theHistoryContextProviderProps
within the examples. - Or just remind users to clear out the cache here? There's a button in the settings menu to clear cache.
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.