Skip to content

Adjusting the reconnection behaviour of WebSocketTransport #1333

@ketenshi

Description

@ketenshi

Hello!

I have a similar setup to #1224 but with the caveat of requiring the user to login again in some cases. With an invalid connectingPayload the server closes the connection immediately, and WebSocketTransport will keep retrying. The connectingPayload can be updated with the new authentication token after the user logs in again.

I would like to add in the ability to either prevent WebSocketTransport from reconnecting or be able to pause the websocket.

If we go the route of adjusting the reconnection behaviour I was thinking of adding something similar to HTTPNetworkTransportRetryDelegate but that kind of goes against the idea of passing reconnect as part of the initialization. So maybe having a getter/setter might be best.

Hope that I can get some guidance/feedback on this. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    apollo-websocketsquestionIssues that have a question which should be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions