T
TanStack16mo ago
fascinating-indigo

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
adverse-sapphire
adverse-sapphire16mo ago
set a staleTime
fascinating-indigo
fascinating-indigoOP16mo ago
Thx I have been resolved it using staleTime now ❤️

Did you find this page helpful?