Replies: 1 comment 1 reply
-
Hey, great question. With ActionCable, you can add a use GraphQL::Subscriptions::ActionCableSubscriptions, namespace: "V2" # or "V1", etc It will be included in the stream identifiers later on: graphql-ruby/lib/graphql/subscriptions/action_cable_subscriptions.rb Lines 245 to 251 in 4836730 Does that work for you? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As part of integration testing subscription triggers with Action Cable, I noticed the internal stream name that was generated didn't appear to embed the current schema identifier. I went digging in
graphql
gem code, but I couldn't find concrete proof that a triggered subscription update won't be broadcasted across all schemas.We have multiple GQL schemas, and one are v1 & v2 versions of the same API, which share many of the same subscription fields. For example, let's say I have the following:
Then one subscriber subscribes to v1 schema's
someEvent { ... }
and another subscriber subscribes to v2 schema'ssomeEvent { ... }
. If I callMyApi::V1.subscriptions.trigger(:some_event, {}, {})
, what part of thegraphql
gem will ensure that only the first subscriber's (subscribed to v1 schema) subscription will get updated and not the second one (subscribed to v2 schema)?Beta Was this translation helpful? Give feedback.
All reactions