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

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

Overview

Resolve the field by ‘public_send`ing `@method_name`

Instance Method Summary collapse

Constructor Details

#initialize(method_name) ⇒ MethodResolve

Returns a new instance of MethodResolve.



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

def initialize(method_name)
  @method_name = method_name
end

Instance Method Details

#call(obj, args, ctx) ⇒ Object



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

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