I am using useLazyQuery function and I don't know how to cancel/stop the request when user leave the component.
This is my code:
const [getPosts] = useLazyQuery(GET_POSTS);
useEffect(() => {
fetchPosts();
return () => {
// Leave component: How stop the request
}
}, []);
Thank
Best Regard