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

Subscription results always put in cache #3709

Closed
corvana-nbaker opened this issue Jul 19, 2018 · 1 comment
Closed

Subscription results always put in cache #3709

corvana-nbaker opened this issue Jul 19, 2018 · 1 comment

Comments

@corvana-nbaker
Copy link

Intended outcome:
Subscriptions made with a network-policy of "no-cache" should not be put into the Apollo cache.

Actual outcome:
The current store code puts all subscription results in the cache.

https://github.com/apollographql/apollo-client/blob/master/packages/apollo-client/src/core/QueryManager.ts#L913

https://github.com/apollographql/apollo-client/blob/master/packages/apollo-client/src/data/store.ts#L64

Versions
2.3.2

I worked around this with a subclass of the InMemoryCache which ignores cache writes coming from Subscription queries. This is not going to work for us much longer as we will be updating entities in the store with other subscriptions.

@hwillson hwillson self-assigned this Aug 2, 2018
hwillson added a commit that referenced this issue Aug 2, 2018
Currently `client.subscribe` calls are ignoring `no-cache`
fetch policy settings. These changes make sure `no-cache`
avoids writing subscription results to the cache.

Fixes #3709.
Fixes #3532.
@hwillson
Copy link
Member

hwillson commented Aug 2, 2018

This has been addressed in #3773. Thanks for pointing this out!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants