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

Refetching useQuery with skip: true results in a network request but does not update data #221

Open
anantkamath opened this issue Apr 6, 2020 · 0 comments

Comments

@anantkamath
Copy link

anantkamath commented Apr 6, 2020

To reproduce

const {refetch, data} = useQuery(myQuery, {skip: true})
refetch().then(refetchResponse => console.log(refetchResponse.data))

What happens?

  1. A network request is made but data remains undefined
  2. refetchResponse.data contains the expected response

Thus there is an inconsistency where data is not updated, but updated data is still available via the promise returned by refetch.

Using v3.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant