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

Is client.cache.reset() a public function? #3813

Closed
anthonator opened this issue Aug 14, 2018 · 4 comments
Closed

Is client.cache.reset() a public function? #3813

anthonator opened this issue Aug 14, 2018 · 4 comments
Assignees

Comments

@anthonator
Copy link

Is client.cache.reset() part of the public API? I've seen people suggesting this as an alternative to client.resetStore(). I haven't seen this in any official Apollo documentation. Feel free to point me in the right direction if I missed it.

Issues mentioning client.cache.reset():

#2919 (comment)
#2411 (comment)
#1849 (comment)
#1552 (comment)
#1419 (comment)
#1364 (comment)
#621 (comment)

@hwillson hwillson self-assigned this Sep 5, 2018
hwillson added a commit that referenced this issue Sep 5, 2018
A new `clearStore` method has been added, that will remove all
data from the store. Unlike `resetStore`, it will not refetch
active queries after removing store data.

Fixes #2411.
Fixes #2774.
Fixes #3539.
Fixes #3813.
hwillson added a commit that referenced this issue Sep 5, 2018
* Add `clearStore` method

A new `clearStore` method has been added, that will remove all
data from the store. Unlike `resetStore`, it will not refetch
active queries after removing store data.

Fixes #2411.
Fixes #2774.
Fixes #3539.
Fixes #3813.

* Changelog update

* Add `clearStore` to API docs

* Add `clearStore` reference to authentication docs

* Add `clearStore` reference to caching docs
@hwillson
Copy link
Member

hwillson commented Sep 5, 2018

#3885 adds a new client.clearStore() method to the public API, that will clear the store without refetching active queries. Please use this new method instead of client.cache.reset(). Thanks!

@anthonator
Copy link
Author

Will this trigger the onResetStore?

@hwillson
Copy link
Member

hwillson commented Sep 5, 2018

@anthonator No, as of right now it's completely separate.

@ghost
Copy link

ghost commented Sep 22, 2018

does it refresh all components, or does the library that interacts with components have to change something for that?

@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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants