Skip to content

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

@anantkamath

Description

@anantkamath

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions