DmitryTsepelev / rubocop-graphql

Rubocop extension for enforcing graphql-ruby best practices
MIT License
226 stars 50 forks source link

MaxComplexitySchema and MaxDepthSchema leak into subclasses #125

Closed xxx closed 1 year ago

xxx commented 1 year ago

Heya, thank you for making this gem.

We have some custom error classes defined locally within our gql schema, and these lints are popping for those classes as well.

class MySchema < GraphQL::Schema
  max_complexity 100
  max_depth 10

  class AccountDisabledError < GraphQL::ExecutionError; end # still complains about this, even though they're set in the schema
end
DmitryTsepelev commented 1 year ago

Hey hey! Attached a PR with a fix, will add into the upcoming release 🙂