Method: GraphQL::Subscriptions::Event#initialize
- Defined in:
- lib/graphql/subscriptions/event.rb
#initialize(name:, arguments:, field: nil, context: nil, scope: nil) ⇒ Event
Returns a new instance of Event.
23 24 25 26 27 28 29 30 31 |
# File 'lib/graphql/subscriptions/event.rb', line 23 def initialize(name:, arguments:, field: nil, context: nil, scope: nil) @name = name @arguments = arguments @context = context field ||= context.field scope_val = scope || (context && field.subscription_scope && context[field.subscription_scope]) @topic = self.class.serialize(name, arguments, field, scope: scope_val) end |