Class: GraphQL::Field::Resolve::NameResolve
- Inherits:
-
BuiltInResolve
- Object
- BuiltInResolve
- GraphQL::Field::Resolve::NameResolve
- 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
- #call(obj, args, ctx) ⇒ Object
-
#initialize(field) ⇒ NameResolve
constructor
A new instance of NameResolve.
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 |