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.
19 20 21 22 23 24 25 |
# File 'lib/graphql/query/context.rb', line 19 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.
31 32 33 |
# File 'lib/graphql/query/context.rb', line 31 def backtrace GraphQL::Backtrace.new(self) end |
#execution_errors ⇒ Object
35 36 37 |
# File 'lib/graphql/query/context.rb', line 35 def execution_errors @execution_errors ||= ExecutionErrors.new(self) end |