Module: GraphQL::Query::Context::SharedMethods
- Included in:
- GraphQL::Query::Context
- Defined in:
- lib/graphql/query/context.rb
Instance Method Summary collapse
-
#add_error(error) ⇒ void
Add error at query-level.
-
#backtrace ⇒ GraphQL::Backtrace
The backtrace for this point in query execution.
-
#execution_errors ⇒ Object
-
#skip ⇒ Object
Return this value to tell the runtime to exclude this field from the response altogether.
Instance Method Details
#add_error(error) ⇒ void
This method returns an undefined value.
Add error at query-level.
17 18 19 20 21 22 23 |
# File 'lib/graphql/query/context.rb', line 17 def add_error(error) if !error.is_a?(ExecutionError) raise TypeError, "expected error to be a ExecutionError, but was #{error.class}" end errors << error nil end |
#backtrace ⇒ GraphQL::Backtrace
Returns The backtrace for this point in query execution.
29 30 31 |
# File 'lib/graphql/query/context.rb', line 29 def backtrace GraphQL::Backtrace.new(self) end |
#execution_errors ⇒ Object
33 34 35 |
# File 'lib/graphql/query/context.rb', line 33 def execution_errors @execution_errors ||= ExecutionErrors.new(self) end |