TanStackT
TanStackโ€ข2y agoโ€ข
18 replies
brilliant-lime

useQuery always refetching

Hi ๐Ÿ‘‹ I'm new to using useQuery and I think I already follow the instructions from the documentation, so here is the snippet of my code,

const { data, isLoading, error } = useQuery({ queryKey: ["financialSankey", ticker], queryFn: () => fetchReport(ticker), staleTime: 1000 * 60 * 60, // 1 hour refetchInterval: false, refetchOnMount: false, refetchOnWindowFocus: false, refetchOnReconnect: false, });

as you can see I already try to set the staleTime and also set all the refetch options to
false
. But when I check on the network tab, it always refetching. Is there something wrong with my understanding?
Was this page helpful?