Using useQuery, setInterval and useEffect in the same component - TanStack