class GraphQL::Subscriptions::Instrumentation::SubscriptionRegistrationResolve
def call(obj, args, ctx)
def call(obj, args, ctx) @inner_proc.call(obj, args, ctx) if @inner_proc && !@inner_proc.is_a?(GraphQL::Field::Resolve::BuiltInResolve) events = ctx.namespace(:subscriptions)[:events] if events # This is the first execution, so gather an Event # for the backend to register: events << Subscriptions::Event.new( name: ctx.field.name, arguments: args, context: ctx, ) ctx.skip elsif ctx.irep_node.subscription_topic == ctx.query.subscription_topic # The root object is _already_ the subscription update: if obj.is_a?(GraphQL::Schema::Object) obj.object else obj end else # This is a subscription update, but this event wasn't triggered. ctx.skip end end
def initialize(inner_proc)
def initialize(inner_proc) @inner_proc = inner_proc end