T
TanStack2y ago
stormy-gold

setQueryData with marked data to no refetch data in specific time

- I have the same endpoint using by useMutation and useQuery - first app start I call useMutation and there is any data I would navigate to the screen then in the screen also have useQuery using the same endpoint as useMutation - I want to use setQueryData in useMutation onSuccess with marked query to not refetch when I navigate to the screen that using useQuery - is is possble to call setQueryData and marked the query as refetched ? - WHY I using like this ? -> I migrate from redux to useQuery but some how I want to save requesting to my
2 Replies
puzzled-coral
puzzled-coral2y ago
set a staleTime
stormy-gold
stormy-goldOP2y ago
Thx I have been resolved it using staleTime now ❤️

Did you find this page helpful?