Module: GraphQL::Query::Runnable

Included in:
GraphQL::Query, Partial
Defined in:
lib/graphql/query.rb

Overview

Code shared with Partial

Instance Method Summary collapse

Instance Method Details

#after_lazy(value, &block) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/graphql/query.rb', line 57

def after_lazy(value, &block)
  if !defined?(@runtime_instance)
    @runtime_instance = context.namespace(:interpreter_runtime)[:runtime]
  end

  if @runtime_instance
    @runtime_instance.minimal_after_lazy(value, &block)
  else
    @schema.after_lazy(value, &block)
  end
end

#arguments_cache ⇒ Object



87
88
89
# File 'lib/graphql/query.rb', line 87

def arguments_cache
  @arguments_cache ||= Execution::Interpreter::ArgumentsCache.new(self)
end

#arguments_for(ast_node, definition, parent_object: nil) ⇒ Object

Node-level cache for calculating arguments. Used during execution and query analysis.

Parameters

  • ast_node (GraphQL::Language::Nodes::AbstractNode)
  • definition (GraphQL::Schema::Field)
  • parent_object (GraphQL::Schema::Object)

Returns

  • Hash{Symbol => Object}

:call-seq:

arguments_for(GraphQL::Language::Nodes::AbstractNode ast_node, GraphQL::Schema::Field definition, GraphQL::Schema::Object parent_object:) -> Hash[Symbol, Object]


83
84
85
# File 'lib/graphql/query.rb', line 83

def arguments_for(ast_node, definition, parent_object: nil)
  arguments_cache.fetch(ast_node, definition, parent_object)
end

#handle_or_reraise(err, **kwargs) ⇒ Object

:nodoc:



91
92
93
# File 'lib/graphql/query.rb', line 91

def handle_or_reraise(err, **kwargs) # :nodoc:
  @schema.handle_or_reraise(context, err, **kwargs)
end