Open Mr-Goldberg opened 2 months ago
Well, ok, I found the issue 😅
I've mistakenly used .graphql_ws
instead of .graphql_transport_ws
in the iOS client.
However, this is a counterintuitive option, as the correct options for the Apollo Server and Apollo Studio Explorer are graphql-ws
, but for iOS, it is vice versa.
It would be great if you could address this issue - maybe by providing:
Also, I want to thank the team - this is a great product! It was easy to set up and a pleasure to use! Before this issue 😅
Issue Description
Hi, everyone!
I was following your guide to build server that supports subscriptions. The guide clearly says that server protocol will be
graphql-ws
. But I've found that the server protocol isgraphql-transport-ws
somehow.I was struggling with this error on iOS side while trying to use subscription:
WebSocketError(payload: nil, error: Optional(ApolloWebSocket.WebSocket.WSError(type: ApolloWebSocket.WebSocket.WSError.ErrorType.protocolError, message: "Subprotocol not acceptable", code: 4406)), kind: ApolloWebSocket.WebSocketError.ErrorKind.networkError)
Then I've added logs to the socket-server, and got a log output every second (3 outputs included):
Accidentally I've switched the protocol in iOS to
.graphql_transport_ws
and IT WORKED! Also, there was only the single output from socket logs (which included the protocol name):So, the question is: Am I doing something wrong (probably server-side), or is there an issue with the Server code, which somehow uses the old
.graphql_transport_ws
protocol?Here is the minimal Server code: Sandbox
I was not assembling an iOS example, as there may have been an obvious error in my server code. But here's how I am assembling the Apollo client:
Link to Reproduction
Sandbox
Reproduction Steps
Set up the Apollo server by this guide and try to use a subscription.
Expected result: Subscription is working with the
graphql-ws
protocolActual result:
graphql-transport-ws
protocol)