Class: GraphQL::Field::Resolve::NameResolve

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

Overview

Call the field’s name at query-time since it might have changed

Instance Method Summary collapse

Constructor Details

#initialize(field) ⇒ NameResolve

Returns a new instance of NameResolve.



49
50
51
# File 'lib/graphql/field/resolve.rb', line 49

def initialize(field)
  @field = field
end

Instance Method Details

#call(obj, args, ctx) ⇒ Object



53
54
55
# File 'lib/graphql/field/resolve.rb', line 53

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