Fix subprotocol for subscriptions-transport-ws

See gh-256
This commit is contained in:
Minsu Lee
2022-01-15 13:25:30 +09:00
committed by rstoyanchev
parent d8d8229a33
commit ab29a96a8d
2 changed files with 4 additions and 4 deletions

View File

@@ -71,7 +71,7 @@ public class GraphQlWebSocketHandler implements WebSocketHandler {
private static final Log logger = LogFactory.getLog(GraphQlWebSocketHandler.class);
private static final List<String> SUB_PROTOCOL_LIST =
Arrays.asList("graphql-transport-ws", "subscriptions-transport-ws");
Arrays.asList("graphql-transport-ws", "graphql-ws");
static final ResolvableType MAP_RESOLVABLE_TYPE =
ResolvableType.forType(new ParameterizedTypeReference<Map<String, Object>>() {});
@@ -127,7 +127,7 @@ public class GraphQlWebSocketHandler implements WebSocketHandler {
@Override
public Mono<Void> handle(WebSocketSession session) {
HandshakeInfo handshakeInfo = session.getHandshakeInfo();
if ("subscriptions-transport-ws".equalsIgnoreCase(handshakeInfo.getSubProtocol())) {
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.");

View File

@@ -74,7 +74,7 @@ public class GraphQlWebSocketHandler extends TextWebSocketHandler implements Sub
private static final Log logger = LogFactory.getLog(GraphQlWebSocketHandler.class);
private static final List<String> SUB_PROTOCOL_LIST =
Arrays.asList("graphql-transport-ws", "subscriptions-transport-ws");
Arrays.asList("graphql-transport-ws", "graphql-ws");
private final WebGraphQlHandler graphQlHandler;
@@ -110,7 +110,7 @@ public class GraphQlWebSocketHandler extends TextWebSocketHandler implements Sub
@Override
public void afterConnectionEstablished(WebSocketSession session) {
if ("subscriptions-transport-ws".equalsIgnoreCase(session.getAcceptedProtocol())) {
if ("graphql-ws".equalsIgnoreCase(session.getAcceptedProtocol())) {
if (logger.isDebugEnabled()) {
logger.debug("apollographql/subscriptions-transport-ws is not supported, nor maintained. "
+ "Please, use https://github.com/enisdenjo/graphql-ws.");