Does useQuery refetch invalidates cache?

1.2k Views Asked by At

I would like to know if the refetch function that the useQuery hook returns invalidates the cache, since I need to retrieve the newest data from the resolver after a mutation is triggered. Is refetch enough or should I invalidate the cache manually?

const { refetch } = useQuery(MY_QUERY)

1

There are 1 best solutions below

0
bryce On

This is possible, yes: client.refetchQueries supports an explicit updateCache param.