Class: GraphQL::Query::SerialExecution

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/query/serial_execution.rb,
lib/graphql/query/serial_execution/field_resolution.rb,
lib/graphql/query/serial_execution/value_resolution.rb,
lib/graphql/query/serial_execution/execution_context.rb,
lib/graphql/query/serial_execution/operation_resolution.rb,
lib/graphql/query/serial_execution/selection_resolution.rb

Defined Under Namespace

Modules: ValueResolution Classes: ExecutionContext, FieldResolution, OperationResolution, SelectionResolution

Instance Method Summary collapse

Instance Method Details

#execute(ast_operation, root_type, query_object) ⇒ Hash

This is the only required method for an Execution strategy. You could create a custom execution strategy and configure your schema to use that custom strategy instead.

Parameters:

Returns:

  • (Hash)

    a spec-compliant GraphQL result, as a hash


18
19
20
21
22
23
24
25
26
# File 'lib/graphql/query/serial_execution.rb', line 18

def execute(ast_operation, root_type, query_object)
  irep_root = query_object.internal_representation[ast_operation.name]

  operation_resolution.new(
    irep_root,
    root_type,
    ExecutionContext.new(query_object, self)
  ).result
end

#field_resolutionObject


28
29
30
# File 'lib/graphql/query/serial_execution.rb', line 28

def field_resolution
  self.class::FieldResolution
end

#operation_resolutionObject


32
33
34
# File 'lib/graphql/query/serial_execution.rb', line 32

def operation_resolution
  self.class::OperationResolution
end

#selection_resolutionObject


36
37
38
# File 'lib/graphql/query/serial_execution.rb', line 36

def selection_resolution
  self.class::SelectionResolution
end