class GraphQL::Query::Context::ExecutionErrors

Public Class Methods

new(ctx) click to toggle source
# File lib/graphql/query/context.rb, line 84
def initialize(ctx)
  @context = ctx
end

Public Instance Methods

>>(err_or_msg)
Alias for: add
add(err_or_msg) click to toggle source
# File lib/graphql/query/context.rb, line 88
def add(err_or_msg)
  err = case err_or_msg
  when String
    GraphQL::ExecutionError.new(err_or_msg)
  when GraphQL::ExecutionError
    err_or_msg
  else
    raise ArgumentError, "expected String or GraphQL::ExecutionError, not #{err_or_msg.class} (#{err_or_msg.inspect})"
  end
  # This will assign ast_node and path
  @context.add_error(err)
end
Also aliased as: >>, push
push(err_or_msg)
Alias for: add