Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
13f59d3d
Commit
13f59d3d
authored
Mar 02, 2021
by
Sean Arnold
Committed by
Markus Koller
Mar 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable Graphql/AuthorizeTypes for BaseInputType
- Disable cop - Remove existing disable comments
parent
e3a06b84
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
35 additions
and
41 deletions
+35
-41
app/graphql/types/boards/board_issue_input_base_type.rb
app/graphql/types/boards/board_issue_input_base_type.rb
+0
-2
app/graphql/types/boards/board_issue_input_type.rb
app/graphql/types/boards/board_issue_input_type.rb
+0
-2
app/graphql/types/ci_configuration/sast/analyzers_entity_input_type.rb
...ypes/ci_configuration/sast/analyzers_entity_input_type.rb
+0
-1
app/graphql/types/ci_configuration/sast/entity_input_type.rb
app/graphql/types/ci_configuration/sast/entity_input_type.rb
+0
-1
app/graphql/types/ci_configuration/sast/input_type.rb
app/graphql/types/ci_configuration/sast/input_type.rb
+1
-1
app/graphql/types/commit_action_type.rb
app/graphql/types/commit_action_type.rb
+0
-2
app/graphql/types/diff_paths_input_type.rb
app/graphql/types/diff_paths_input_type.rb
+0
-2
app/graphql/types/jira_users_mapping_input_type.rb
app/graphql/types/jira_users_mapping_input_type.rb
+0
-2
app/graphql/types/notes/diff_image_position_input_type.rb
app/graphql/types/notes/diff_image_position_input_type.rb
+0
-2
app/graphql/types/notes/diff_position_base_input_type.rb
app/graphql/types/notes/diff_position_base_input_type.rb
+0
-2
app/graphql/types/notes/diff_position_input_type.rb
app/graphql/types/notes/diff_position_input_type.rb
+0
-2
app/graphql/types/notes/update_diff_image_position_input_type.rb
...phql/types/notes/update_diff_image_position_input_type.rb
+0
-3
app/graphql/types/range_input_type.rb
app/graphql/types/range_input_type.rb
+0
-2
app/graphql/types/release_asset_link_input_type.rb
app/graphql/types/release_asset_link_input_type.rb
+0
-1
app/graphql/types/release_assets_input_type.rb
app/graphql/types/release_assets_input_type.rb
+0
-1
app/graphql/types/snippets/blob_action_input_type.rb
app/graphql/types/snippets/blob_action_input_type.rb
+1
-1
app/graphql/types/timeframe_input_type.rb
app/graphql/types/timeframe_input_type.rb
+0
-2
ee/app/graphql/types/alert_management/payload_alert_field_input_type.rb
.../types/alert_management/payload_alert_field_input_type.rb
+0
-1
ee/app/graphql/types/compliance_management/compliance_framework_input_type.rb
.../compliance_management/compliance_framework_input_type.rb
+0
-1
ee/app/graphql/types/epic_tree/epic_tree_node_input_type.rb
ee/app/graphql/types/epic_tree/epic_tree_node_input_type.rb
+0
-2
ee/app/graphql/types/incident_management/oncall_rotation_date_input_type.rb
...es/incident_management/oncall_rotation_date_input_type.rb
+0
-2
ee/app/graphql/types/incident_management/oncall_rotation_length_input_type.rb
.../incident_management/oncall_rotation_length_input_type.rb
+0
-2
ee/app/graphql/types/incident_management/oncall_user_input_type.rb
...aphql/types/incident_management/oncall_user_input_type.rb
+0
-2
rubocop/cop/graphql/authorize_types.rb
rubocop/cop/graphql/authorize_types.rb
+3
-2
spec/rubocop/cop/graphql/authorize_types_spec.rb
spec/rubocop/cop/graphql/authorize_types_spec.rb
+30
-0
No files found.
app/graphql/types/boards/board_issue_input_base_type.rb
View file @
13f59d3d
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
module
Types
module
Types
module
Boards
module
Boards
# rubocop: disable Graphql/AuthorizeTypes
class
BoardIssueInputBaseType
<
BaseInputObject
class
BoardIssueInputBaseType
<
BaseInputObject
argument
:label_name
,
GraphQL
::
STRING_TYPE
.
to_list_type
,
argument
:label_name
,
GraphQL
::
STRING_TYPE
.
to_list_type
,
required:
false
,
required:
false
,
...
@@ -28,7 +27,6 @@ module Types
...
@@ -28,7 +27,6 @@ module Types
required:
false
,
required:
false
,
description:
'Filter by reaction emoji.'
description:
'Filter by reaction emoji.'
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
end
end
...
...
app/graphql/types/boards/board_issue_input_type.rb
View file @
13f59d3d
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
module
Types
module
Types
module
Boards
module
Boards
# rubocop: disable Graphql/AuthorizeTypes
class
NegatedBoardIssueInputType
<
BoardIssueInputBaseType
class
NegatedBoardIssueInputType
<
BoardIssueInputBaseType
end
end
...
@@ -17,7 +16,6 @@ module Types
...
@@ -17,7 +16,6 @@ module Types
required:
false
,
required:
false
,
description:
'Search query for issue title or description.'
description:
'Search query for issue title or description.'
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
end
end
...
...
app/graphql/types/ci_configuration/sast/analyzers_entity_input_type.rb
View file @
13f59d3d
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
module
Types
module
Types
module
CiConfiguration
module
CiConfiguration
module
Sast
module
Sast
# rubocop: disable Graphql/AuthorizeTypes
class
AnalyzersEntityInputType
<
BaseInputObject
class
AnalyzersEntityInputType
<
BaseInputObject
graphql_name
'SastCiConfigurationAnalyzersEntityInput'
graphql_name
'SastCiConfigurationAnalyzersEntityInput'
description
'Represents the analyzers entity in SAST CI configuration'
description
'Represents the analyzers entity in SAST CI configuration'
...
...
app/graphql/types/ci_configuration/sast/entity_input_type.rb
View file @
13f59d3d
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
module
Types
module
Types
module
CiConfiguration
module
CiConfiguration
module
Sast
module
Sast
# rubocop: disable Graphql/AuthorizeTypes
class
EntityInputType
<
BaseInputObject
class
EntityInputType
<
BaseInputObject
graphql_name
'SastCiConfigurationEntityInput'
graphql_name
'SastCiConfigurationEntityInput'
description
'Represents an entity in SAST CI configuration'
description
'Represents an entity in SAST CI configuration'
...
...
app/graphql/types/ci_configuration/sast/input_type.rb
View file @
13f59d3d
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
Types
module
Types
module
CiConfiguration
module
CiConfiguration
module
Sast
module
Sast
class
InputType
<
BaseInputObject
# rubocop:disable Graphql/AuthorizeTypes
class
InputType
<
BaseInputObject
graphql_name
'SastCiConfigurationInput'
graphql_name
'SastCiConfigurationInput'
description
'Represents a CI configuration of SAST'
description
'Represents a CI configuration of SAST'
...
...
app/graphql/types/commit_action_type.rb
View file @
13f59d3d
# frozen_string_literal: true
# frozen_string_literal: true
module
Types
module
Types
# rubocop: disable Graphql/AuthorizeTypes
class
CommitActionType
<
BaseInputObject
class
CommitActionType
<
BaseInputObject
argument
:action
,
type:
Types
::
CommitActionModeEnum
,
required:
true
,
argument
:action
,
type:
Types
::
CommitActionModeEnum
,
required:
true
,
description:
'The action to perform, create, delete, move, update, chmod.'
description:
'The action to perform, create, delete, move, update, chmod.'
...
@@ -18,5 +17,4 @@ module Types
...
@@ -18,5 +17,4 @@ module Types
argument
:encoding
,
type:
Types
::
CommitEncodingEnum
,
required:
false
,
argument
:encoding
,
type:
Types
::
CommitEncodingEnum
,
required:
false
,
description:
'Encoding of the file. Default is text.'
description:
'Encoding of the file. Default is text.'
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
app/graphql/types/diff_paths_input_type.rb
View file @
13f59d3d
# frozen_string_literal: true
# frozen_string_literal: true
module
Types
module
Types
# rubocop: disable Graphql/AuthorizeTypes
class
DiffPathsInputType
<
BaseInputObject
class
DiffPathsInputType
<
BaseInputObject
argument
:old_path
,
GraphQL
::
STRING_TYPE
,
required:
false
,
argument
:old_path
,
GraphQL
::
STRING_TYPE
,
required:
false
,
description:
'The path of the file on the start sha.'
description:
'The path of the file on the start sha.'
argument
:new_path
,
GraphQL
::
STRING_TYPE
,
required:
false
,
argument
:new_path
,
GraphQL
::
STRING_TYPE
,
required:
false
,
description:
'The path of the file on the head sha.'
description:
'The path of the file on the head sha.'
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
app/graphql/types/jira_users_mapping_input_type.rb
View file @
13f59d3d
# frozen_string_literal: true
# frozen_string_literal: true
module
Types
module
Types
# rubocop: disable Graphql/AuthorizeTypes
class
JiraUsersMappingInputType
<
BaseInputObject
class
JiraUsersMappingInputType
<
BaseInputObject
graphql_name
'JiraUsersMappingInputType'
graphql_name
'JiraUsersMappingInputType'
...
@@ -14,5 +13,4 @@ module Types
...
@@ -14,5 +13,4 @@ module Types
required:
false
,
required:
false
,
description:
'Id of the GitLab user.'
description:
'Id of the GitLab user.'
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
app/graphql/types/notes/diff_image_position_input_type.rb
View file @
13f59d3d
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
module
Types
module
Types
module
Notes
module
Notes
# rubocop: disable Graphql/AuthorizeTypes
class
DiffImagePositionInputType
<
DiffPositionBaseInputType
class
DiffImagePositionInputType
<
DiffPositionBaseInputType
graphql_name
'DiffImagePositionInput'
graphql_name
'DiffImagePositionInput'
...
@@ -15,6 +14,5 @@ module Types
...
@@ -15,6 +14,5 @@ module Types
argument
:height
,
GraphQL
::
INT_TYPE
,
required:
true
,
argument
:height
,
GraphQL
::
INT_TYPE
,
required:
true
,
description:
copy_field_description
(
Types
::
Notes
::
DiffPositionType
,
:height
)
description:
copy_field_description
(
Types
::
Notes
::
DiffPositionType
,
:height
)
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
end
end
app/graphql/types/notes/diff_position_base_input_type.rb
View file @
13f59d3d
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
module
Types
module
Types
module
Notes
module
Notes
# rubocop: disable Graphql/AuthorizeTypes
class
DiffPositionBaseInputType
<
BaseInputObject
class
DiffPositionBaseInputType
<
BaseInputObject
argument
:head_sha
,
GraphQL
::
STRING_TYPE
,
required:
true
,
argument
:head_sha
,
GraphQL
::
STRING_TYPE
,
required:
true
,
description:
copy_field_description
(
Types
::
DiffRefsType
,
:head_sha
)
description:
copy_field_description
(
Types
::
DiffRefsType
,
:head_sha
)
...
@@ -17,6 +16,5 @@ module Types
...
@@ -17,6 +16,5 @@ module Types
description:
'The paths of the file that was changed. '
\
description:
'The paths of the file that was changed. '
\
'Both of the properties of this input are optional, but at least one of them is required'
'Both of the properties of this input are optional, but at least one of them is required'
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
end
end
app/graphql/types/notes/diff_position_input_type.rb
View file @
13f59d3d
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
module
Types
module
Types
module
Notes
module
Notes
# rubocop: disable Graphql/AuthorizeTypes
class
DiffPositionInputType
<
DiffPositionBaseInputType
class
DiffPositionInputType
<
DiffPositionBaseInputType
graphql_name
'DiffPositionInput'
graphql_name
'DiffPositionInput'
...
@@ -11,6 +10,5 @@ module Types
...
@@ -11,6 +10,5 @@ module Types
argument
:new_line
,
GraphQL
::
INT_TYPE
,
required:
false
,
argument
:new_line
,
GraphQL
::
INT_TYPE
,
required:
false
,
description:
copy_field_description
(
Types
::
Notes
::
DiffPositionType
,
:new_line
)
description:
copy_field_description
(
Types
::
Notes
::
DiffPositionType
,
:new_line
)
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
end
end
app/graphql/types/notes/update_diff_image_position_input_type.rb
View file @
13f59d3d
...
@@ -3,8 +3,6 @@
...
@@ -3,8 +3,6 @@
module
Types
module
Types
module
Notes
module
Notes
# InputType used for updateImageDiffNote mutation.
# InputType used for updateImageDiffNote mutation.
#
# rubocop: disable Graphql/AuthorizeTypes
class
UpdateDiffImagePositionInputType
<
BaseInputObject
class
UpdateDiffImagePositionInputType
<
BaseInputObject
graphql_name
'UpdateDiffImagePositionInput'
graphql_name
'UpdateDiffImagePositionInput'
...
@@ -32,6 +30,5 @@ module Types
...
@@ -32,6 +30,5 @@ module Types
end
end
end
end
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
end
end
app/graphql/types/range_input_type.rb
View file @
13f59d3d
# frozen_string_literal: true
# frozen_string_literal: true
module
Types
module
Types
# rubocop: disable Graphql/AuthorizeTypes
class
RangeInputType
<
BaseInputObject
class
RangeInputType
<
BaseInputObject
def
self
.
[]
(
type
,
closed
=
true
)
def
self
.
[]
(
type
,
closed
=
true
)
@subtypes
||=
{}
@subtypes
||=
{}
...
@@ -25,5 +24,4 @@ module Types
...
@@ -25,5 +24,4 @@ module Types
to_h
to_h
end
end
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
app/graphql/types/release_asset_link_input_type.rb
View file @
13f59d3d
# frozen_string_literal: true
# frozen_string_literal: true
module
Types
module
Types
# rubocop: disable Graphql/AuthorizeTypes
class
ReleaseAssetLinkInputType
<
BaseInputObject
class
ReleaseAssetLinkInputType
<
BaseInputObject
graphql_name
'ReleaseAssetLinkInput'
graphql_name
'ReleaseAssetLinkInput'
description
'Fields that are available when modifying a release asset link'
description
'Fields that are available when modifying a release asset link'
...
...
app/graphql/types/release_assets_input_type.rb
View file @
13f59d3d
# frozen_string_literal: true
# frozen_string_literal: true
module
Types
module
Types
# rubocop: disable Graphql/AuthorizeTypes
class
ReleaseAssetsInputType
<
BaseInputObject
class
ReleaseAssetsInputType
<
BaseInputObject
graphql_name
'ReleaseAssetsInput'
graphql_name
'ReleaseAssetsInput'
description
'Fields that are available when modifying release assets'
description
'Fields that are available when modifying release assets'
...
...
app/graphql/types/snippets/blob_action_input_type.rb
View file @
13f59d3d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
module
Types
module
Types
module
Snippets
module
Snippets
class
BlobActionInputType
<
BaseInputObject
# rubocop:disable Graphql/AuthorizeTypes
class
BlobActionInputType
<
BaseInputObject
graphql_name
'SnippetBlobActionInputType'
graphql_name
'SnippetBlobActionInputType'
description
'Represents an action to perform over a snippet file'
description
'Represents an action to perform over a snippet file'
...
...
app/graphql/types/timeframe_input_type.rb
View file @
13f59d3d
# frozen_string_literal: true
# frozen_string_literal: true
module
Types
module
Types
# rubocop: disable Graphql/AuthorizeTypes
class
TimeframeInputType
<
RangeInputType
[
::
Types
::
DateType
]
class
TimeframeInputType
<
RangeInputType
[
::
Types
::
DateType
]
graphql_name
'Timeframe'
graphql_name
'Timeframe'
description
'A time-frame defined as a closed inclusive range of two dates'
description
'A time-frame defined as a closed inclusive range of two dates'
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
ee/app/graphql/types/alert_management/payload_alert_field_input_type.rb
View file @
13f59d3d
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
module
Types
module
Types
module
AlertManagement
module
AlertManagement
# rubocop: disable Graphql/AuthorizeTypes
class
PayloadAlertFieldInputType
<
BaseInputObject
class
PayloadAlertFieldInputType
<
BaseInputObject
graphql_name
'AlertManagementPayloadAlertFieldInput'
graphql_name
'AlertManagementPayloadAlertFieldInput'
description
'Field that are available while modifying the custom mapping attributes for an HTTP integration'
description
'Field that are available while modifying the custom mapping attributes for an HTTP integration'
...
...
ee/app/graphql/types/compliance_management/compliance_framework_input_type.rb
View file @
13f59d3d
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
module
Types
module
Types
module
ComplianceManagement
module
ComplianceManagement
# rubocop: disable Graphql/AuthorizeTypes
class
ComplianceFrameworkInputType
<
BaseInputObject
class
ComplianceFrameworkInputType
<
BaseInputObject
graphql_name
'ComplianceFrameworkInput'
graphql_name
'ComplianceFrameworkInput'
...
...
ee/app/graphql/types/epic_tree/epic_tree_node_input_type.rb
View file @
13f59d3d
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
module
Types
module
Types
module
EpicTree
module
EpicTree
# rubocop: disable Graphql/AuthorizeTypes
class
EpicTreeNodeInputType
<
BaseInputObject
class
EpicTreeNodeInputType
<
BaseInputObject
graphql_name
'EpicTreeNodeFieldsInputType'
graphql_name
'EpicTreeNodeFieldsInputType'
description
'A node of an epic tree.'
description
'A node of an epic tree.'
...
@@ -27,6 +26,5 @@ module Types
...
@@ -27,6 +26,5 @@ module Types
required:
false
,
required:
false
,
description:
'ID of the new parent epic.'
description:
'ID of the new parent epic.'
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
end
end
ee/app/graphql/types/incident_management/oncall_rotation_date_input_type.rb
View file @
13f59d3d
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
module
Types
module
Types
module
IncidentManagement
module
IncidentManagement
# rubocop: disable Graphql/AuthorizeTypes
class
OncallRotationDateInputType
<
BaseInputObject
class
OncallRotationDateInputType
<
BaseInputObject
graphql_name
'OncallRotationDateInputType'
graphql_name
'OncallRotationDateInputType'
description
'Date input type for on-call rotation'
description
'Date input type for on-call rotation'
...
@@ -27,6 +26,5 @@ module Types
...
@@ -27,6 +26,5 @@ module Types
raise
Gitlab
::
Graphql
::
Errors
::
ArgumentError
,
'Date & time is invalid'
raise
Gitlab
::
Graphql
::
Errors
::
ArgumentError
,
'Date & time is invalid'
end
end
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
end
end
ee/app/graphql/types/incident_management/oncall_rotation_length_input_type.rb
View file @
13f59d3d
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
module
Types
module
Types
module
IncidentManagement
module
IncidentManagement
# rubocop: disable Graphql/AuthorizeTypes
class
OncallRotationLengthInputType
<
BaseInputObject
class
OncallRotationLengthInputType
<
BaseInputObject
graphql_name
'OncallRotationLengthInputType'
graphql_name
'OncallRotationLengthInputType'
description
'The rotation length of the on-call rotation'
description
'The rotation length of the on-call rotation'
...
@@ -15,6 +14,5 @@ module Types
...
@@ -15,6 +14,5 @@ module Types
required:
true
,
required:
true
,
description:
'The unit of the rotation length of the on-call rotation.'
description:
'The unit of the rotation length of the on-call rotation.'
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
end
end
ee/app/graphql/types/incident_management/oncall_user_input_type.rb
View file @
13f59d3d
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
module
Types
module
Types
module
IncidentManagement
module
IncidentManagement
# rubocop: disable Graphql/AuthorizeTypes
class
OncallUserInputType
<
BaseInputObject
class
OncallUserInputType
<
BaseInputObject
graphql_name
'OncallUserInputType'
graphql_name
'OncallUserInputType'
description
'The rotation user and color palette'
description
'The rotation user and color palette'
...
@@ -19,6 +18,5 @@ module Types
...
@@ -19,6 +18,5 @@ module Types
required:
false
,
required:
false
,
description:
'A value of DataVisualizationWeightEnum. The color weight to assign to for the on-call user.'
description:
'A value of DataVisualizationWeightEnum. The color weight to assign to for the on-call user.'
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
end
end
rubocop/cop/graphql/authorize_types.rb
View file @
13f59d3d
...
@@ -9,7 +9,7 @@ module RuboCop
...
@@ -9,7 +9,7 @@ module RuboCop
# We want to exclude our own basetypes and scalars
# We want to exclude our own basetypes and scalars
ALLOWED_TYPES
=
%w[BaseEnum BaseScalar BasePermissionType MutationType
ALLOWED_TYPES
=
%w[BaseEnum BaseScalar BasePermissionType MutationType
QueryType GraphQL::Schema BaseUnion]
.
freeze
QueryType GraphQL::Schema BaseUnion
BaseInputObject
]
.
freeze
def_node_search
:authorize?
,
<<~
PATTERN
def_node_search
:authorize?
,
<<~
PATTERN
(send nil? :authorize ...)
(send nil? :authorize ...)
...
@@ -29,8 +29,9 @@ module RuboCop
...
@@ -29,8 +29,9 @@ module RuboCop
return
false
unless
class_const
return
false
unless
class_const
return
true
if
class_const
.
end_with?
(
'Enum'
)
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
end
def
class_constant
(
node
)
def
class_constant
(
node
)
...
...
spec/rubocop/cop/graphql/authorize_types_spec.rb
View file @
13f59d3d
...
@@ -63,4 +63,34 @@ RSpec.describe RuboCop::Cop::Graphql::AuthorizeTypes do
...
@@ -63,4 +63,34 @@ RSpec.describe RuboCop::Cop::Graphql::AuthorizeTypes do
end
end
TYPE
TYPE
end
end
it
'does not add an offense for subtypes of BaseUnion'
do
expect_no_offenses
(
<<~
TYPE
)
module Types
class AType < BaseUnion
possible_types Types::Foo, Types::Bar
end
end
TYPE
end
it
'does not add an offense for subtypes of BaseInputObject'
do
expect_no_offenses
(
<<~
TYPE
)
module Types
class AType < BaseInputObject
argument :a_thing
end
end
TYPE
end
it
'does not add an offense for InputTypes'
do
expect_no_offenses
(
<<~
TYPE
)
module Types
class AInputType < SomeObjectType
argument :a_thing
end
end
TYPE
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment