Class: GraphQL::Field::Resolve::MethodResolve

Inherits:
BuiltInResolve show all
Defined in:
lib/graphql/field/resolve.rb

Overview

Resolve the field by public_sending @method_name

Instance Method Summary collapse

Constructor Details

#initialize(method_name) ⇒ MethodResolve

Returns a new instance of MethodResolve.



25
26
27
# File 'lib/graphql/field/resolve.rb', line 25

def initialize(method_name)
  @method_name = method_name
end

Instance Method Details

#call(obj, args, ctx) ⇒ Object



29
30
31
# File 'lib/graphql/field/resolve.rb', line 29

def call(obj, args, ctx)
  obj.public_send(@method_name)
end