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.
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
#result ⇒ Object (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 |