is there a java/kotlin implementation of <https://...
# graphql
j
is there a java/kotlin implementation of https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md that any of you know of?
s
@Joe That example actually does not implement the apollo subscriptions transport. There is however an example from
graphql-java-servlet
https://github.com/graphql-java-kickstart/graphql-java-servlet/blob/b8c567abfdab7bd8ac2b36839be9c0382928539d/src/main/java/graphql/servlet/internal/ApolloSubscriptionProtocolHandler.java#L31 Here is some more details on how I found this out: https://github.com/ExpediaDotCom/graphql-kotlin/issues/155
j
great, thanks for the pointers. stumbles across the graphql-java-servlet example through the links that Dariusz sent but the direct link is appreciated.
s
@Joe With the latest release of
graphql-kotlin
1.0.0 we have support now for subscriptions and the
graphql-ws
subprotocol https://github.com/ExpediaGroup/graphql-kotlin
j
awesome. we'll probably stick with the implementation I posted mid august for a while, but very cool that this is provided. I noticed the websocket session class is from spring; will this only work on a spring based project? (ours is jetty websockets based and we run on dropwizard, fwiw). not sure if it'd be worth abstracting that out so that the core subscription logic could be used regardless?
s
It is tied to spring since we run on the Webflux websockets. At the moment I don’t think we are going to split it out since handling the websocket protocol will be dependent on your server framework, however I am sure the Apollo team would love to have a generic library in Java which provides the constant string values. We could both re-use that
👍 1