class GraphQL::ExecutionError

and the field will resolve to ‘nil`.
the error will be inserted into the response’s ‘“errors”` key
If a field’s resolve function returns a {ExecutionError},

def initialize(message, ast_node: nil, options: nil)

def initialize(message, ast_node: nil, options: nil)
  @ast_node = ast_node
  @options = options
  super(message)
end

def to_h

Returns:
  • (Hash) - An entry for the response's "errors" key
def to_h
  hash = {
    "message" => message,
  }
  if ast_node
    hash["locations"] = [
      {
        "line" => ast_node.line,
        "column" => ast_node.col,
      }
    ]
  end
  if path
    hash["path"] = path
  end
  if options
    hash.merge!(options)
  end
  hash
end