Alternative to onSuccess in useQuery - TanStack