Skip to content

Commit d85592e

Browse files
committed
Allow configuration of websocket by passing configuration fix #157
1 parent 31aaebf commit d85592e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

graphql-java-servlet/src/main/java/graphql/kickstart/servlet/GraphQLWebsocketServlet.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,19 @@ public class GraphQLWebsocketServlet extends Endpoint {
6363
private final AtomicBoolean isShutDown = new AtomicBoolean(false);
6464
private final Object cacheLock = new Object();
6565

66+
public GraphQLWebsocketServlet(GraphQLConfiguration configuration) {
67+
this(configuration, null);
68+
}
69+
70+
public GraphQLWebsocketServlet(GraphQLConfiguration configuration, Collection<SubscriptionConnectionListener> connectionListeners) {
71+
this(
72+
configuration.getGraphQLInvoker(),
73+
configuration.getInvocationInputFactory(),
74+
configuration.getObjectMapper(),
75+
null
76+
);
77+
}
78+
6679
public GraphQLWebsocketServlet(
6780
GraphQLInvoker graphQLInvoker,
6881
GraphQLSubscriptionInvocationInputFactory invocationInputFactory,

0 commit comments

Comments
 (0)