spring-projects / spring-graphql

Spring Integration for GraphQL
https://spring.io/projects/spring-graphql
Apache License 2.0
1.53k stars 306 forks source link

Subscription not working with graphql-ws #1041

Closed klingen-m closed 3 months ago

klingen-m commented 3 months ago

https://github.com/spring-projects/spring-graphql/blob/66cece6a2c8c378b761d6d03a8b50f4004b06679/spring-graphql/src/main/java/org/springframework/graphql/server/webflux/GraphQlWebSocketHandler.java#L130C3-L136C4

if ("graphql-ws".equalsIgnoreCase(handshakeInfo.getSubProtocol())) {
    if (logger.isDebugEnabled()) {
        logger.debug("apollographql/subscriptions-transport-ws is not supported, nor maintained. "
                        + "Please, use https://github.com/enisdenjo/graphql-ws.");
    }
    return session.close(GraphQlStatus.INVALID_MESSAGE_STATUS);
}

Narrowed it down to above lines..why are graphql-ws connections closed? Shouldn't it only close on former "subscriptions-transport-ws"?

I'm using Version:1.3.2

Maybe @amondnet or @rstoyanchev can help

bclozel commented 3 months ago

As stated in the reference documentation for our websocket transport support, we only support the graphql-ws variant with the "graphql-transport-ws" sub-protocol.

If you have other questions, please use StackOverflow. Thanks!