Class: GraphQL::Field::Resolve::HashKeyResolve
- Inherits:
-
BuiltInResolve
- Object
- BuiltInResolve
- GraphQL::Field::Resolve::HashKeyResolve
- Defined in:
- lib/graphql/field/resolve.rb
Overview
Resolve the field by looking up @hash_key
with #[]
Instance Method Summary collapse
- #call(obj, args, ctx) ⇒ Object
-
#initialize(hash_key) ⇒ HashKeyResolve
constructor
A new instance of HashKeyResolve.
Constructor Details
#initialize(hash_key) ⇒ HashKeyResolve
Returns a new instance of HashKeyResolve.
36 37 38 |
# File 'lib/graphql/field/resolve.rb', line 36 def initialize(hash_key) @hash_key = hash_key end |
Instance Method Details
#call(obj, args, ctx) ⇒ Object
40 41 42 |
# File 'lib/graphql/field/resolve.rb', line 40 def call(obj, args, ctx) obj[@hash_key] end |