diff options
Diffstat (limited to 'rubocop/cop/graphql/authorize_types.rb')
-rw-r--r-- | rubocop/cop/graphql/authorize_types.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rubocop/cop/graphql/authorize_types.rb b/rubocop/cop/graphql/authorize_types.rb index 1dba719cdff..9bfd93aa3db 100644 --- a/rubocop/cop/graphql/authorize_types.rb +++ b/rubocop/cop/graphql/authorize_types.rb @@ -9,7 +9,7 @@ module RuboCop # We want to exclude our own basetypes and scalars ALLOWED_TYPES = %w[BaseEnum BaseScalar BasePermissionType MutationType - QueryType GraphQL::Schema BaseUnion].freeze + QueryType GraphQL::Schema BaseUnion BaseInputObject].freeze def_node_search :authorize?, <<~PATTERN (send nil? :authorize ...) @@ -29,8 +29,9 @@ module RuboCop return false unless class_const return true if class_const.end_with?('Enum') + return true if class_const.end_with?('InputType') - ALLOWED_TYPES.any? { |allowed| class_node.const_name.include?(allowed) } + ALLOWED_TYPES.any? { |allowed| class_const.include?(allowed) } end def class_constant(node) |