Question about ensureQueryData
I have the following beforeLoad in tanstack router
On the queryClient i have a default
Switching to:
Seems to take in consideration the staleTime
Thank you!
(Notice i do not use that query in another place. I saw that if i also have a "useSuspenseQuery" in combination with the ensureQueryData in the loader for different api calls, that one works. So i guess the useSuspenseQuery invalidates ( triggers a refetch ) if the query is stale )
On the queryClient i have a default
staleTime: 1000 * 20, of 20 seconds. I noticed that the onboarding variable doesn't update if i navigate to a different page in the same _auth layout after 20 seconds. If there is data in the query cache, it will never fetch new data even if it is stale?Switching to:
Seems to take in consideration the staleTime
Thank you!
(Notice i do not use that query in another place. I saw that if i also have a "useSuspenseQuery" in combination with the ensureQueryData in the loader for different api calls, that one works. So i guess the useSuspenseQuery invalidates ( triggers a refetch ) if the query is stale )