Method: GraphQL::Subscriptions::ActionCableSubscriptions#deliver
- Defined in:
- lib/graphql/subscriptions/action_cable_subscriptions.rb
#deliver(subscription_id, result) ⇒ Object
This subscription was re-evaluated. Send it to the specific stream where this client was waiting.
127 128 129 130 131 |
# File 'lib/graphql/subscriptions/action_cable_subscriptions.rb', line 127 def deliver(subscription_id, result) has_more = !result.context.namespace(:subscriptions)[:final_update] payload = { result: result.to_h, more: has_more } @action_cable.server.broadcast(stream_subscription_name(subscription_id), payload) end |