diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
commit | aee0a117a889461ce8ced6fcf73207fe017f1d99 (patch) | |
tree | 891d9ef189227a8445d83f35c1b0fc99573f4380 /rubocop/cop/graphql | |
parent | 8d46af3258650d305f53b819eabf7ab18d22f59e (diff) |
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'rubocop/cop/graphql')
-rw-r--r-- | rubocop/cop/graphql/authorize_types.rb | 4 | ||||
-rw-r--r-- | rubocop/cop/graphql/old_types.rb | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/rubocop/cop/graphql/authorize_types.rb b/rubocop/cop/graphql/authorize_types.rb index 180a1a27a85..c96919343d6 100644 --- a/rubocop/cop/graphql/authorize_types.rb +++ b/rubocop/cop/graphql/authorize_types.rb @@ -5,10 +5,10 @@ module RuboCop module Graphql class AuthorizeTypes < RuboCop::Cop::Cop MSG = 'Add an `authorize :ability` call to the type: '\ - 'https://docs.gitlab.com/ee/development/api_graphql_styleguide.html#type-authorization' + 'https://docs.gitlab.com/ee/development/graphql_guide/authorization.html#type-authorization' # We want to exclude our own basetypes and scalars - ALLOWED_TYPES = %w[BaseEnum BaseScalar BasePermissionType MutationType SubscriptionType + ALLOWED_TYPES = %w[BaseEnum BaseEdge BaseScalar BasePermissionType MutationType SubscriptionType QueryType GraphQL::Schema BaseUnion BaseInputObject].freeze def_node_search :authorize?, <<~PATTERN diff --git a/rubocop/cop/graphql/old_types.rb b/rubocop/cop/graphql/old_types.rb index 2df594c7016..61e8ac92dc7 100644 --- a/rubocop/cop/graphql/old_types.rb +++ b/rubocop/cop/graphql/old_types.rb @@ -24,11 +24,12 @@ module RuboCop MSG_INT = 'Avoid using GraphQL::INT_TYPE. Use GraphQL::Types::Int instead' MSG_STRING = 'Avoid using GraphQL::STRING_TYPE. Use GraphQL::Types::String instead' MSG_BOOLEAN = 'Avoid using GraphQL::BOOLEAN_TYPE. Use GraphQL::Types::Boolean instead' + MSG_FLOAT = 'Avoid using GraphQL::FLOAT_TYPE. Use GraphQL::Types::Float instead' def_node_matcher :has_old_type?, <<~PATTERN (send nil? {:field :argument} (sym _) - (const (const nil? :GraphQL) ${:ID_TYPE :INT_TYPE :STRING_TYPE :BOOLEAN_TYPE}) + (const {(const nil? :GraphQL) (const (cbase) :GraphQL)} ${:ID_TYPE :INT_TYPE :STRING_TYPE :BOOLEAN_TYPE :FLOAT_TYPE}) (...)?) PATTERN |