Open tintin10q opened 8 months ago
Be wary of the confusing names of the protocols and libraries...
There are 2 graphql subscriptions protocols over WebSocket:
graphql-ws
(implemented by the subscriptions-transport-ws
library): https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.mdgraphql-transport-ws
(implemented by the graphql-ws
library), that you pointed toWhich one to use depends what your gql server implements and whether you are limited by 3rd party libs that support one or the other, e.g. older versions of apollo client don't support graphql-transport-ws
, or Zeus doesn't support graphql-ws
. Note that on the server-side, you can support both of them (it might require a fair amount of debugging to get it right depending on your server's solution).
If you use Zeus generated client, then you have to support graphql-transport-ws
on your server-side (I haven't looked at stucco, I don't how standard/non-standard it is).
The first part of this article does a good job presenting the differences between both protocols.
Hey there, I have generated a client with
--subscriptions graphql-ws
. I am also using hasura subscription and I want to migrate from my apolo subscription client to the zeus one.When I look at the messages that this client generates I get:
But the old apolloclient actually sends a message like this:
So instead of a message with type subscribe it sends a message with type start.
I looked in the protocol description: https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md
But the zeus actually seems to be the right one. There is no mention of a start message. So it seems that apollo used a different protocol.
So can someone please tell me what protocol the protocol using the start message is. I tried to look but I couldn't find it.