-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
does this still work with a current version of apollo? #9
Comments
No, the current Apollo API is completely different. It doesn't work with the current version of apollo. |
Why is this not maintained and updated for the latest Apollo API, since SSE is in most cases superior to WebSocket? |
Need to apply all changes from this commit : |
Need to take a look at : |
I took a look at these, the commit only converts from executionIterable to executionPromise, a small change. I'd prefer a system where you set up an SSE stream (or multiple) for getting results, and when you post the subscription query, you start getting the results in the stream. To know which stream to post to, you can use a secret token that you receive when opening the stream and then pass it to the server via a cookie (technical cookie excempt from cookie law), a header, or even an unused query variable. |
I also don't think subscription-transport-ws should be taken as a role model. It has to implement a separate server whereas the approach above should only provide a resolver for subscriptions (in theory). The SSE channel can be managed by an apollo-link, which could probably create the channel just before a subscription request is sent. |
@wmertens I'm investigating this area of graphql and your idea seems great. I wonder why graphql is designed in such a way prevent usage of SSE |
@iambumblehead actually I'm pretty close to having it working, right now I'm stuck trying to get the subscribe observer working. The channel auto-setup and message passing seems good so far. |
For anyone else interested, I got this working via graphql-helix and sse-z (a bit outdated and needs some tweaks) See the Subscriptions over SSE recipe: https://github.com/contrawork/graphql-helix Essentially just adds the operation name, variables, etc as query params to the EventSource URL The next question now is, is there anything available for our iOS/Android friends? It would suck for them to also have to write their own client libraries when the Apollo docs have such strong support for websockets |
I got the subscribe observer working but I still have to handle a lot of connection loss edge cases. I'm also not sure how to communicate stopping the subscription but I guess none of the clients have that? |
@Jon-Shyu nice! but I wonder what the limit is on concurrent SSE channels for a single site? |
|
Since this transport plugin has been last updated 2 years ago, I'm wondering if this is a feasable solution for a websocket-alternative.
The text was updated successfully, but these errors were encountered: