Class: GraphQL::Query::BaseExecution

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/query/base_execution.rb,
lib/graphql/query/base_execution/value_resolution.rb,
lib/graphql/query/base_execution/selected_object_resolution.rb

Direct Known Subclasses

SerialExecution

Defined Under Namespace

Modules: ValueResolution Classes: SelectedObjectResolution

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



15
16
17
18
# File 'lib/graphql/query/base_execution.rb', line 15

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

#field_resolutionObject



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

def field_resolution
  get_class :FieldResolution
end

#fragment_spread_resolutionObject



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

def fragment_spread_resolution
  get_class :FragmentSpreadResolution
end

#inline_fragment_resolutionObject



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

def inline_fragment_resolution
  get_class :InlineFragmentResolution
end

#operation_resolutionObject



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

def operation_resolution
  get_class :OperationResolution
end

#selection_resolutionObject



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

def selection_resolution
  get_class :SelectionResolution
end