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_obj) ⇒ 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



12
13
14
15
16
17
18
# File 'lib/graphql/query/serial_execution.rb', line 12

def execute(ast_operation, root_type, query_obj)
  operation_resolution.new(
    ast_operation,
    root_type,
    ExecutionContext.new(query_obj, self)
  ).result
end

#field_resolutionObject



20
21
22
# File 'lib/graphql/query/serial_execution.rb', line 20

def field_resolution
  self.class::FieldResolution
end

#operation_resolutionObject



24
25
26
# File 'lib/graphql/query/serial_execution.rb', line 24

def operation_resolution
  self.class::OperationResolution
end

#selection_resolutionObject



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

def selection_resolution
  self.class::SelectionResolution
end