Module: Rails::GraphQL::Request::Backtrace

Extended by:
Backtrace
Included in:
Backtrace
Defined in:
lib/rails/graphql/request/backtrace.rb

Overview

GraphQL Request Backtrace

Display any request errors in a nice way. By default, it won’t display anything that is internal of this gem, but

Constant Summary collapse

COL_MAX_WIDTH =
100

Instance Method Summary collapse

Instance Method Details

Display the provided error from the provided request



27
28
29
30
31
32
33
34
# File 'lib/rails/graphql/request/backtrace.rb', line 27

def print(error, component, request)
  return if skip?(error)

  table = print_table(error, component, request)
  info = print_backtrace(error, request)

  request.schema.logger.error(+"#{table}\n\n#{info}")
end

#skip?(error) ⇒ Boolean

Check if the given error should be skipped TODO: Maybe check cause to proper evaluate the skip

Returns:

  • (Boolean)


22
23
24
# File 'lib/rails/graphql/request/backtrace.rb', line 22

def skip?(error)
  error.class <= skip_base_class
end