Class: GraphQL::Backtrace
- Inherits:
-
Object
- Object
- GraphQL::Backtrace
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/graphql/backtrace.rb,
lib/graphql/backtrace/table.rb,
lib/graphql/backtrace/tracer.rb,
lib/graphql/backtrace/traced_error.rb,
lib/graphql/backtrace/inspect_result.rb
Overview
Wrap unhandled errors with TracedError.
TracedError provides a GraphQL backtrace with arguments and return values. The underlying error is available as TracedError#cause.
WARNING: Backtrace.enable is not threadsafe because Tracing.install is not threadsafe.
Defined Under Namespace
Modules: InspectResult, Tracer Classes: Table, TracedError
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(context, value: nil) ⇒ Backtrace
constructor
A new instance of Backtrace.
-
#inspect ⇒ Object
(also: #to_s)
-
#to_a ⇒ Object
Constructor Details
Class Method Details
.disable ⇒ Object
32 33 34 35 |
# File 'lib/graphql/backtrace.rb', line 32 def self.disable GraphQL::Tracing.uninstall(Backtrace::Tracer) nil end |
.enable ⇒ Object
26 27 28 29 30 |
# File 'lib/graphql/backtrace.rb', line 26 def self.enable warn("GraphQL::Backtrace.enable is deprecated, add `use GraphQL::Backtrace` to your schema definition instead.") GraphQL::Tracing.install(Backtrace::Tracer) nil end |
.use(schema_defn) ⇒ Object
37 38 39 |
# File 'lib/graphql/backtrace.rb', line 37 def self.use(schema_defn) schema_defn.tracer(self::Tracer) end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
45 46 47 |
# File 'lib/graphql/backtrace.rb', line 45 def inspect @table.to_table end |
#to_a ⇒ Object
51 52 53 |
# File 'lib/graphql/backtrace.rb', line 51 def to_a @table.to_backtrace end |