-
Notifications
You must be signed in to change notification settings - Fork 124
[gql_websocket_link] TransportWebSocketLink does not reconnect when graphql server disappears #407
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
Comments
There are options related to auto reconnects in the TransportWsClientOptions class. |
I can confirm this is not working. Here is the error thrown:
|
I found the error. is in this code:
It assumes that if socket.closeCode is not null then both socket.closeCode and socket.closeReason are available but that's not the case. If I stop the server program I receive code:1002 and reason = null to fix this you should either make reason optional in LikeCloseEvent or put an empty string if closeReason is null.
|
@knaeckeKami : Will this be taken up? |
@bverhagen I made this PR that fixes the problem: #418 and we already use it in closed beta with some clients. No complains so far. You'll need to configure it like this
Basically this PR adds |
Yes. Sorry, I have a lot going on at the moment, so triage is slow. Will get better soon. In the mean time, you can use the fork from the PR. |
I use the graphql-transport-ws as the connection Link for a Ferry-based grqphl subscription, pretty much as is done in Ferry examples, only with the http link replaced by a ws one:
During development, I regularly restarted the graphql-server. As the README for gql_websocket_link reads:
This link support autoReconnect and will resubscribe after reconnecting.
, I expected the gql_websocket_link-based graphql client to automatically reconnect again after such a restart. However, it does not seem to do that.The graphql server only supports the
graphql-transport-ws
protocol. Looking further in the API reference, I am only able to find theautoReconnect
configuration option for theWebSocketLink
class. Does theTransportWebSocketLink
already support a similar autoReconnect feature? If so, can you point me to an example or the relevant configuration options?The text was updated successfully, but these errors were encountered: