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

GraphQL queries with token shouldn't be cached #5389

Closed
jasonvarga opened this issue Mar 2, 2022 · 0 comments · Fixed by #5693
Closed

GraphQL queries with token shouldn't be cached #5389

jasonvarga opened this issue Mar 2, 2022 · 0 comments · Fixed by #5693

Comments

@jasonvarga
Copy link
Member

Bug description

When using a front-end framework to re-send the token back to GraphQL for live preview, if you have caching enabled, it's going to serve the cached response each time and not show the live preview edit.

You could send the statamic-live-preview random string to the URL as well, but the default GraphQL cache driver doesn't look at the query string.

How to reproduce

  • Enable GraphQL caching
  • Hit a GraphQL endpoing with a live preview token
  • Update the entry in live preview
  • See no change

Logs

No response

Versions

3.3.0 beta 3

Installation

Other (please explain)

Additional details

DefaultCache's getCacheKey should probably include all the query string variables in the key.

Also, we should just disable caching if it's a tokenized request.

@jackmcdade jackmcdade changed the title 3.3 GraphQL queries with token shouldn't be cached 3.3 beta – GraphQL queries with token shouldn't be cached Mar 3, 2022
@jasonvarga jasonvarga changed the title 3.3 beta – GraphQL queries with token shouldn't be cached GraphQL queries with token shouldn't be cached Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants