Subscriptions
jodinathan opened this issue · comments
Are subscriptions planned?
I've considered it, but the complication is that subscriptions aren't part of the spec. If/when subscriptions are implemented, they'd probably end up riding on top of package:angel_websocket
.
From what I read subscription is part of the spec.
From GraphQL.org (https://graphql.org/learn/queries/#operation-name):
The operation type is either query, mutation, or subscription and describes what type of operation you're intending to do.
Subscription is pretty much a mutation in the schema and a query from the client.
I think it wouldn't be harder for you to add to the parser before adding it completely to Angel.
Also, our feedback can be a lot helpful before start adding to Angel.
Ah, I see. I had been reading only the October2016 spec; there's a June2018 version:
https://facebook.github.io/graphql/June2018/
I'll have to update the parser and schema packages, as well as the server-side implementation now.
I think the subscription functionality can be abstracted out, and then package:angel_graphql
will contain logic out of the box to support subscriptions over WebSockets. But anyone not using Angel (😢) will be able to write their own logic for WebSockets.
Just a matter of when I get around to touching up the GraphQL package. My focus for the next few days is upgrading angel_mongo
, angel_file_service
, and angel_rethink
, and then adding angel_redis
.
Ah, I see. I had been reading only the October2016 spec; there's a June2018 version:
https://facebook.github.io/graphql/June2018/I'll have to update the parser and schema packages, as well as the server-side implementation now.
I think the subscription functionality can be abstracted out, and then
package:angel_graphql
will contain logic out of the box to support subscriptions over WebSockets. But anyone not using Angel () will be able to write their own logic for WebSockets.Just a matter of when I get around to touching up the GraphQL package. My focus for the next few days is upgrading
angel_mongo
,angel_file_service
, andangel_rethink
, and then addingangel_redis
.
please make a tutorial about subscription abstracted, thank you. The most importance of graphql chat app
@webnah The video tutorials, and articles will be about using this with Angel. I will eventually write a Markdown piece in the doc/
directory, describing the internals, so that others can write implementations on top of it.
One more note. graphql_server
now support subscriptions, and will return a Stream
from requests that call for one.
That being said, I am going to write an implementation of the Apollo WebSocket protocol (see #18), so that you can use it with a client like Apollo.
I'm closing this. All further discussion should go in #18. Subscriptions are implemented now. Expect an update coming today, with docs.