TanStackT
TanStack16mo ago
15 replies
urgent-maroon

should I use getQueryData in this use case?

Hey,

I have multiple calls to a same useQuery hook, I have set a staletime to 5000ms because I need to refecth the data sometimes, but in one place of my app, I only want to get the data from the cache without fire an api call no matter what (even if the data is stale), I know that some data will be in the cache when I reach this point, should I use getQueryData in that case?
Was this page helpful?