-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
Describe the bug
The docs (line 155) describe the refetch function returned by useQuery as having the signature refetch: Function({ force, throwOnError }) => void. This doesn't seem to be true, as refecth actually does not accept any argument at all.
Moreover, that same section of the docs say that the default behavior of refetch is fetching the query only if it is stale (which can supposedly be bypassed by passing {force: true}). This isn't right either. Calling refetch(with no arguments) always refetches de query, disregarding its status.
Expected behavior
I'd love to see refetch behaving as described in the docs, but if that cannot be easily fixed, it would be necessary to update the docs accordingly. So, refetch should be typed as refetch: () => void and the description should say that it always refetches the query (stale or not).
Additional context
I'm working in React Native, just in case. Still, browsing the source code didn't lead me to the behavior described in the docs.