Module: GraphQL::Query::SerialExecution::SelectionResolution

Defined in:
lib/graphql/query/serial_execution/selection_resolution.rb

Class Method Summary collapse

Class Method Details

.resolve(target, current_type, irep_nodes, query_ctx) ⇒ Object


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/graphql/query/serial_execution/selection_resolution.rb', line 5

def self.resolve(target, current_type, irep_nodes, query_ctx)
  own_selections = query_ctx.query.selections(irep_nodes, current_type)

  selection_result = {}

  own_selections.each do |name, child_irep_nodes|
    selection_result.merge!(query_ctx.execution_strategy.field_resolution.new(
      child_irep_nodes,
      current_type,
      target,
      query_ctx
    ).result)
  end

  selection_result
end