Method: GraphQL::Query::SerialExecution#execute

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

#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