I am using useSubscribe hook to connect to the backend, and all of the examples about unsubscribing from the that I saw is written in class components and they were using the old versions of Apollo. I just couldn't figure out that how to unSubscribe from an Apollo GraphQL Subscriptions Server. My code to subscribe:
const { data, loading } = useSubscription(COMMENTS_SUBSCRIPTION, {
variables: { uuid },
});