Class: GraphQL::Query::SerialExecution::OperationResolution

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/query/serial_execution/operation_resolution.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(irep_node, target, execution_context) ⇒ OperationResolution

Returns a new instance of OperationResolution


7
8
9
10
11
# File 'lib/graphql/query/serial_execution/operation_resolution.rb', line 7

def initialize(irep_node, target, execution_context)
  @target = target
  @irep_node = irep_node
  @execution_context = execution_context
end

Instance Attribute Details

#execution_contextObject (readonly)

Returns the value of attribute execution_context


5
6
7
# File 'lib/graphql/query/serial_execution/operation_resolution.rb', line 5

def execution_context
  @execution_context
end

#irep_nodeObject (readonly)

Returns the value of attribute irep_node


5
6
7
# File 'lib/graphql/query/serial_execution/operation_resolution.rb', line 5

def irep_node
  @irep_node
end

#targetObject (readonly)

Returns the value of attribute target


5
6
7
# File 'lib/graphql/query/serial_execution/operation_resolution.rb', line 5

def target
  @target
end

Instance Method Details

#resultObject


13
14
15
16
17
18
19
20
21
22
23
# File 'lib/graphql/query/serial_execution/operation_resolution.rb', line 13

def result
  execution_context.strategy.selection_resolution.new(
    execution_context.query.root_value,
    target,
    irep_node,
    execution_context
  ).result
rescue GraphQL::InvalidNullError => err
  err.parent_error? || execution_context.add_error(err)
  nil
end