Class: GraphQL::Query::FieldResolutionStrategy::ListResolutionStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/graph_ql/query/field_resolution_strategy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, field_type, target, parent_type, ast_field, operation_resolver) ⇒ ListResolutionStrategy

Returns a new instance of ListResolutionStrategy.



36
37
38
39
40
41
42
43
# File 'lib/graph_ql/query/field_resolution_strategy.rb', line 36

def initialize(value, field_type, target, parent_type, ast_field, operation_resolver)
  wrapped_type = field_type.of_type
  strategy_class = FIELD_TYPE_KIND_STRATEGIES[wrapped_type.kind]
  @result = value.map do |item|
    inner_strategy = strategy_class.new(item, wrapped_type, target, parent_type, ast_field, operation_resolver)
    inner_strategy.result
  end
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



35
36
37
# File 'lib/graph_ql/query/field_resolution_strategy.rb', line 35

def result
  @result
end