Class: GraphQL::Schema::BuildFromDefinition::ResolveMap Private
- Inherits:
-
Object
- Object
- GraphQL::Schema::BuildFromDefinition::ResolveMap
- Defined in:
- lib/graphql/schema/build_from_definition.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #call(type, field, obj, args, ctx) ⇒ Object private
-
#initialize(resolve_hash) ⇒ ResolveMap
constructor
private
A new instance of ResolveMap.
Constructor Details
#initialize(resolve_hash) ⇒ ResolveMap
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ResolveMap.
25 26 27 |
# File 'lib/graphql/schema/build_from_definition.rb', line 25 def initialize(resolve_hash) @resolve_hash = resolve_hash end |
Instance Method Details
#call(type, field, obj, args, ctx) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/graphql/schema/build_from_definition.rb', line 29 def call(type, field, obj, args, ctx) type_hash = @resolve_hash[type.name] type_hash && (resolver = type_hash[field.name]) if resolver.nil? raise(KeyError, "resolver not found for #{type.name}.#{field.name}") else resolver.call(obj, args, ctx) end end |