lacinia-pedestal icon indicating copy to clipboard operation
lacinia-pedestal copied to clipboard

Incompatibility with GraphQL clients for subscriptions

Open S4G4R opened this issue 2 years ago • 4 comments

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.

S4G4R avatar Mar 08 '22 10:03 S4G4R

Was this fixed by #124 ?

hlship avatar Apr 15 '22 23:04 hlship

@hlship

Probably not.

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

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

Currently, lacinia-pedestal supports the older graphql-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

atsfour avatar Apr 17 '22 04:04 atsfour

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

hlship avatar Aug 19 '22 21:08 hlship

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

hlship avatar Aug 19 '22 21:08 hlship