Module: GraphQL::Subscriptions::SubscriptionRoot

Defined in:
lib/graphql/subscriptions/subscription_root.rb

Overview

Extend this module in your subscription root when using Execution::Interpreter.

Defined Under Namespace

Modules: InstanceMethods Classes: Extension

Instance Method Summary collapse

Instance Method Details

#field(*args, extensions: [], **rest, &block) ⇒ Object


24
25
26
27
28
29
30
31
32
# File 'lib/graphql/subscriptions/subscription_root.rb', line 24

def field(*args, extensions: [], **rest, &block)
  extensions += [Extension]
  # Backwards-compat for schemas
  if !rest[:subscription]
    name = args.first
    alias_method(name, :skip_subscription_root)
  end
  super(*args, extensions: extensions, **rest, &block)
end