You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I subscribe using websockets to Hasura Cloud it seems that I receive a keep alive message (GQL_CONNECTION_KEEP_ALIVE) before I have even sent the connection_init message (GQL_CONNECTION_INIT) to the server.
See image below:
This will cause a problem for some Graph QL clients that expects a connection_ack (GQL_CONNECTION_ACK) as first message.
This needs a bump. We are trying to use the Netflix dgs library and it also asserts this and the connection closes immediately when it receive the "ka" message before the "GQL_CONNECTION_INIT" message:
private fun doHandshake(): Mono<Void> {
return Mono.defer {
connection.set(client.connect().subscribe())
client.send(CONNECTION_INIT_MESSAGE)
client.receive()
.take(1)
.map { message ->
if (message.type == GQL_CONNECTION_ACK) {
message
} else {
throw GraphQLException("Acknowledgement expected from server, received $message")
}
}
.timeout(acknowledgementTimeout)
.then()
}
}
reactor.core.Exceptions$ErrorCallbackNotImplemented: graphql.GraphQLException: Acknowledgement expected from server, received OperationMessage(type=ka, payload=null, id=)
Caused by: graphql.GraphQLException: Acknowledgement expected from server, received OperationMessage(type=ka, payload=null, id=)
at com.netflix.graphql.dgs.client.WebSocketGraphQLClient$doHandshake$1$1.invoke(WebSocketGraphQLClient.kt:138)
at com.netflix.graphql.dgs.client.WebSocketGraphQLClient$doHandshake$1$1.invoke(WebSocketGraphQLClient.kt:134)
at com.netflix.graphql.dgs.client.WebSocketGraphQLClient.doHandshake$lambda$7$lambda$6(WebSocketGraphQLClient.kt:134)
When I subscribe using websockets to Hasura Cloud it seems that I receive a keep alive message (GQL_CONNECTION_KEEP_ALIVE) before I have even sent the connection_init message (GQL_CONNECTION_INIT) to the server.
See image below:
This will cause a problem for some Graph QL clients that expects a connection_ack (GQL_CONNECTION_ACK) as first message.
According to this document https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md it seems that the keep alive messages should be sent right after a connection_ack message and then periodically to keep the connection alive.
I would like Hasura to only send the keep alive messages after the connection has been made and a GQL_CONNECTION_ACK has been sent from the server.
The text was updated successfully, but these errors were encountered: