Class: GraphQL::Query::FieldResolutionStrategy::ListResolutionStrategy
- Inherits:
-
Object
- Object
- GraphQL::Query::FieldResolutionStrategy::ListResolutionStrategy
- Defined in:
- lib/graph_ql/query/field_resolution_strategy.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(value, field_type, target, parent_type, ast_field, operation_resolver) ⇒ ListResolutionStrategy
constructor
A new instance of ListResolutionStrategy.
Constructor Details
#initialize(value, field_type, target, parent_type, ast_field, operation_resolver) ⇒ ListResolutionStrategy
Returns a new instance of ListResolutionStrategy.
41 42 43 44 45 46 47 48 49 |
# File 'lib/graph_ql/query/field_resolution_strategy.rb', line 41 def initialize(value, field_type, target, parent_type, ast_field, operation_resolver) wrapped_type = field_type.of_type @result = value.map do |item| resolved_type = wrapped_type.kind.resolve(wrapped_type, item) strategy_class = GraphQL::Query::FieldResolutionStrategy.get_strategy_for_kind(resolved_type.kind) inner_strategy = strategy_class.new(item, resolved_type, target, parent_type, ast_field, operation_resolver) inner_strategy.result end end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
40 41 42 |
# File 'lib/graph_ql/query/field_resolution_strategy.rb', line 40 def result @result end |