class GraphQL::Field::Resolve::HashKeyResolve

Resolve the field by looking up `@hash_key` with `#[]`

Public Class Methods

new(hash_key) click to toggle source
# File lib/graphql/field/resolve.rb, line 37
def initialize(hash_key)
  @hash_key = hash_key
end

Public Instance Methods

call(obj, args, ctx) click to toggle source
# File lib/graphql/field/resolve.rb, line 41
def call(obj, args, ctx)
  obj[@hash_key]
end