Class: GraphQL::Execution::Errors
- Inherits:
-
Object
- Object
- GraphQL::Execution::Errors
- Defined in:
- lib/graphql/execution/errors.rb
Overview
A tracer that wraps query execution with error handling. Supports class-based schemas and the new Interpreter runtime only.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(schema) ⇒ Errors
constructor
A new instance of Errors.
-
#trace(event, data) ⇒ Object
Constructor Details
#initialize(schema) ⇒ Errors
Returns a new instance of Errors
25 26 27 |
# File 'lib/graphql/execution/errors.rb', line 25 def initialize(schema) @schema = schema end |
Class Method Details
.use(schema) ⇒ Object
20 21 22 23 |
# File 'lib/graphql/execution/errors.rb', line 20 def self.use(schema) schema_class = schema.is_a?(Class) ? schema : schema.target.class schema.tracer(self.new(schema_class)) end |
Instance Method Details
#trace(event, data) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/graphql/execution/errors.rb', line 29 def trace(event, data) case event when "execute_field", "execute_field_lazy" with_error_handling(data) { yield } else yield end end |