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.
| 37 38 39 | # File 'lib/graphql/field/resolve.rb', line 37 def initialize(hash_key) @hash_key = hash_key end | 
Instance Method Details
#call(obj, args, ctx) ⇒ Object
| 41 42 43 | # File 'lib/graphql/field/resolve.rb', line 41 def call(obj, args, ctx) obj[@hash_key] end |