Using useQuery result in custom hook - TanStack