react-apollo-hooks icon indicating copy to clipboard operation
react-apollo-hooks copied to clipboard

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

Open anantkamath opened this issue 5 years ago • 0 comments

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

anantkamath avatar Apr 06 '20 04:04 anantkamath