Describe the bug
Is it possible that this (#1797) has regressed? I'm on ^3.12.1 and running into exactly this.
When calling refetch, there does not seem to be a way to respect enabled. Manually refetching the query always goes through. This by itself is not an issue, but that means that the only way to use a refetch-but-respect-query-options is to:
- use
queryClient directly
- copy the
enabled logic and execute it before calling refetch
When the refetch is in flight, it will actually keep retrying the query too if the query fails. This can be overcome by copying the enabled logic once more to the retry function.
Expected behavior
There is a way to refetchIfEnabled.
Perhaps this can be added to the optional options of refetch as a flag?
Describe the bug
Is it possible that this (#1797) has regressed? I'm on^3.12.1and running into exactly this.When calling
refetch, there does not seem to be a way to respectenabled. Manually refetching the query always goes through. This by itself is not an issue, but that means that the only way to use a refetch-but-respect-query-options is to:queryClientdirectlyenabledlogic and execute it before callingrefetchWhen the refetch is in flight, it will actually keep retrying the query too if the query fails. This can be overcome by copying the enabled logic once more to the
retryfunction.Expected behavior
There is a way to
refetchIfEnabled.Perhaps this can be added to the optional options of
refetchas a flag?