Skip to content

How to ensure that no subscription response goes undelivered ? #175

Answered by enisdenjo
97amarnathk asked this question in Q&A
Discussion options

You must be logged in to vote

Hey hey, lets jump straight to it. graphql-ws is designed to not swallow anything, it will fail if you try sending a message over a closed socket. Therefore, you will be fully aware of any untimely sends and are free to implement your own WS server that is more robust in this area through makeServer.

Check the "Server usage with ws" recipe which showcases a commented, super simple, integration of ws with graphql-ws.

  • One way would be to simply listen for a socket close and let your system know it is trying to send over a gone client. You're free to alter your system's behaviour with this flag however you want.
  • Another way would be to catch sends on a closed socket using the cb argument in o…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@97amarnathk
Comment options

@enisdenjo
Comment options

@97amarnathk
Comment options

@enisdenjo
Comment options

@theogravity
Comment options

Answer selected by 97amarnathk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants