Class: GraphQL::Query::SerialExecution::ExecutionContext

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/query/serial_execution/execution_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query, strategy) ⇒ ExecutionContext

Returns a new instance of ExecutionContext.



7
8
9
10
# File 'lib/graphql/query/serial_execution/execution_context.rb', line 7

def initialize(query, strategy)
  @query = query
  @strategy = strategy
end

Instance Attribute Details

#queryObject (readonly)

Returns the value of attribute query.



5
6
7
# File 'lib/graphql/query/serial_execution/execution_context.rb', line 5

def query
  @query
end

#strategyObject (readonly)

Returns the value of attribute strategy.



5
6
7
# File 'lib/graphql/query/serial_execution/execution_context.rb', line 5

def strategy
  @strategy
end

Instance Method Details

#add_error(err) ⇒ Object



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

def add_error(err)
  @query.context.errors << err
end

#get_field(type, name) ⇒ Object



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

def get_field(type, name)
  @query.schema.get_field(type, name)
end

#get_fragment(name) ⇒ Object



16
17
18
# File 'lib/graphql/query/serial_execution/execution_context.rb', line 16

def get_fragment(name)
  @query.fragments[name]
end

#get_type(type) ⇒ Object



12
13
14
# File 'lib/graphql/query/serial_execution/execution_context.rb', line 12

def get_type(type)
  @query.schema.types[type]
end