Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is My Apollo Client Connected to the Server? #24

Open
erosval opened this issue Feb 12, 2020 · 1 comment
Open

Is My Apollo Client Connected to the Server? #24

erosval opened this issue Feb 12, 2020 · 1 comment

Comments

@erosval
Copy link

erosval commented Feb 12, 2020

Do you think it is possible to check if a connection "is active" if you are using type WebSocketLink connections?

Using Subscriptions I would need to know if the connection to the server drops but I don't find any simple way to do it. I've only found this example: Is My Apollo Client Connected to the Server?.

I think it can be an excellent enhancement, anyway, nice idea and nice component!

@amannn
Copy link
Member

amannn commented Feb 17, 2020

Hmm, I'm not sure if this library is in a good position to detect this. As mentioned in the blog article you have to set up event handlers on the SubscriptionClient instance.

So I guess what you have to do is create the instance, set up the listeners and pass that instance to apollo-link-ws.

This library acts as another link in the chain. I don't know of any way how you can look through existing links to find the subscription client …

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants