How to NOT refetch/retry failed queries?
Hello, I have some problems when fetching pararell queries. I send n number of queries and some of them might(and do) fail. The issue is that for some reason, these failed queries OCCASIONALLY get "pending" status, which is bad because I render loading state when at least one of queries is pending. In browser's network tab I see that I refetch these previously failed requests, but don't wanna do that. How can I achieve it?
What might be the cause of that?
3 Replies
foreign-sapphire•2y ago
Maybe checkout query devtools
itchy-amethyst•17mo ago
- make sure retry is globally set to false
- React Query caches the results of successful queries and considers them as "stale" after a certain period of time (default is 0), you can try setting staleTime to someth that doesn't make the queries stale too quick
conscious-sapphire•13mo ago
tried this already but still refetching when the request failed