DmitryTsepelev / rubocop-graphql

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

NotAuthorizedNodeType when using pundit #140

Closed gagalago closed 1 year ago

gagalago commented 1 year ago

the linter is complaining about NotAuthorizedNodeType even when we use the pundit integration. it should see that we are doing the authorization through pundit and so be silent for the type doing authorization through pundit.

module Types
  class UserType < Types::Base::Object
    description "User personal data information"

    implements GraphQL::Types::Relay::Node
    global_id_field :id
    pundit_policy_class UserPolicy
    pundit_role :show
  end
end
DmitryTsepelev commented 1 year ago

Hey! Good catch, I guess we could add it to the cop 🙂