Ping/pong implementation with Apollo Server Express #278
-
We noticed that setting up the subprotocol ping/pong example is just for when using this library on its own. We've found it very difficult to try and figure it out ourselves. We started with the example code from here. We're able to follow the example up until it's deriving logic and message types from the graphql-ws server, at which point the Express backend doesn't seem to give us the control needed to direct messages appropriately. Is it even possible to set up the ping/pong messages with an Apollo Server Express configuration? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Please read #231 (comment) and #231 (reply in thread) in detail first (and optionally about why the client doesn't need to ping the server: #117 (comment)), before proceeding with subprotocol pings/pongs. TL;DR you most probably do not need them.
Yes. You have to make your own |
Beta Was this translation helpful? Give feedback.
Please read #231 (comment) and #231 (reply in thread) in detail first (and optionally about why the client doesn't need to ping the server: #117 (comment)), before proceeding with subprotocol pings/pongs.
TL;DR you most probably do not need them.
Yes. You have to make your own
graphql-ws
WebSocket server as showcased in the "server usage with ws and subprotocol pings and pongs" recipe and use it instead of theuseServer
in your Apollo Server.