graphql-java-servlet icon indicating copy to clipboard operation
graphql-java-servlet copied to clipboard

Support of graphql-transport-ws GraphQL subscription protocol

Open andrey-nakin opened this issue 1 year ago • 11 comments

Hello!

Are there plans to implement graphql-transport-ws GraphQL subscription protocol?

The existing graphql-ws protocol is no longer maintained and even not supported in some products (for example, Tyk Gateway).

andrey-nakin avatar Jul 14 '22 17:07 andrey-nakin

Definitely, not sure yet when we'll be able to have it ready though.

oliemansm avatar Aug 17 '22 19:08 oliemansm

Any update on when graphql-transport-ws will be supported?

lnayer avatar Sep 08 '22 16:09 lnayer

Are there major changes required to support the sub-protocol? Or is it possible to just override method (possibly modifyHandshake) in GraphQLWebsocketServlet in the meantime, @oliemansm ?

The existing graphql-ws protocol has been unmaintained for ~5 years. So we're concerned about moving forward without a workaround.

sgrannan avatar Mar 29 '23 14:03 sgrannan

@oliemansm Do you start working for the temporary fix as @sgrannan proposed or you are starting to implement the graphql-transport-ws specs?

If it is the former one I can start (in my free time) to work on it

federicorispo avatar May 12 '23 13:05 federicorispo

I've started to work on the actual implementation. Hope to make some good progress and be able to merge early next week. Will keep you posted.

oliemansm avatar May 12 '23 13:05 oliemansm

There is a rather "slim" implementation of the graphql-transport-ws protocol in Kotlin...

https://github.com/Netflix/dgs-framework/blob/master/graphql-dgs-subscriptions-websockets/src/main/kotlin/com/netflix/graphql/dgs/subscriptions/websockets/WebsocketGraphQLTransportWSProtocolHandler.kt

@oliemansm do you have some news? wdyt of making it work with annotated @ServerEndpoint classes?

Like this...

@ServerEndpoint(value = "/graphql", subprotocols = "graphql-transport-ws")
public class MyGraphlWs extends BaseGraphQLTransportWs {

  @Inject private GraphQLConfiguration configuration;

  @OnOpen
  public void onOpen(Session session, EndpointConfig endpointConfig) {
   super.onOpen(session, endpointConfig);
  }

  @OnMessage // call super.onMessage
  @OnClose // call super.onClose
  @OnError // call super.onError

}


dherges avatar May 30 '23 10:05 dherges

Hi, is there any update or ETA on this? Thanks :)

utkarsh8028 avatar Aug 21 '23 11:08 utkarsh8028

@oliemansm May I ask if there's any update on this? Thank you so much!!!

williamwjs avatar Sep 06 '23 22:09 williamwjs

Any update on this @oliemansm ?

ItsNoHax avatar Dec 08 '23 15:12 ItsNoHax

Hate to be that guy but could we get an update? @oliemansm

The library we use for the current protocol is heavily outdated and we are looking to move to graphql-transport-ws protocol.

ItsNoHax avatar Mar 20 '24 11:03 ItsNoHax

@ItsNoHax the maintainers have given up on this project as a whole unfortunately. It is scrapped in favor or letting the Spring team take the lead on GQL implementations.

So my team moved over to spring-graphql and it was painful at first but mostly just for graphql subscriptions and the re-writing of unit tests. Took me about 2 weeks. I am not a fan of how opinionated the Spring GQL folks are in terms of negating some Spring Conventions / Mantras, but it works and is being improved.

sgrannan avatar Mar 20 '24 17:03 sgrannan