Class: GraphQL::Query::SerialExecution::SelectionResolution
- Inherits:
-
Object
- Object
- GraphQL::Query::SerialExecution::SelectionResolution
- Defined in:
- lib/graphql/query/serial_execution/selection_resolution.rb
Instance Attribute Summary collapse
-
#execution_context ⇒ Object
readonly
Returns the value of attribute execution_context.
-
#irep_node ⇒ Object
readonly
Returns the value of attribute irep_node.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(target, type, irep_node, execution_context) ⇒ SelectionResolution
constructor
A new instance of SelectionResolution.
- #result ⇒ Object
Constructor Details
#initialize(target, type, irep_node, execution_context) ⇒ SelectionResolution
Returns a new instance of SelectionResolution.
7 8 9 10 11 12 |
# File 'lib/graphql/query/serial_execution/selection_resolution.rb', line 7 def initialize(target, type, irep_node, execution_context) @target = target @type = type @irep_node = irep_node @execution_context = execution_context end |
Instance Attribute Details
#execution_context ⇒ Object (readonly)
Returns the value of attribute execution_context.
5 6 7 |
# File 'lib/graphql/query/serial_execution/selection_resolution.rb', line 5 def execution_context @execution_context end |
#irep_node ⇒ Object (readonly)
Returns the value of attribute irep_node.
5 6 7 |
# File 'lib/graphql/query/serial_execution/selection_resolution.rb', line 5 def irep_node @irep_node end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
5 6 7 |
# File 'lib/graphql/query/serial_execution/selection_resolution.rb', line 5 def target @target end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/graphql/query/serial_execution/selection_resolution.rb', line 5 def type @type end |
Instance Method Details
#result ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/graphql/query/serial_execution/selection_resolution.rb', line 14 def result irep_node.children.each_with_object({}) do |(name, irep_node), memo| if irep_node.included? && applies_to_type?(irep_node, type) field_result = execution_context.strategy.field_resolution.new( irep_node, type, target, execution_context ).result memo.merge!(field_result) end end end |