GraphQL Subscriptions
Are they on the roadmap? Is there an existing pattern for getting them going using Notifiers?
6 Replies
Not currently, no. But you should be able to use the types created for your resource actions, for example, and it should be pretty straightforward to hook notifiers up to them.
But no current reference implementations exist AFAIK
Could it make sense for them to be part of AshGraphql, given they don't follow the typical pattern of actions?
Potentially, yes
It would make sense to have actions push items to the various channels. The
graphql
DSL could allow you to define the subscription channels and hook them up to PubSub perhaps.
It would be nice to have a way to publish things a bit more explicitly as well, but that would work for the usual "data changed" stuff.
Yeah...actually, I would just add a subscriptions
block to the graphql
DSL and have it build the Absinthe subscription
block and an Ash.Notifier
for the resource that would publish the specified stuff manually with Absinthe.Subscription.publish
.👀 I anticipate needing this sometime in the future
Glad I found this thread, was wondering if the DSL included subscription support. Looking forward to this being provided out of the box.