Fix subprotocol for subscriptions-transport-ws
See gh-256
This commit is contained in:
@@ -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.");
|
||||
|
||||
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user