Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

useQuery stays active causing refetch on resetStore #3304

Closed
riccoski opened this issue Aug 2, 2019 · 1 comment
Closed

useQuery stays active causing refetch on resetStore #3304

riccoski opened this issue Aug 2, 2019 · 1 comment
Assignees
Milestone

Comments

@riccoski
Copy link

riccoski commented Aug 2, 2019

Intended outcome:

Once the component containing the query has been unmounted the query should become in active therefore when resetting the store with client.resetStore() the query shouldn't be refetched.

Actual outcome:

The component has been unmounted however the query stays active and is refetched when calling client.resetStore()

How to reproduce the issue:

https://github.com/riccoski/reset-store-refetch-error.git

using the repo. If you click the reset store button you will see the second console log appear.
If you replace the AllPeople component with AllPeopleComponent which uses the query component it will do as expected and not refetch the query

Version

System:
OS: macOS 10.14.5
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Browsers:
Chrome: 75.0.3770.142
Firefox: 38.0.5
Safari: 12.1.1
npmPackages:
apollo-cache-inmemory: ^1.5.1 => 1.6.2
apollo-client: ^2.5.1 => 2.6.3
apollo-link: ^1.2.11 => 1.2.12
react-apollo: 2.5.3 => 2.5.3

@hwillson hwillson self-assigned this Aug 3, 2019
@hwillson hwillson added this to the Release 3.0 milestone Aug 3, 2019
@hwillson
Copy link
Member

hwillson commented Aug 5, 2019

Thanks for reporting this @riccoski. The fix applied by #3273 also fixes this issue.

@hwillson hwillson closed this as completed Aug 5, 2019
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