-
Notifications
You must be signed in to change notification settings - Fork 686
Description
Use case
We would like to be able to use GraphQl subscriptions over SSE (Server Sent Events) instead of Websockets.
Out of scope: the merits and demerits of SSE vs Websockets. We just want it and decided it's the best for our project ;)
Describe the solution you'd like
In scope: a new class implementing SubscriptionTransport, for example SseSubscriptionTransport.
In a POC that I'm writing this seems to be sufficient as long as our servers can also implement the protocol that RealSubscriptionManager expects. Otherwise we may need to break down that class in 2 and reimplement some portions of it.
Notes
Our company ( Woolworths ) is investing time in investigating the effort and potential for subscriptions over SSE, and it's already happening internally, ETA for production in the next quarter (Jan-March 2022). A stretch goal would be upstreaming those changes into apollo-kotlin, preferrably v2.5.xxx and subsequent merge into v3.0.x.
At the moment I'm reverse-engineering and reimplementing in SSE client the protocol used between client/server and implemented in RealSubscriptionManager. It's unclear whether our servers would want/be willing to folllow that same protocol, as described in https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md following link from the PR that first implemented it in apollo-kotlin aka apollo-android (#754).
As such, it would be really useful to understand the historical origin of such protocol. Is it something born inside Apollo? I see many references to AWS AppSync but can't find the origin of such protocol. Searching in GraphQl foundation specs gave me no luck either.