Class: GraphqlRails::ExecutionError

Inherits:
GraphQL::ExecutionError
  • Object
show all
Defined in:
lib/graphql_rails/errors/execution_error.rb

Overview

base class which is returned in case something bad happens. Contains all error rendering structure

Instance Method Summary collapse

Instance Method Details

#extra_graphql_dataObject



12
13
14
15
16
17
# File 'lib/graphql_rails/errors/execution_error.rb', line 12

def extra_graphql_data
  {}.tap do |data|
    data['type'] = type if respond_to?(:type) && type
    data['code'] = type if respond_to?(:code) && code
  end
end

#to_hObject



8
9
10
# File 'lib/graphql_rails/errors/execution_error.rb', line 8

def to_h
  super.merge(extra_graphql_data)
end