Class: GraphQL::Execution::Execute Private

Inherits:
Object
  • Object
show all
Includes:
ExecutionFunctions
Defined in:
lib/graphql/execution/execute.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A valid execution strategy

Defined Under Namespace

Modules: ExecutionFunctions, FieldResolveStep Classes: PropagateNull, Skip

Constant Summary collapse

SKIP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Just a singleton for implementing Query::Context#skip

Skip.new
PROPAGATE_NULL =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

PropagateNull.new

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ExecutionFunctions

continue_or_wait, continue_resolve_field, lazy_resolve_root_selection, resolve_field, resolve_root_selection, resolve_selection, resolve_value

Class Method Details

.begin_multiplex(_multiplex) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



34
35
# File 'lib/graphql/execution/execute.rb', line 34

def self.begin_multiplex(_multiplex)
end

.begin_query(query, _multiplex) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



37
38
39
# File 'lib/graphql/execution/execute.rb', line 37

def self.begin_query(query, _multiplex)
  ExecutionFunctions.resolve_root_selection(query)
end

.finish_multiplex(results, multiplex) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



41
42
43
# File 'lib/graphql/execution/execute.rb', line 41

def self.finish_multiplex(results, multiplex)
  ExecutionFunctions.lazy_resolve_root_selection(results, multiplex: multiplex)
end

.finish_query(query, _multiplex) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



45
46
47
48
49
# File 'lib/graphql/execution/execute.rb', line 45

def self.finish_query(query, _multiplex)
  {
    "data" => Execution::Flatten.call(query.context)
  }
end

.use(schema_class) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



21
22
23
24
25
# File 'lib/graphql/execution/execute.rb', line 21

def self.use(schema_class)
  schema_class.query_execution_strategy(self)
  schema_class.mutation_execution_strategy(self)
  schema_class.subscription_execution_strategy(self)
end

Instance Method Details

#execute(ast_operation, root_type, query) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



27
28
29
30
31
32
# File 'lib/graphql/execution/execute.rb', line 27

def execute(ast_operation, root_type, query)
  GraphQL::Deprecation.warn "#{self.class} will be removed in GraphQL-Ruby 2.0, please upgrade to the Interpreter: https://graphql-ruby.org/queries/interpreter.html"
  result = resolve_root_selection(query)
  lazy_resolve_root_selection(result, **{query: query})
  GraphQL::Execution::Flatten.call(query.context)
end