class Graphlient::Errors::ExecutionError

Attributes

response[R]

Public Class Methods

new(response) click to toggle source
Calls superclass method Graphlient::Errors::Error::new
# File lib/graphlient/errors/execution_error.rb, line 6
def initialize(response)
  super('the server responded with a GraphQL execution error')
  @response = response
end

Public Instance Methods

errors() click to toggle source
# File lib/graphlient/errors/execution_error.rb, line 11
def errors
  response.data.errors
end
to_s() click to toggle source
# File lib/graphlient/errors/execution_error.rb, line 15
def to_s
  errors.details.map do |key, details|
    details = create_details(details).join("\n")
    [key, details].compact.join(': ')
  end.join("\n")
end

Private Instance Methods

create_details(details) click to toggle source
# File lib/graphlient/errors/execution_error.rb, line 24
def create_details(details)
  details.map { |detail| detail['message'] }
end