Class: RuboCop::Cop::Ezcater::RequireGqlErrorHelpers
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Ezcater::RequireGqlErrorHelpers
- Defined in:
- lib/rubocop/cop/ezcater/require_gql_error_helpers.rb
Overview
Enforce use of GQLErrors helpers instead of throwing GraphQL::ExecutionErrors directly
Constant Summary collapse
- MSG =
"Use the helpers provided by `GQLErrors` instead of raising `GraphQL::ExecutionError` directly."
Instance Method Summary collapse
Instance Method Details
#on_const(node) ⇒ Object
29 30 31 32 33 |
# File 'lib/rubocop/cop/ezcater/require_gql_error_helpers.rb', line 29 def on_const(node) return unless graphql_const?(node) add_offense(node, location: :expression, message: MSG) end |