Commit fd775161 authored by Sean Arnold's avatar Sean Arnold

Merge branch 'bw-graphql-name-position' into 'master'

[graphql] Move graphql_name call to beginning of class

See merge request gitlab-org/gitlab!80525
parents 3d256a06 633c935e
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module AlertManagement module AlertManagement
module HttpIntegration module HttpIntegration
class Create < HttpIntegrationBase class Create < HttpIntegrationBase
include FindsProject
graphql_name 'HttpIntegrationCreate' graphql_name 'HttpIntegrationCreate'
include FindsProject
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
required: true, required: true,
description: 'Project to create the integration in.' description: 'Project to create the integration in.'
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module AlertManagement module AlertManagement
module PrometheusIntegration module PrometheusIntegration
class Create < PrometheusIntegrationBase class Create < PrometheusIntegrationBase
include FindsProject
graphql_name 'PrometheusIntegrationCreate' graphql_name 'PrometheusIntegrationCreate'
include FindsProject
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
required: true, required: true,
description: 'Project to create the integration in.' description: 'Project to create the integration in.'
......
...@@ -3,10 +3,9 @@ ...@@ -3,10 +3,9 @@
module Mutations module Mutations
module Boards module Boards
class Create < ::Mutations::BaseMutation class Create < ::Mutations::BaseMutation
include Mutations::ResolvesResourceParent
graphql_name 'CreateBoard' graphql_name 'CreateBoard'
include Mutations::ResolvesResourceParent
include Mutations::Boards::CommonMutationArguments include Mutations::Boards::CommonMutationArguments
field :board, field :board,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module Branches module Branches
class Create < BaseMutation class Create < BaseMutation
include FindsProject
graphql_name 'CreateBranch' graphql_name 'CreateBranch'
include FindsProject
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
required: true, required: true,
description: 'Project full path the branch is associated with.' description: 'Project full path the branch is associated with.'
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module Ci module Ci
class CiCdSettingsUpdate < BaseMutation class CiCdSettingsUpdate < BaseMutation
include FindsProject
graphql_name 'CiCdSettingsUpdate' graphql_name 'CiCdSettingsUpdate'
include FindsProject
authorize :admin_project authorize :admin_project
argument :full_path, GraphQL::Types::ID, argument :full_path, GraphQL::Types::ID,
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module Ci module Ci
module JobTokenScope module JobTokenScope
class AddProject < BaseMutation class AddProject < BaseMutation
include FindsProject
graphql_name 'CiJobTokenScopeAddProject' graphql_name 'CiJobTokenScopeAddProject'
include FindsProject
authorize :admin_project authorize :admin_project
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module Ci module Ci
module JobTokenScope module JobTokenScope
class RemoveProject < BaseMutation class RemoveProject < BaseMutation
include FindsProject
graphql_name 'CiJobTokenScopeRemoveProject' graphql_name 'CiJobTokenScopeRemoveProject'
include FindsProject
authorize :admin_project authorize :admin_project
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
......
...@@ -4,12 +4,12 @@ module Mutations ...@@ -4,12 +4,12 @@ module Mutations
module Clusters module Clusters
module Agents module Agents
class Create < BaseMutation class Create < BaseMutation
graphql_name 'CreateClusterAgent'
include FindsProject include FindsProject
authorize :create_cluster authorize :create_cluster
graphql_name 'CreateClusterAgent'
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
required: true, required: true,
description: 'Full path of the associated project for this cluster agent.' description: 'Full path of the associated project for this cluster agent.'
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
module Mutations module Mutations
module Commits module Commits
class Create < BaseMutation class Create < BaseMutation
graphql_name 'CommitCreate'
include FindsProject include FindsProject
class UrlHelpers class UrlHelpers
...@@ -10,8 +12,6 @@ module Mutations ...@@ -10,8 +12,6 @@ module Mutations
include Gitlab::Routing include Gitlab::Routing
end end
graphql_name 'CommitCreate'
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
required: true, required: true,
description: 'Project full path the branch is associated with.' description: 'Project full path the branch is associated with.'
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module ContainerExpirationPolicies module ContainerExpirationPolicies
class Update < Mutations::BaseMutation class Update < Mutations::BaseMutation
include FindsProject
graphql_name 'UpdateContainerExpirationPolicy' graphql_name 'UpdateContainerExpirationPolicy'
include FindsProject
authorize :destroy_container_image authorize :destroy_container_image
argument :project_path, argument :project_path,
......
...@@ -3,12 +3,11 @@ ...@@ -3,12 +3,11 @@
module Mutations module Mutations
module ContainerRepositories module ContainerRepositories
class DestroyTags < ::Mutations::ContainerRepositories::DestroyBase class DestroyTags < ::Mutations::ContainerRepositories::DestroyBase
LIMIT = 20 graphql_name 'DestroyContainerRepositoryTags'
LIMIT = 20
TOO_MANY_TAGS_ERROR_MESSAGE = "Number of tags is greater than #{LIMIT}" TOO_MANY_TAGS_ERROR_MESSAGE = "Number of tags is greater than #{LIMIT}"
graphql_name 'DestroyContainerRepositoryTags'
authorize :destroy_container_image authorize :destroy_container_image
argument :id, argument :id,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module CustomEmoji module CustomEmoji
class Create < BaseMutation class Create < BaseMutation
include Mutations::ResolvesGroup
graphql_name 'CreateCustomEmoji' graphql_name 'CreateCustomEmoji'
include Mutations::ResolvesGroup
authorize :create_custom_emoji authorize :create_custom_emoji
field :custom_emoji, field :custom_emoji,
......
...@@ -4,11 +4,11 @@ module Mutations ...@@ -4,11 +4,11 @@ module Mutations
module CustomerRelations module CustomerRelations
module Contacts module Contacts
class Create < BaseMutation class Create < BaseMutation
graphql_name 'CustomerRelationsContactCreate'
include ResolvesIds include ResolvesIds
include Gitlab::Graphql::Authorize::AuthorizeResource include Gitlab::Graphql::Authorize::AuthorizeResource
graphql_name 'CustomerRelationsContactCreate'
field :contact, field :contact,
Types::CustomerRelations::ContactType, Types::CustomerRelations::ContactType,
null: true, null: true,
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module CustomerRelations module CustomerRelations
module Contacts module Contacts
class Update < Mutations::BaseMutation class Update < Mutations::BaseMutation
include ResolvesIds
graphql_name 'CustomerRelationsContactUpdate' graphql_name 'CustomerRelationsContactUpdate'
include ResolvesIds
authorize :admin_crm_contact authorize :admin_crm_contact
field :contact, field :contact,
......
...@@ -4,11 +4,11 @@ module Mutations ...@@ -4,11 +4,11 @@ module Mutations
module CustomerRelations module CustomerRelations
module Organizations module Organizations
class Create < BaseMutation class Create < BaseMutation
graphql_name 'CustomerRelationsOrganizationCreate'
include ResolvesIds include ResolvesIds
include Gitlab::Graphql::Authorize::AuthorizeResource include Gitlab::Graphql::Authorize::AuthorizeResource
graphql_name 'CustomerRelationsOrganizationCreate'
field :organization, field :organization,
Types::CustomerRelations::OrganizationType, Types::CustomerRelations::OrganizationType,
null: true, null: true,
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module CustomerRelations module CustomerRelations
module Organizations module Organizations
class Update < Mutations::BaseMutation class Update < Mutations::BaseMutation
include ResolvesIds
graphql_name 'CustomerRelationsOrganizationUpdate' graphql_name 'CustomerRelationsOrganizationUpdate'
include ResolvesIds
authorize :admin_crm_organization authorize :admin_crm_organization
field :organization, field :organization,
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module DependencyProxy module DependencyProxy
module GroupSettings module GroupSettings
class Update < Mutations::BaseMutation class Update < Mutations::BaseMutation
include Mutations::ResolvesGroup
graphql_name 'UpdateDependencyProxySettings' graphql_name 'UpdateDependencyProxySettings'
include Mutations::ResolvesGroup
authorize :admin_dependency_proxy authorize :admin_dependency_proxy
argument :group_path, argument :group_path,
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module DependencyProxy module DependencyProxy
module ImageTtlGroupPolicy module ImageTtlGroupPolicy
class Update < Mutations::BaseMutation class Update < Mutations::BaseMutation
include Mutations::ResolvesGroup
graphql_name 'UpdateDependencyProxyImageTtlGroupPolicy' graphql_name 'UpdateDependencyProxyImageTtlGroupPolicy'
include Mutations::ResolvesGroup
authorize :admin_dependency_proxy authorize :admin_dependency_proxy
argument :group_path, argument :group_path,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module DesignManagement module DesignManagement
class Delete < Base class Delete < Base
Errors = ::Gitlab::Graphql::Errors
graphql_name "DesignManagementDelete" graphql_name "DesignManagementDelete"
Errors = ::Gitlab::Graphql::Errors
argument :filenames, [GraphQL::Types::String], argument :filenames, [GraphQL::Types::String],
required: true, required: true,
description: "Filenames of the designs to delete.", description: "Filenames of the designs to delete.",
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module Groups module Groups
class Update < Mutations::BaseMutation class Update < Mutations::BaseMutation
include Mutations::ResolvesGroup
graphql_name 'GroupUpdate' graphql_name 'GroupUpdate'
include Mutations::ResolvesGroup
authorize :admin_group authorize :admin_group
field :group, Types::GroupType, field :group, Types::GroupType,
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
module Mutations module Mutations
module Issues module Issues
class Create < BaseMutation class Create < BaseMutation
graphql_name 'CreateIssue'
include Mutations::SpamProtection include Mutations::SpamProtection
include FindsProject include FindsProject
include CommonMutationArguments include CommonMutationArguments
graphql_name 'CreateIssue'
authorize :create_issue authorize :create_issue
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module Issues module Issues
class SetConfidential < Base class SetConfidential < Base
include Mutations::SpamProtection
graphql_name 'IssueSetConfidential' graphql_name 'IssueSetConfidential'
include Mutations::SpamProtection
argument :confidential, argument :confidential,
GraphQL::Types::Boolean, GraphQL::Types::Boolean,
required: true, required: true,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module JiraImport module JiraImport
class ImportUsers < BaseMutation class ImportUsers < BaseMutation
include FindsProject
graphql_name 'JiraImportUsers' graphql_name 'JiraImportUsers'
include FindsProject
authorize :admin_project authorize :admin_project
field :jira_users, field :jira_users,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module JiraImport module JiraImport
class Start < BaseMutation class Start < BaseMutation
include FindsProject
graphql_name 'JiraImportStart' graphql_name 'JiraImportStart'
include FindsProject
authorize :admin_project authorize :admin_project
field :jira_import, field :jira_import,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module Labels module Labels
class Create < BaseMutation class Create < BaseMutation
include Mutations::ResolvesResourceParent
graphql_name 'LabelCreate' graphql_name 'LabelCreate'
include Mutations::ResolvesResourceParent
field :label, field :label,
Types::LabelType, Types::LabelType,
null: true, null: true,
......
...@@ -3,12 +3,6 @@ ...@@ -3,12 +3,6 @@
module Mutations module Mutations
module MergeRequests module MergeRequests
class Accept < Base class Accept < Base
NOT_MERGEABLE = 'This branch cannot be merged'
HOOKS_VALIDATION_ERROR = 'Pre-merge hooks failed'
SHA_MISMATCH = 'The merge-head is not at the anticipated SHA'
MERGE_FAILED = 'The merge failed'
ALREADY_SCHEDULED = 'The merge request is already scheduled to be merged'
graphql_name 'MergeRequestAccept' graphql_name 'MergeRequestAccept'
authorize :accept_merge_request authorize :accept_merge_request
description <<~DESC description <<~DESC
...@@ -17,6 +11,12 @@ module Mutations ...@@ -17,6 +11,12 @@ module Mutations
immediately if possible, or using one of the automatic merge strategies. immediately if possible, or using one of the automatic merge strategies.
DESC DESC
NOT_MERGEABLE = 'This branch cannot be merged'
HOOKS_VALIDATION_ERROR = 'Pre-merge hooks failed'
SHA_MISMATCH = 'The merge-head is not at the anticipated SHA'
MERGE_FAILED = 'The merge failed'
ALREADY_SCHEDULED = 'The merge request is already scheduled to be merged'
argument :strategy, argument :strategy,
::Types::MergeStrategyEnum, ::Types::MergeStrategyEnum,
required: false, required: false,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module MergeRequests module MergeRequests
class Create < BaseMutation class Create < BaseMutation
include FindsProject
graphql_name 'MergeRequestCreate' graphql_name 'MergeRequestCreate'
include FindsProject
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
required: true, required: true,
description: 'Project full path the merge request is associated with.' description: 'Project full path the merge request is associated with.'
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module Namespace module Namespace
module PackageSettings module PackageSettings
class Update < Mutations::BaseMutation class Update < Mutations::BaseMutation
include Mutations::ResolvesNamespace
graphql_name 'UpdateNamespacePackageSettings' graphql_name 'UpdateNamespacePackageSettings'
include Mutations::ResolvesNamespace
authorize :create_package_settings authorize :create_package_settings
argument :namespace_path, argument :namespace_path,
......
...@@ -3,14 +3,13 @@ ...@@ -3,14 +3,13 @@
module Mutations module Mutations
module ReleaseAssetLinks module ReleaseAssetLinks
class Create < BaseMutation class Create < BaseMutation
include FindsProject
graphql_name 'ReleaseAssetLinkCreate' graphql_name 'ReleaseAssetLinkCreate'
authorize :create_release include FindsProject
include Types::ReleaseAssetLinkSharedInputArguments include Types::ReleaseAssetLinkSharedInputArguments
authorize :create_release
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
required: true, required: true,
description: 'Full path of the project the asset link is associated with.' description: 'Full path of the project the asset link is associated with.'
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
module Mutations module Mutations
module Snippets module Snippets
class Create < BaseMutation class Create < BaseMutation
graphql_name 'CreateSnippet'
include ServiceCompatibility include ServiceCompatibility
include CanMutateSpammable include CanMutateSpammable
include Mutations::SpamProtection include Mutations::SpamProtection
authorize :create_snippet authorize :create_snippet
graphql_name 'CreateSnippet'
field :snippet, field :snippet,
Types::SnippetType, Types::SnippetType,
null: true, null: true,
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
module Mutations module Mutations
module Snippets module Snippets
class Update < Base class Update < Base
graphql_name 'UpdateSnippet'
include ServiceCompatibility include ServiceCompatibility
include CanMutateSpammable include CanMutateSpammable
include Mutations::SpamProtection include Mutations::SpamProtection
graphql_name 'UpdateSnippet'
argument :id, ::Types::GlobalIDType[::Snippet], argument :id, ::Types::GlobalIDType[::Snippet],
required: true, required: true,
description: 'Global ID of the snippet to update.' description: 'Global ID of the snippet to update.'
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
module Mutations module Mutations
module WorkItems module WorkItems
class Create < BaseMutation class Create < BaseMutation
graphql_name 'WorkItemCreate'
include Mutations::SpamProtection include Mutations::SpamProtection
include FindsProject include FindsProject
graphql_name 'WorkItemCreate'
authorize :create_work_item authorize :create_work_item
argument :description, GraphQL::Types::String, argument :description, GraphQL::Types::String,
......
...@@ -3,11 +3,10 @@ ...@@ -3,11 +3,10 @@
module Mutations module Mutations
module WorkItems module WorkItems
class Delete < BaseMutation class Delete < BaseMutation
graphql_name 'WorkItemDelete'
description "Deletes a work item." \ description "Deletes a work item." \
" Available only when feature flag `work_items` is enabled. The feature is experimental and is subject to change without notice." " Available only when feature flag `work_items` is enabled. The feature is experimental and is subject to change without notice."
graphql_name 'WorkItemDelete'
authorize :delete_work_item authorize :delete_work_item
argument :id, ::Types::GlobalIDType[::WorkItem], argument :id, ::Types::GlobalIDType[::WorkItem],
......
...@@ -3,12 +3,11 @@ ...@@ -3,12 +3,11 @@
module Mutations module Mutations
module WorkItems module WorkItems
class Update < BaseMutation class Update < BaseMutation
include Mutations::SpamProtection graphql_name 'WorkItemUpdate'
description "Updates a work item by Global ID." \ description "Updates a work item by Global ID." \
" Available only when feature flag `work_items` is enabled. The feature is experimental and is subject to change without notice." " Available only when feature flag `work_items` is enabled. The feature is experimental and is subject to change without notice."
graphql_name 'WorkItemUpdate' include Mutations::SpamProtection
authorize :update_work_item authorize :update_work_item
......
...@@ -5,10 +5,11 @@ module Types ...@@ -5,10 +5,11 @@ module Types
module Analytics module Analytics
module UsageTrends module UsageTrends
class MeasurementType < BaseObject class MeasurementType < BaseObject
include Gitlab::Graphql::Authorize::AuthorizeResource
graphql_name 'UsageTrendsMeasurement' graphql_name 'UsageTrendsMeasurement'
description 'Represents a recorded measurement (object count) for the Admins' description 'Represents a recorded measurement (object count) for the Admins'
include Gitlab::Graphql::Authorize::AuthorizeResource
authorize :read_usage_trends_measurement authorize :read_usage_trends_measurement
field :recorded_at, Types::TimeType, null: true, field :recorded_at, Types::TimeType, null: true,
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
module Types module Types
module AlertManagement module AlertManagement
class PrometheusIntegrationType < ::Types::BaseObject class PrometheusIntegrationType < ::Types::BaseObject
include ::Gitlab::Routing
graphql_name 'AlertManagementPrometheusIntegration' graphql_name 'AlertManagementPrometheusIntegration'
description 'An endpoint and credentials used to accept Prometheus alerts for a project' description 'An endpoint and credentials used to accept Prometheus alerts for a project'
include ::Gitlab::Routing
implements(Types::AlertManagement::IntegrationType) implements(Types::AlertManagement::IntegrationType)
authorize :admin_project authorize :admin_project
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
module Types module Types
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
class BoardListType < BaseObject class BoardListType < BaseObject
include Gitlab::Utils::StrongMemoize
graphql_name 'BoardList' graphql_name 'BoardList'
description 'Represents a list for an issue board' description 'Represents a list for an issue board'
include Gitlab::Utils::StrongMemoize
alias_method :list, :object alias_method :list, :object
field :id, GraphQL::Types::ID, field :id, GraphQL::Types::ID,
......
...@@ -3,12 +3,13 @@ ...@@ -3,12 +3,13 @@
module Types module Types
module Ci module Ci
class RunnerType < BaseObject class RunnerType < BaseObject
graphql_name 'CiRunner'
edge_type_class(RunnerWebUrlEdge) edge_type_class(RunnerWebUrlEdge)
connection_type_class(Types::CountableConnectionType) connection_type_class(Types::CountableConnectionType)
graphql_name 'CiRunner'
authorize :read_runner authorize :read_runner
present_using ::Ci::RunnerPresenter present_using ::Ci::RunnerPresenter
expose_permissions Types::PermissionTypes::Ci::Runner expose_permissions Types::PermissionTypes::Ci::Runner
JOB_COUNT_LIMIT = 1000 JOB_COUNT_LIMIT = 1000
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
module Types module Types
class GroupInvitationType < BaseObject class GroupInvitationType < BaseObject
graphql_name 'GroupInvitation'
description 'Represents a Group Invitation'
expose_permissions Types::PermissionTypes::Group expose_permissions Types::PermissionTypes::Group
authorize :admin_group authorize :admin_group
implements InvitationInterface implements InvitationInterface
graphql_name 'GroupInvitation'
description 'Represents a Group Invitation'
field :group, Types::GroupType, null: true, field :group, Types::GroupType, null: true,
description: 'Group that a User is invited to.' description: 'Group that a User is invited to.'
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
module Types module Types
class GroupMemberType < BaseObject class GroupMemberType < BaseObject
graphql_name 'GroupMember'
description 'Represents a Group Membership'
expose_permissions Types::PermissionTypes::Group expose_permissions Types::PermissionTypes::Group
authorize :read_group authorize :read_group
implements MemberInterface implements MemberInterface
graphql_name 'GroupMember'
description 'Represents a Group Membership'
field :group, Types::GroupType, null: true, field :group, Types::GroupType, null: true,
description: 'Group that a User is a member of.' description: 'Group that a User is a member of.'
......
...@@ -3,11 +3,12 @@ ...@@ -3,11 +3,12 @@
module Types module Types
module MergeRequests module MergeRequests
class AssigneeType < ::Types::UserType class AssigneeType < ::Types::UserType
graphql_name 'MergeRequestAssignee'
description 'A user assigned to a merge request.'
include FindClosest include FindClosest
include ::Types::MergeRequests::InteractsWithMergeRequest include ::Types::MergeRequests::InteractsWithMergeRequest
graphql_name 'MergeRequestAssignee'
description 'A user assigned to a merge request.'
authorize :read_user authorize :read_user
end end
end end
......
...@@ -3,11 +3,12 @@ ...@@ -3,11 +3,12 @@
module Types module Types
module MergeRequests module MergeRequests
class ReviewerType < ::Types::UserType class ReviewerType < ::Types::UserType
graphql_name 'MergeRequestReviewer'
description 'A user assigned to a merge request as a reviewer.'
include FindClosest include FindClosest
include ::Types::MergeRequests::InteractsWithMergeRequest include ::Types::MergeRequests::InteractsWithMergeRequest
graphql_name 'MergeRequestReviewer'
description 'A user assigned to a merge request as a reviewer.'
authorize :read_user authorize :read_user
end end
end end
......
...@@ -4,8 +4,8 @@ module Types ...@@ -4,8 +4,8 @@ module Types
module Metrics module Metrics
module Dashboards module Dashboards
class AnnotationType < ::Types::BaseObject class AnnotationType < ::Types::BaseObject
authorize :read_metrics_dashboard_annotation
graphql_name 'MetricsDashboardAnnotation' graphql_name 'MetricsDashboardAnnotation'
authorize :read_metrics_dashboard_annotation
field :description, GraphQL::Types::String, null: true, field :description, GraphQL::Types::String, null: true,
description: 'Description of the annotation.' description: 'Description of the annotation.'
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
module Types module Types
class MutationType < BaseObject class MutationType < BaseObject
include Gitlab::Graphql::MountMutation
graphql_name 'Mutation' graphql_name 'Mutation'
include Gitlab::Graphql::MountMutation
mount_mutation Mutations::Admin::SidekiqQueues::DeleteJobs mount_mutation Mutations::Admin::SidekiqQueues::DeleteJobs
mount_mutation Mutations::AlertManagement::CreateAlertIssue mount_mutation Mutations::AlertManagement::CreateAlertIssue
mount_mutation Mutations::AlertManagement::UpdateAlertStatus mount_mutation Mutations::AlertManagement::UpdateAlertStatus
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Types module Types
module Notes module Notes
class DiscussionType < BaseObject class DiscussionType < BaseObject
DiscussionID = ::Types::GlobalIDType[::Discussion]
graphql_name 'Discussion' graphql_name 'Discussion'
DiscussionID = ::Types::GlobalIDType[::Discussion]
authorize :read_note authorize :read_note
implements(Types::ResolvableInterface) implements(Types::ResolvableInterface)
......
...@@ -3,10 +3,11 @@ ...@@ -3,10 +3,11 @@
module Types module Types
module Packages module Packages
class PackageDetailsType < PackageType class PackageDetailsType < PackageType
include ::PackagesHelper
graphql_name 'PackageDetailsType' graphql_name 'PackageDetailsType'
description 'Represents a package details in the Package Registry. Note that this type is in beta and susceptible to changes' description 'Represents a package details in the Package Registry. Note that this type is in beta and susceptible to changes'
include ::PackagesHelper
authorize :read_package authorize :read_package
field :versions, ::Types::Packages::PackageType.connection_type, null: true, field :versions, ::Types::Packages::PackageType.connection_type, null: true,
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
module Types module Types
module PermissionTypes module PermissionTypes
class Issue < BasePermissionType class Issue < BasePermissionType
description 'Check permissions for the current user on a issue'
graphql_name 'IssuePermissions' graphql_name 'IssuePermissions'
description 'Check permissions for the current user on a issue'
abilities :read_issue, :admin_issue, :update_issue, :reopen_issue, abilities :read_issue, :admin_issue, :update_issue, :reopen_issue,
:read_design, :create_design, :destroy_design, :read_design, :create_design, :destroy_design,
......
...@@ -3,15 +3,16 @@ ...@@ -3,15 +3,16 @@
module Types module Types
module PermissionTypes module PermissionTypes
class MergeRequest < BasePermissionType class MergeRequest < BasePermissionType
graphql_name 'MergeRequestPermissions'
description 'Check permissions for the current user on a merge request'
present_using MergeRequestPresenter
PERMISSION_FIELDS = %i[push_to_source_branch PERMISSION_FIELDS = %i[push_to_source_branch
remove_source_branch remove_source_branch
cherry_pick_on_current_merge_request cherry_pick_on_current_merge_request
revert_on_current_merge_request].freeze revert_on_current_merge_request].freeze
present_using MergeRequestPresenter
description 'Check permissions for the current user on a merge request'
graphql_name 'MergeRequestPermissions'
abilities :read_merge_request, :admin_merge_request, abilities :read_merge_request, :admin_merge_request,
:update_merge_request, :create_note :update_merge_request, :create_note
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Types module Types
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
class QueryComplexityType < ::Types::BaseObject class QueryComplexityType < ::Types::BaseObject
ANALYZER = GraphQL::Analysis::QueryComplexity.new { |_query, complexity| complexity }
graphql_name 'QueryComplexity' graphql_name 'QueryComplexity'
ANALYZER = GraphQL::Analysis::QueryComplexity.new { |_query, complexity| complexity }
alias_method :query, :object alias_method :query, :object
field :limit, GraphQL::Types::Int, field :limit, GraphQL::Types::Int,
......
...@@ -4,10 +4,10 @@ module Types ...@@ -4,10 +4,10 @@ module Types
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
# This is presented through `Repository` that has its own authorization # This is presented through `Repository` that has its own authorization
class BlobType < BaseObject class BlobType < BaseObject
present_using BlobPresenter
graphql_name 'RepositoryBlob' graphql_name 'RepositoryBlob'
present_using BlobPresenter
field :id, GraphQL::Types::ID, null: false, field :id, GraphQL::Types::ID, null: false,
description: 'ID of the blob.' description: 'ID of the blob.'
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Types module Types
module Terraform module Terraform
class StateVersionType < BaseObject class StateVersionType < BaseObject
include ::API::Helpers::RelatedResourcesHelpers
graphql_name 'TerraformStateVersion' graphql_name 'TerraformStateVersion'
include ::API::Helpers::RelatedResourcesHelpers
authorize :read_terraform_state authorize :read_terraform_state
field :id, GraphQL::Types::ID, field :id, GraphQL::Types::ID,
......
...@@ -4,12 +4,11 @@ module Types ...@@ -4,12 +4,11 @@ module Types
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
# This is presented through `Repository` that has its own authorization # This is presented through `Repository` that has its own authorization
class BlobType < BaseObject class BlobType < BaseObject
implements Types::Tree::EntryType graphql_name 'Blob'
implements Types::Tree::EntryType
present_using BlobPresenter present_using BlobPresenter
graphql_name 'Blob'
field :web_url, GraphQL::Types::String, null: true, field :web_url, GraphQL::Types::String, null: true,
description: 'Web URL of the blob.' description: 'Web URL of the blob.'
field :web_path, GraphQL::Types::String, null: true, field :web_path, GraphQL::Types::String, null: true,
......
...@@ -4,10 +4,10 @@ module Types ...@@ -4,10 +4,10 @@ module Types
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
# This is presented through `Repository` that has its own authorization # This is presented through `Repository` that has its own authorization
class SubmoduleType < BaseObject class SubmoduleType < BaseObject
implements Types::Tree::EntryType
graphql_name 'Submodule' graphql_name 'Submodule'
implements Types::Tree::EntryType
field :web_url, type: GraphQL::Types::String, null: true, field :web_url, type: GraphQL::Types::String, null: true,
description: 'Web URL for the sub-module.' description: 'Web URL for the sub-module.'
field :tree_url, type: GraphQL::Types::String, null: true, field :tree_url, type: GraphQL::Types::String, null: true,
......
...@@ -4,13 +4,12 @@ module Types ...@@ -4,13 +4,12 @@ module Types
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
# This is presented through `Repository` that has its own authorization # This is presented through `Repository` that has its own authorization
class TreeEntryType < BaseObject class TreeEntryType < BaseObject
implements Types::Tree::EntryType
present_using TreeEntryPresenter
graphql_name 'TreeEntry' graphql_name 'TreeEntry'
description 'Represents a directory' description 'Represents a directory'
implements Types::Tree::EntryType
present_using TreeEntryPresenter
field :web_url, GraphQL::Types::String, null: true, field :web_url, GraphQL::Types::String, null: true,
description: 'Web URL for the tree entry (directory).' description: 'Web URL for the tree entry (directory).'
field :web_path, GraphQL::Types::String, null: true, field :web_path, GraphQL::Types::String, null: true,
......
...@@ -5,12 +5,11 @@ module Mutations ...@@ -5,12 +5,11 @@ module Mutations
module DevopsAdoption module DevopsAdoption
module EnabledNamespaces module EnabledNamespaces
class BulkEnable < BaseMutation class BulkEnable < BaseMutation
include Mixins::CommonMethods
graphql_name 'BulkEnableDevopsAdoptionNamespaces' graphql_name 'BulkEnableDevopsAdoptionNamespaces'
description '**BETA** This endpoint is subject to change without notice.' description '**BETA** This endpoint is subject to change without notice.'
include Mixins::CommonMethods
argument :namespace_ids, [::Types::GlobalIDType[::Namespace]], argument :namespace_ids, [::Types::GlobalIDType[::Namespace]],
required: true, required: true,
description: 'List of Namespace IDs.' description: 'List of Namespace IDs.'
......
...@@ -5,12 +5,11 @@ module Mutations ...@@ -5,12 +5,11 @@ module Mutations
module DevopsAdoption module DevopsAdoption
module EnabledNamespaces module EnabledNamespaces
class Disable < BaseMutation class Disable < BaseMutation
include Mixins::CommonMethods
graphql_name 'DisableDevopsAdoptionNamespace' graphql_name 'DisableDevopsAdoptionNamespace'
description '**BETA** This endpoint is subject to change without notice.' description '**BETA** This endpoint is subject to change without notice.'
include Mixins::CommonMethods
argument :id, [::Types::GlobalIDType[::Analytics::DevopsAdoption::EnabledNamespace]], argument :id, [::Types::GlobalIDType[::Analytics::DevopsAdoption::EnabledNamespace]],
required: true, required: true,
description: 'One or many IDs of the enabled namespaces to disable.' description: 'One or many IDs of the enabled namespaces to disable.'
......
...@@ -5,12 +5,11 @@ module Mutations ...@@ -5,12 +5,11 @@ module Mutations
module DevopsAdoption module DevopsAdoption
module EnabledNamespaces module EnabledNamespaces
class Enable < BaseMutation class Enable < BaseMutation
include Mixins::CommonMethods
graphql_name 'EnableDevopsAdoptionNamespace' graphql_name 'EnableDevopsAdoptionNamespace'
description '**BETA** This endpoint is subject to change without notice.' description '**BETA** This endpoint is subject to change without notice.'
include Mixins::CommonMethods
argument :namespace_id, ::Types::GlobalIDType[::Namespace], argument :namespace_id, ::Types::GlobalIDType[::Namespace],
required: true, required: true,
description: 'Namespace ID.' description: 'Namespace ID.'
......
...@@ -6,10 +6,10 @@ module Mutations ...@@ -6,10 +6,10 @@ module Mutations
module API module API
module CiConfiguration module CiConfiguration
class Create < BaseMutation class Create < BaseMutation
include FindsProject
graphql_name 'ApiFuzzingCiConfigurationCreate' graphql_name 'ApiFuzzingCiConfigurationCreate'
include FindsProject
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
required: true, required: true,
description: 'Full path of the project.' description: 'Full path of the project.'
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module AppSec::Fuzzing::Coverage module AppSec::Fuzzing::Coverage
module Corpus module Corpus
class Create < BaseMutation class Create < BaseMutation
include FindsProject
graphql_name 'CorpusCreate' graphql_name 'CorpusCreate'
include FindsProject
authorize :create_coverage_fuzzing_corpus authorize :create_coverage_fuzzing_corpus
argument :package_id, Types::GlobalIDType[::Packages::Package], argument :package_id, Types::GlobalIDType[::Packages::Package],
......
...@@ -4,12 +4,12 @@ module Mutations ...@@ -4,12 +4,12 @@ module Mutations
module Boards module Boards
module EpicBoards module EpicBoards
class Create < ::Mutations::BaseMutation class Create < ::Mutations::BaseMutation
graphql_name 'EpicBoardCreate'
include Mutations::ResolvesGroup include Mutations::ResolvesGroup
include Mutations::Boards::CommonMutationArguments include Mutations::Boards::CommonMutationArguments
prepend Mutations::Boards::ScopedBoardMutation prepend Mutations::Boards::ScopedBoardMutation
graphql_name 'EpicBoardCreate'
authorize :admin_epic_board authorize :admin_epic_board
argument :group_path, GraphQL::Types::ID, argument :group_path, GraphQL::Types::ID,
......
...@@ -4,11 +4,11 @@ module Mutations ...@@ -4,11 +4,11 @@ module Mutations
module Boards module Boards
module EpicBoards module EpicBoards
class Update < ::Mutations::BaseMutation class Update < ::Mutations::BaseMutation
graphql_name 'EpicBoardUpdate'
include Mutations::Boards::CommonMutationArguments include Mutations::Boards::CommonMutationArguments
prepend Mutations::Boards::ScopedBoardMutation prepend Mutations::Boards::ScopedBoardMutation
graphql_name 'EpicBoardUpdate'
authorize :admin_epic_board authorize :admin_epic_board
argument :id, argument :id,
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module Boards module Boards
module Epics module Epics
class Create < ::Mutations::BaseMutation class Create < ::Mutations::BaseMutation
include Mutations::ResolvesGroup
graphql_name 'BoardEpicCreate' graphql_name 'BoardEpicCreate'
include Mutations::ResolvesGroup
argument :group_path, GraphQL::Types::ID, argument :group_path, GraphQL::Types::ID,
required: true, required: true,
description: 'Group the epic to create is in.' description: 'Group the epic to create is in.'
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module Dast module Dast
module Profiles module Profiles
class Create < BaseMutation class Create < BaseMutation
include FindsProject
graphql_name 'DastProfileCreate' graphql_name 'DastProfileCreate'
include FindsProject
field :dast_profile, ::Types::Dast::ProfileType, field :dast_profile, ::Types::Dast::ProfileType,
null: true, null: true,
description: 'Created profile.' description: 'Created profile.'
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module Dast module Dast
module Profiles module Profiles
class Run < BaseMutation class Run < BaseMutation
include FindsProject
graphql_name 'DastProfileRun' graphql_name 'DastProfileRun'
include FindsProject
ProfileID = ::Types::GlobalIDType[::Dast::Profile] ProfileID = ::Types::GlobalIDType[::Dast::Profile]
field :pipeline_url, GraphQL::Types::String, field :pipeline_url, GraphQL::Types::String,
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module Dast module Dast
module Profiles module Profiles
class Update < BaseMutation class Update < BaseMutation
include FindsProject
graphql_name 'DastProfileUpdate' graphql_name 'DastProfileUpdate'
include FindsProject
ProfileID = ::Types::GlobalIDType[::Dast::Profile] ProfileID = ::Types::GlobalIDType[::Dast::Profile]
SiteProfileID = ::Types::GlobalIDType[::DastSiteProfile] SiteProfileID = ::Types::GlobalIDType[::DastSiteProfile]
ScannerProfileID = ::Types::GlobalIDType[::DastScannerProfile] ScannerProfileID = ::Types::GlobalIDType[::DastScannerProfile]
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
module Mutations module Mutations
module DastOnDemandScans module DastOnDemandScans
class Create < BaseMutation class Create < BaseMutation
graphql_name 'DastOnDemandScanCreate'
include FindsProject include FindsProject
InvalidGlobalID = Class.new(StandardError) InvalidGlobalID = Class.new(StandardError)
graphql_name 'DastOnDemandScanCreate'
field :pipeline_url, GraphQL::Types::String, field :pipeline_url, GraphQL::Types::String,
null: true, null: true,
description: 'URL of the pipeline that was created.' description: 'URL of the pipeline that was created.'
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module DastScannerProfiles module DastScannerProfiles
class Create < BaseMutation class Create < BaseMutation
include FindsProject
graphql_name 'DastScannerProfileCreate' graphql_name 'DastScannerProfileCreate'
include FindsProject
field :id, ::Types::GlobalIDType[::DastScannerProfile], field :id, ::Types::GlobalIDType[::DastScannerProfile],
null: true, null: true,
description: 'ID of the scanner profile.' description: 'ID of the scanner profile.'
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module DastScannerProfiles module DastScannerProfiles
class Delete < BaseMutation class Delete < BaseMutation
include FindsProject
graphql_name 'DastScannerProfileDelete' graphql_name 'DastScannerProfileDelete'
include FindsProject
ScannerProfileID = ::Types::GlobalIDType[::DastScannerProfile] ScannerProfileID = ::Types::GlobalIDType[::DastScannerProfile]
argument :full_path, GraphQL::Types::ID, argument :full_path, GraphQL::Types::ID,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module DastScannerProfiles module DastScannerProfiles
class Update < BaseMutation class Update < BaseMutation
include FindsProject
graphql_name 'DastScannerProfileUpdate' graphql_name 'DastScannerProfileUpdate'
include FindsProject
ScannerProfileID = ::Types::GlobalIDType[::DastScannerProfile] ScannerProfileID = ::Types::GlobalIDType[::DastScannerProfile]
field :id, ScannerProfileID, field :id, ScannerProfileID,
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
module Mutations module Mutations
module DastSiteProfiles module DastSiteProfiles
class Create < BaseMutation class Create < BaseMutation
graphql_name 'DastSiteProfileCreate'
include FindsProject include FindsProject
include Mutations::AppSec::Dast::SiteProfiles::SharedArguments include Mutations::AppSec::Dast::SiteProfiles::SharedArguments
graphql_name 'DastSiteProfileCreate'
field :id, SiteProfileID, field :id, SiteProfileID,
null: true, null: true,
description: 'ID of the site profile.' description: 'ID of the site profile.'
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
module Mutations module Mutations
module DastSiteProfiles module DastSiteProfiles
class Update < BaseMutation class Update < BaseMutation
graphql_name 'DastSiteProfileUpdate'
include FindsProject include FindsProject
include Mutations::AppSec::Dast::SiteProfiles::SharedArguments include Mutations::AppSec::Dast::SiteProfiles::SharedArguments
graphql_name 'DastSiteProfileUpdate'
field :id, SiteProfileID, field :id, SiteProfileID,
null: true, null: true,
description: 'ID of the site profile.' description: 'ID of the site profile.'
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module DastSiteTokens module DastSiteTokens
class Create < BaseMutation class Create < BaseMutation
include FindsProject
graphql_name 'DastSiteTokenCreate' graphql_name 'DastSiteTokenCreate'
include FindsProject
field :id, ::Types::GlobalIDType[::DastSiteToken], field :id, ::Types::GlobalIDType[::DastSiteToken],
null: true, null: true,
description: 'ID of the site token.' description: 'ID of the site token.'
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module DastSiteValidations module DastSiteValidations
class Create < BaseMutation class Create < BaseMutation
include FindsProject
graphql_name 'DastSiteValidationCreate' graphql_name 'DastSiteValidationCreate'
include FindsProject
field :id, ::Types::GlobalIDType[::DastSiteValidation], field :id, ::Types::GlobalIDType[::DastSiteValidation],
null: true, null: true,
description: 'ID of the site validation.' description: 'ID of the site validation.'
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module DastSiteValidations module DastSiteValidations
class Revoke < BaseMutation class Revoke < BaseMutation
include FindsProject
graphql_name 'DastSiteValidationRevoke' graphql_name 'DastSiteValidationRevoke'
include FindsProject
argument :full_path, GraphQL::Types::ID, argument :full_path, GraphQL::Types::ID,
required: true, required: true,
description: 'Project the site validation belongs to.' description: 'Project the site validation belongs to.'
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module Epics module Epics
class AddIssue < Base class AddIssue < Base
include Mutations::ResolvesIssuable
graphql_name 'EpicAddIssue' graphql_name 'EpicAddIssue'
include Mutations::ResolvesIssuable
authorize :admin_epic authorize :admin_epic
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
module Mutations module Mutations
module Epics module Epics
class Create < BaseMutation class Create < BaseMutation
graphql_name 'CreateEpic'
include Mutations::ResolvesGroup include Mutations::ResolvesGroup
prepend Mutations::SharedEpicArguments prepend Mutations::SharedEpicArguments
graphql_name 'CreateEpic'
authorize :create_epic authorize :create_epic
field :epic, field :epic,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module Epics module Epics
class Update < Base class Update < Base
prepend Mutations::SharedEpicArguments
graphql_name 'UpdateEpic' graphql_name 'UpdateEpic'
prepend Mutations::SharedEpicArguments
argument :state_event, argument :state_event,
Types::EpicStateEventEnum, Types::EpicStateEventEnum,
required: false, required: false,
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module IncidentManagement module IncidentManagement
module EscalationPolicy module EscalationPolicy
class Create < Base class Create < Base
include ResolvesProject
graphql_name 'EscalationPolicyCreate' graphql_name 'EscalationPolicyCreate'
include ResolvesProject
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
required: true, required: true,
description: 'Project to create the escalation policy for.' description: 'Project to create the escalation policy for.'
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module IncidentManagement module IncidentManagement
module OncallRotation module OncallRotation
class Create < Base class Create < Base
include ResolvesProject
graphql_name 'OncallRotationCreate' graphql_name 'OncallRotationCreate'
include ResolvesProject
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
required: true, required: true,
description: 'Project to create the on-call schedule in.' description: 'Project to create the on-call schedule in.'
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module IncidentManagement module IncidentManagement
module OncallRotation module OncallRotation
class Update < Base class Update < Base
include ResolvesProject
graphql_name 'OncallRotationUpdate' graphql_name 'OncallRotationUpdate'
include ResolvesProject
argument :id, ::Types::GlobalIDType[::IncidentManagement::OncallRotation], argument :id, ::Types::GlobalIDType[::IncidentManagement::OncallRotation],
required: true, required: true,
description: 'ID of the on-call schedule to create the on-call rotation in.' description: 'ID of the on-call schedule to create the on-call rotation in.'
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module IncidentManagement module IncidentManagement
module OncallSchedule module OncallSchedule
class Create < OncallScheduleBase class Create < OncallScheduleBase
include FindsProject
graphql_name 'OncallScheduleCreate' graphql_name 'OncallScheduleCreate'
include FindsProject
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
required: true, required: true,
description: 'Project to create the on-call schedule in.' description: 'Project to create the on-call schedule in.'
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module Issues module Issues
class PromoteToEpic < Base class PromoteToEpic < Base
include Mutations::ResolvesGroup
graphql_name 'PromoteToEpic' graphql_name 'PromoteToEpic'
include Mutations::ResolvesGroup
argument :group_path, GraphQL::Types::ID, argument :group_path, GraphQL::Types::ID,
required: false, required: false,
description: 'Group the promoted epic will belong to.' description: 'Group the promoted epic will belong to.'
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module Iterations module Iterations
module Cadences module Cadences
class Create < BaseMutation class Create < BaseMutation
include Mutations::ResolvesGroup
graphql_name 'IterationCadenceCreate' graphql_name 'IterationCadenceCreate'
include Mutations::ResolvesGroup
authorize :create_iteration_cadence authorize :create_iteration_cadence
argument :group_path, GraphQL::Types::ID, required: true, argument :group_path, GraphQL::Types::ID, required: true,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module Iterations module Iterations
class Create < BaseMutation class Create < BaseMutation
include Mutations::ResolvesResourceParent
graphql_name 'iterationCreate' graphql_name 'iterationCreate'
include Mutations::ResolvesResourceParent
authorize :create_iteration authorize :create_iteration
field :iteration, field :iteration,
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
module Mutations module Mutations
module Iterations module Iterations
class Update < BaseMutation class Update < BaseMutation
graphql_name 'UpdateIteration'
include Mutations::ResolvesGroup include Mutations::ResolvesGroup
include ResolvesProject include ResolvesProject
graphql_name 'UpdateIteration'
authorize :admin_iteration authorize :admin_iteration
field :iteration, field :iteration,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module Projects module Projects
class SetLocked < BaseMutation class SetLocked < BaseMutation
include FindsProject
graphql_name 'ProjectSetLocked' graphql_name 'ProjectSetLocked'
include FindsProject
authorize :push_code authorize :push_code
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
......
...@@ -4,10 +4,10 @@ module Mutations ...@@ -4,10 +4,10 @@ module Mutations
module QualityManagement module QualityManagement
module TestCases module TestCases
class Create < BaseMutation class Create < BaseMutation
include FindsProject
graphql_name 'CreateTestCase' graphql_name 'CreateTestCase'
include FindsProject
authorize :create_test_case authorize :create_test_case
argument :title, GraphQL::Types::String, argument :title, GraphQL::Types::String,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module RequirementsManagement module RequirementsManagement
class CreateRequirement < BaseRequirement class CreateRequirement < BaseRequirement
include FindsProject
graphql_name 'CreateRequirement' graphql_name 'CreateRequirement'
include FindsProject
authorize :create_requirement authorize :create_requirement
def resolve(args) def resolve(args)
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
module Mutations module Mutations
module RequirementsManagement module RequirementsManagement
class ExportRequirements < BaseMutation class ExportRequirements < BaseMutation
graphql_name 'ExportRequirements'
include FindsProject include FindsProject
include CommonRequirementArguments include CommonRequirementArguments
graphql_name 'ExportRequirements'
authorize :export_requirements authorize :export_requirements
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
module Mutations module Mutations
module Security module Security
class TrainingProviderUpdate < BaseMutation class TrainingProviderUpdate < BaseMutation
include FindsProject
graphql_name 'SecurityTrainingUpdate' graphql_name 'SecurityTrainingUpdate'
include FindsProject
authorize :access_security_and_compliance authorize :access_security_and_compliance
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
......
...@@ -3,14 +3,13 @@ ...@@ -3,14 +3,13 @@
module Mutations module Mutations
module SecurityPolicy module SecurityPolicy
class AssignSecurityPolicyProject < BaseMutation class AssignSecurityPolicyProject < BaseMutation
include FindsProject
graphql_name 'SecurityPolicyProjectAssign' graphql_name 'SecurityPolicyProjectAssign'
description 'Assigns the specified project(`security_policy_project_id`) as security policy project '\ description 'Assigns the specified project(`security_policy_project_id`) as security policy project '\
'for the given project(`project_path`). If the project already has a security policy project, '\ 'for the given project(`project_path`). If the project already has a security policy project, '\
'this reassigns the project\'s security policy project with the given `security_policy_project_id`' 'this reassigns the project\'s security policy project with the given `security_policy_project_id`'
include FindsProject
authorize :update_security_orchestration_policy_project authorize :update_security_orchestration_policy_project
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
......
...@@ -3,12 +3,11 @@ ...@@ -3,12 +3,11 @@
module Mutations module Mutations
module SecurityPolicy module SecurityPolicy
class CommitScanExecutionPolicy < BaseMutation class CommitScanExecutionPolicy < BaseMutation
include FindsProject
graphql_name 'ScanExecutionPolicyCommit' graphql_name 'ScanExecutionPolicyCommit'
description 'Commits the `policy_yaml` content to the assigned security policy project for the given project(`project_path`)' description 'Commits the `policy_yaml` content to the assigned security policy project for the given project(`project_path`)'
include FindsProject
authorize :security_orchestration_policies authorize :security_orchestration_policies
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
......
...@@ -3,12 +3,11 @@ ...@@ -3,12 +3,11 @@
module Mutations module Mutations
module SecurityPolicy module SecurityPolicy
class CreateSecurityPolicyProject < BaseMutation class CreateSecurityPolicyProject < BaseMutation
include FindsProject
graphql_name 'SecurityPolicyProjectCreate' graphql_name 'SecurityPolicyProjectCreate'
description 'Creates and assigns a security policy project for the given project(`project_path`)' description 'Creates and assigns a security policy project for the given project(`project_path`)'
include FindsProject
authorize :update_security_orchestration_policy_project authorize :update_security_orchestration_policy_project
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
......
...@@ -3,12 +3,11 @@ ...@@ -3,12 +3,11 @@
module Mutations module Mutations
module SecurityPolicy module SecurityPolicy
class UnassignSecurityPolicyProject < BaseMutation class UnassignSecurityPolicyProject < BaseMutation
include FindsProject
graphql_name 'SecurityPolicyProjectUnassign' graphql_name 'SecurityPolicyProjectUnassign'
description 'Unassigns the security policy project for the given project(`project_path`).' description 'Unassigns the security policy project for the given project(`project_path`).'
include FindsProject
authorize :update_security_orchestration_policy_project authorize :update_security_orchestration_policy_project
argument :project_path, GraphQL::Types::ID, argument :project_path, GraphQL::Types::ID,
......
...@@ -5,11 +5,11 @@ module Types ...@@ -5,11 +5,11 @@ module Types
module CloudLicenses module CloudLicenses
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
class CurrentLicenseType < BaseObject class CurrentLicenseType < BaseObject
include ::Types::Admin::CloudLicenses::LicenseType
graphql_name 'CurrentLicense' graphql_name 'CurrentLicense'
description 'Represents the current license' description 'Represents the current license'
include ::Types::Admin::CloudLicenses::LicenseType
field :last_sync, ::Types::TimeType, null: true, field :last_sync, ::Types::TimeType, null: true,
description: 'Date when the license was last synced.', description: 'Date when the license was last synced.',
method: :last_synced_at method: :last_synced_at
......
...@@ -5,10 +5,10 @@ module Types ...@@ -5,10 +5,10 @@ module Types
module CloudLicenses module CloudLicenses
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
class LicenseHistoryEntryType < BaseObject class LicenseHistoryEntryType < BaseObject
include ::Types::Admin::CloudLicenses::LicenseType
graphql_name 'LicenseHistoryEntry' graphql_name 'LicenseHistoryEntry'
description 'Represents an entry from the Cloud License history' description 'Represents an entry from the Cloud License history'
include ::Types::Admin::CloudLicenses::LicenseType
end end
end end
end end
......
...@@ -5,6 +5,9 @@ module Types ...@@ -5,6 +5,9 @@ module Types
module CloudLicenses module CloudLicenses
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
class SubscriptionFutureEntryType < BaseObject class SubscriptionFutureEntryType < BaseObject
graphql_name 'SubscriptionFutureEntry'
description 'Represents an entry from the future subscriptions'
field :type, GraphQL::Types::String, null: false, field :type, GraphQL::Types::String, null: false,
description: 'Type of license the subscription will yield.' description: 'Type of license the subscription will yield.'
...@@ -28,9 +31,6 @@ module Types ...@@ -28,9 +31,6 @@ module Types
field :users_in_license_count, GraphQL::Types::Int, null: true, field :users_in_license_count, GraphQL::Types::Int, null: true,
description: 'Number of paid user seats.' description: 'Number of paid user seats.'
graphql_name 'SubscriptionFutureEntry'
description 'Represents an entry from the future subscriptions'
end end
end end
end end
......
...@@ -4,11 +4,11 @@ module Types ...@@ -4,11 +4,11 @@ module Types
module Boards module Boards
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
class EpicListType < BaseObject class EpicListType < BaseObject
include Gitlab::Utils::StrongMemoize
graphql_name 'EpicList' graphql_name 'EpicList'
description 'Represents an epic board list' description 'Represents an epic board list'
include Gitlab::Utils::StrongMemoize
accepts ::Boards::EpicList accepts ::Boards::EpicList
alias_method :list, :object alias_method :list, :object
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
module Types module Types
class DastSiteProfileType < BaseObject class DastSiteProfileType < BaseObject
REDACTED_REQUEST_HEADERS = '[Redacted]'
graphql_name 'DastSiteProfile' graphql_name 'DastSiteProfile'
description 'Represents a DAST Site Profile' description 'Represents a DAST Site Profile'
REDACTED_REQUEST_HEADERS = '[Redacted]'
present_using ::Dast::SiteProfilePresenter present_using ::Dast::SiteProfilePresenter
authorize :read_on_demand_dast_scan authorize :read_on_demand_dast_scan
......
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
module Types module Types
class EpicType < BaseObject class EpicType < BaseObject
include ::Gitlab::Graphql::Aggregations::Epics::Constants
graphql_name 'Epic' graphql_name 'Epic'
description 'Represents an epic' description 'Represents an epic'
include ::Gitlab::Graphql::Aggregations::Epics::Constants
accepts ::Epic accepts ::Epic
authorize :read_epic authorize :read_epic
......
...@@ -4,11 +4,11 @@ module Types ...@@ -4,11 +4,11 @@ module Types
module Geo module Geo
# rubocop:disable Graphql/AuthorizeTypes because it is included # rubocop:disable Graphql/AuthorizeTypes because it is included
class GroupWikiRepositoryRegistryType < BaseObject class GroupWikiRepositoryRegistryType < BaseObject
include ::Types::Geo::RegistryType
graphql_name 'GroupWikiRepositoryRegistry' graphql_name 'GroupWikiRepositoryRegistry'
description 'Represents the Geo sync and verification state of a group wiki repository' description 'Represents the Geo sync and verification state of a group wiki repository'
include ::Types::Geo::RegistryType
field :group_wiki_repository_id, GraphQL::Types::ID, null: false, description: 'ID of the Group Wiki Repository.' field :group_wiki_repository_id, GraphQL::Types::ID, null: false, description: 'ID of the Group Wiki Repository.'
end end
end end
......
...@@ -4,11 +4,11 @@ module Types ...@@ -4,11 +4,11 @@ module Types
module Geo module Geo
# rubocop:disable Graphql/AuthorizeTypes because it is included # rubocop:disable Graphql/AuthorizeTypes because it is included
class LfsObjectRegistryType < BaseObject class LfsObjectRegistryType < BaseObject
include ::Types::Geo::RegistryType
graphql_name 'LfsObjectRegistry' graphql_name 'LfsObjectRegistry'
description 'Represents the Geo sync and verification state of an LFS object' description 'Represents the Geo sync and verification state of an LFS object'
include ::Types::Geo::RegistryType
field :lfs_object_id, GraphQL::Types::ID, null: false, description: 'ID of the LFS object.' field :lfs_object_id, GraphQL::Types::ID, null: false, description: 'ID of the LFS object.'
end end
end end
......
...@@ -4,11 +4,11 @@ module Types ...@@ -4,11 +4,11 @@ module Types
module Geo module Geo
# rubocop:disable Graphql/AuthorizeTypes because it is included # rubocop:disable Graphql/AuthorizeTypes because it is included
class MergeRequestDiffRegistryType < BaseObject class MergeRequestDiffRegistryType < BaseObject
include ::Types::Geo::RegistryType
graphql_name 'MergeRequestDiffRegistry' graphql_name 'MergeRequestDiffRegistry'
description 'Represents the Geo sync and verification state of a Merge Request diff' description 'Represents the Geo sync and verification state of a Merge Request diff'
include ::Types::Geo::RegistryType
field :merge_request_diff_id, GraphQL::Types::ID, null: false, description: 'ID of the Merge Request diff.' field :merge_request_diff_id, GraphQL::Types::ID, null: false, description: 'ID of the Merge Request diff.'
end end
end end
......
...@@ -4,11 +4,11 @@ module Types ...@@ -4,11 +4,11 @@ module Types
module Geo module Geo
# rubocop:disable Graphql/AuthorizeTypes because it is included # rubocop:disable Graphql/AuthorizeTypes because it is included
class PackageFileRegistryType < BaseObject class PackageFileRegistryType < BaseObject
include ::Types::Geo::RegistryType
graphql_name 'PackageFileRegistry' graphql_name 'PackageFileRegistry'
description 'Represents the Geo sync and verification state of a package file' description 'Represents the Geo sync and verification state of a package file'
include ::Types::Geo::RegistryType
field :package_file_id, GraphQL::Types::ID, null: false, description: 'ID of the PackageFile.' field :package_file_id, GraphQL::Types::ID, null: false, description: 'ID of the PackageFile.'
end end
end end
......
...@@ -4,11 +4,11 @@ module Types ...@@ -4,11 +4,11 @@ module Types
module Geo module Geo
# rubocop:disable Graphql/AuthorizeTypes because it is included # rubocop:disable Graphql/AuthorizeTypes because it is included
class PagesDeploymentRegistryType < BaseObject class PagesDeploymentRegistryType < BaseObject
include ::Types::Geo::RegistryType
graphql_name 'PagesDeploymentRegistry' graphql_name 'PagesDeploymentRegistry'
description 'Represents the Geo replication and verification state of a pages_deployment' description 'Represents the Geo replication and verification state of a pages_deployment'
include ::Types::Geo::RegistryType
field :pages_deployment_id, GraphQL::Types::ID, null: false, description: 'ID of the Pages Deployment.' field :pages_deployment_id, GraphQL::Types::ID, null: false, description: 'ID of the Pages Deployment.'
end end
end end
......
...@@ -4,11 +4,11 @@ module Types ...@@ -4,11 +4,11 @@ module Types
module Geo module Geo
# rubocop:disable Graphql/AuthorizeTypes because it is included # rubocop:disable Graphql/AuthorizeTypes because it is included
class PipelineArtifactRegistryType < BaseObject class PipelineArtifactRegistryType < BaseObject
include ::Types::Geo::RegistryType
graphql_name 'PipelineArtifactRegistry' graphql_name 'PipelineArtifactRegistry'
description 'Represents the Geo sync and verification state of a pipeline artifact' description 'Represents the Geo sync and verification state of a pipeline artifact'
include ::Types::Geo::RegistryType
field :pipeline_artifact_id, GraphQL::Types::ID, null: false, description: 'ID of the pipeline artifact.' field :pipeline_artifact_id, GraphQL::Types::ID, null: false, description: 'ID of the pipeline artifact.'
end end
end end
......
...@@ -4,11 +4,11 @@ module Types ...@@ -4,11 +4,11 @@ module Types
module Geo module Geo
# rubocop:disable Graphql/AuthorizeTypes because it is included # rubocop:disable Graphql/AuthorizeTypes because it is included
class SnippetRepositoryRegistryType < BaseObject class SnippetRepositoryRegistryType < BaseObject
include ::Types::Geo::RegistryType
graphql_name 'SnippetRepositoryRegistry' graphql_name 'SnippetRepositoryRegistry'
description 'Represents the Geo sync and verification state of a snippet repository' description 'Represents the Geo sync and verification state of a snippet repository'
include ::Types::Geo::RegistryType
field :snippet_repository_id, GraphQL::Types::ID, null: false, description: 'ID of the Snippet Repository.' field :snippet_repository_id, GraphQL::Types::ID, null: false, description: 'ID of the Snippet Repository.'
end end
end end
......
...@@ -4,11 +4,11 @@ module Types ...@@ -4,11 +4,11 @@ module Types
module Geo module Geo
# rubocop:disable Graphql/AuthorizeTypes because it is included # rubocop:disable Graphql/AuthorizeTypes because it is included
class TerraformStateVersionRegistryType < BaseObject class TerraformStateVersionRegistryType < BaseObject
include ::Types::Geo::RegistryType
graphql_name 'TerraformStateVersionRegistry' graphql_name 'TerraformStateVersionRegistry'
description 'Represents the Geo sync and verification state of a terraform state version' description 'Represents the Geo sync and verification state of a terraform state version'
include ::Types::Geo::RegistryType
field :terraform_state_version_id, GraphQL::Types::ID, null: false, description: 'ID of the terraform state version.' field :terraform_state_version_id, GraphQL::Types::ID, null: false, description: 'ID of the terraform state version.'
end end
end end
......
...@@ -4,11 +4,11 @@ module Types ...@@ -4,11 +4,11 @@ module Types
module Geo module Geo
# rubocop:disable Graphql/AuthorizeTypes because it is included # rubocop:disable Graphql/AuthorizeTypes because it is included
class UploadRegistryType < BaseObject class UploadRegistryType < BaseObject
include ::Types::Geo::RegistryType
graphql_name 'UploadRegistry' graphql_name 'UploadRegistry'
description 'Represents the Geo replication and verification state of an upload.' description 'Represents the Geo replication and verification state of an upload.'
include ::Types::Geo::RegistryType
field :file_id, GraphQL::Types::ID, null: false, description: 'ID of the Upload.' field :file_id, GraphQL::Types::ID, null: false, description: 'ID of the Upload.'
end end
end end
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
module Types module Types
module IncidentManagement module IncidentManagement
class OncallRotationType < BaseObject class OncallRotationType < BaseObject
MAX_SHIFTS_FOR_TIMEFRAME = 350
graphql_name 'IncidentManagementOncallRotation' graphql_name 'IncidentManagementOncallRotation'
description 'Describes an incident management on-call rotation' description 'Describes an incident management on-call rotation'
MAX_SHIFTS_FOR_TIMEFRAME = 350
authorize :read_incident_management_oncall_schedule authorize :read_incident_management_oncall_schedule
field :id, field :id,
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
module Types module Types
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
class ScanType < BaseObject class ScanType < BaseObject
present_using ::Security::ScanPresenter
graphql_name 'Scan' graphql_name 'Scan'
description 'Represents the security scan information' description 'Represents the security scan information'
present_using ::Security::ScanPresenter
authorize :read_scan authorize :read_scan
field :name, GraphQL::Types::String, null: false, description: 'Name of the scan.' field :name, GraphQL::Types::String, null: false, description: 'Name of the scan.'
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
module Types module Types
class VulnerabilityDetailType < BaseUnion class VulnerabilityDetailType < BaseUnion
UnexpectedReportType = Class.new(StandardError) graphql_name 'VulnerabilityDetail'
description 'Represents a vulnerability detail field. The fields with data will depend on the vulnerability detail type' description 'Represents a vulnerability detail field. The fields with data will depend on the vulnerability detail type'
graphql_name 'VulnerabilityDetail' UnexpectedReportType = Class.new(StandardError)
possible_types VulnerabilityDetails::UrlType, possible_types VulnerabilityDetails::UrlType,
VulnerabilityDetails::IntType, VulnerabilityDetails::IntType,
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
module Types module Types
class VulnerabilityLocationType < BaseUnion class VulnerabilityLocationType < BaseUnion
UnexpectedReportType = Class.new(StandardError)
graphql_name 'VulnerabilityLocation' graphql_name 'VulnerabilityLocation'
description 'Represents a vulnerability location. The fields with data will depend on the vulnerability report type' description 'Represents a vulnerability location. The fields with data will depend on the vulnerability report type'
UnexpectedReportType = Class.new(StandardError)
possible_types VulnerabilityLocation::ClusterImageScanningType, possible_types VulnerabilityLocation::ClusterImageScanningType,
VulnerabilityLocation::ContainerScanningType, VulnerabilityLocation::ContainerScanningType,
VulnerabilityLocation::DependencyScanningType, VulnerabilityLocation::DependencyScanningType,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment