TanStackT
TanStack7mo ago
9 replies
sacred-rose

[solved] useQuery ignores `retry: false` when `refetchInterval` is set

Title pretty much says it all. Here is my query:
  const drivesQuery = useQuery({
    queryKey: ["drives"],
    retry: false,
    queryFn: () => window.electron.GetVolume(),
    // refetchInterval: 5,
  });
As soon as I uncomment refetchInterval: 5, the query will indefinitely retry (as fast as it can) instead of simply stopping after the first error, which currently always happens (expected).
What am I doing wrong? I do want the query to refetch, but only if there were no errors.
Was this page helpful?