walmartlabs / lacinia-pedestal

Expose Lacinia GraphQL as Pedestal endpoints
http://lacinia-pedestal.readthedocs.io/en/latest/
Other
200 stars 63 forks source link

Incompatibility with GraphQL clients for subscriptions #123

Open S4G4R opened 2 years ago

S4G4R commented 2 years ago

Most GraphQL client libraries have moved on from using the subscriptions-transport-ws (which is no longer maintained) implementation in favour of graphql-ws for subscriptions.

This causes compatibility issues, as in our case, we are trying to use the ApolloGraphQL client and lacinia-pedestal server and are unable to do so.

To enhance compatibility with client libraries, it would be great to move to the newer graphql-ws implementation.

hlship commented 2 years ago

Was this fixed by #124 ?

atsfour commented 2 years ago

@hlship

Probably not.

To fix this issue, the lacinia-pedestal server must support thegraphql-transport-ws protocol.

specified by: https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md

Currently, lacinia-pedestal supports the oldergraphql-ws protocol.

specified by: https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md

(The naming of the library and protocol does not match, which is confusing)

I suspect It is needed to change the implementation of subscriptions / connection-loop to handle requests for new protocols as well. Also, for backward compatibility, I think it is better to keep the support of the old protocol.

https://github.com/walmartlabs/lacinia-pedestal/blob/master/src/com/walmartlabs/lacinia/pedestal/subscriptions.clj#L105

hlship commented 2 years ago

So I think this was fixed by #126, right?

hlship commented 2 years ago

Oh, right, #126 isn't merged yet.