module GraphQL::Field::Resolve

Create resolve procs ahead of time based on a {GraphQL::Field}'s `name`, `property`, and `hash_key` configuration.

Public Instance Methods

create_proc(field) click to toggle source

@param field [GraphQL::Field] A field that needs a resolve proc @return [Proc] A resolver for this field, based on its config

# File lib/graphql/field/resolve.rb, line 10
def create_proc(field)
  if field.property
    MethodResolve.new(field)
  elsif !field.hash_key.nil?
    HashKeyResolve.new(field.hash_key)
  else
    NameResolve.new(field)
  end
end