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
module AlertManagement
module HttpIntegration
class Create < HttpIntegrationBase
include FindsProject
graphql_name 'HttpIntegrationCreate'
include FindsProject
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Project to create the integration in.'
......
......@@ -4,10 +4,10 @@ module Mutations
module AlertManagement
module PrometheusIntegration
class Create < PrometheusIntegrationBase
include FindsProject
graphql_name 'PrometheusIntegrationCreate'
include FindsProject
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Project to create the integration in.'
......
......@@ -3,10 +3,9 @@
module Mutations
module Boards
class Create < ::Mutations::BaseMutation
include Mutations::ResolvesResourceParent
graphql_name 'CreateBoard'
include Mutations::ResolvesResourceParent
include Mutations::Boards::CommonMutationArguments
field :board,
......
......@@ -3,10 +3,10 @@
module Mutations
module Branches
class Create < BaseMutation
include FindsProject
graphql_name 'CreateBranch'
include FindsProject
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Project full path the branch is associated with.'
......
......@@ -3,10 +3,10 @@
module Mutations
module Ci
class CiCdSettingsUpdate < BaseMutation
include FindsProject
graphql_name 'CiCdSettingsUpdate'
include FindsProject
authorize :admin_project
argument :full_path, GraphQL::Types::ID,
......
......@@ -4,10 +4,10 @@ module Mutations
module Ci
module JobTokenScope
class AddProject < BaseMutation
include FindsProject
graphql_name 'CiJobTokenScopeAddProject'
include FindsProject
authorize :admin_project
argument :project_path, GraphQL::Types::ID,
......
......@@ -4,10 +4,10 @@ module Mutations
module Ci
module JobTokenScope
class RemoveProject < BaseMutation
include FindsProject
graphql_name 'CiJobTokenScopeRemoveProject'
include FindsProject
authorize :admin_project
argument :project_path, GraphQL::Types::ID,
......
......@@ -4,12 +4,12 @@ module Mutations
module Clusters
module Agents
class Create < BaseMutation
graphql_name 'CreateClusterAgent'
include FindsProject
authorize :create_cluster
graphql_name 'CreateClusterAgent'
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Full path of the associated project for this cluster agent.'
......
......@@ -3,6 +3,8 @@
module Mutations
module Commits
class Create < BaseMutation
graphql_name 'CommitCreate'
include FindsProject
class UrlHelpers
......@@ -10,8 +12,6 @@ module Mutations
include Gitlab::Routing
end
graphql_name 'CommitCreate'
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Project full path the branch is associated with.'
......
......@@ -3,10 +3,10 @@
module Mutations
module ContainerExpirationPolicies
class Update < Mutations::BaseMutation
include FindsProject
graphql_name 'UpdateContainerExpirationPolicy'
include FindsProject
authorize :destroy_container_image
argument :project_path,
......
......@@ -3,12 +3,11 @@
module Mutations
module ContainerRepositories
class DestroyTags < ::Mutations::ContainerRepositories::DestroyBase
LIMIT = 20
graphql_name 'DestroyContainerRepositoryTags'
LIMIT = 20
TOO_MANY_TAGS_ERROR_MESSAGE = "Number of tags is greater than #{LIMIT}"
graphql_name 'DestroyContainerRepositoryTags'
authorize :destroy_container_image
argument :id,
......
......@@ -3,10 +3,10 @@
module Mutations
module CustomEmoji
class Create < BaseMutation
include Mutations::ResolvesGroup
graphql_name 'CreateCustomEmoji'
include Mutations::ResolvesGroup
authorize :create_custom_emoji
field :custom_emoji,
......
......@@ -4,11 +4,11 @@ module Mutations
module CustomerRelations
module Contacts
class Create < BaseMutation
graphql_name 'CustomerRelationsContactCreate'
include ResolvesIds
include Gitlab::Graphql::Authorize::AuthorizeResource
graphql_name 'CustomerRelationsContactCreate'
field :contact,
Types::CustomerRelations::ContactType,
null: true,
......
......@@ -4,10 +4,10 @@ module Mutations
module CustomerRelations
module Contacts
class Update < Mutations::BaseMutation
include ResolvesIds
graphql_name 'CustomerRelationsContactUpdate'
include ResolvesIds
authorize :admin_crm_contact
field :contact,
......
......@@ -4,11 +4,11 @@ module Mutations
module CustomerRelations
module Organizations
class Create < BaseMutation
graphql_name 'CustomerRelationsOrganizationCreate'
include ResolvesIds
include Gitlab::Graphql::Authorize::AuthorizeResource
graphql_name 'CustomerRelationsOrganizationCreate'
field :organization,
Types::CustomerRelations::OrganizationType,
null: true,
......
......@@ -4,10 +4,10 @@ module Mutations
module CustomerRelations
module Organizations
class Update < Mutations::BaseMutation
include ResolvesIds
graphql_name 'CustomerRelationsOrganizationUpdate'
include ResolvesIds
authorize :admin_crm_organization
field :organization,
......
......@@ -4,10 +4,10 @@ module Mutations
module DependencyProxy
module GroupSettings
class Update < Mutations::BaseMutation
include Mutations::ResolvesGroup
graphql_name 'UpdateDependencyProxySettings'
include Mutations::ResolvesGroup
authorize :admin_dependency_proxy
argument :group_path,
......
......@@ -4,10 +4,10 @@ module Mutations
module DependencyProxy
module ImageTtlGroupPolicy
class Update < Mutations::BaseMutation
include Mutations::ResolvesGroup
graphql_name 'UpdateDependencyProxyImageTtlGroupPolicy'
include Mutations::ResolvesGroup
authorize :admin_dependency_proxy
argument :group_path,
......
......@@ -3,10 +3,10 @@
module Mutations
module DesignManagement
class Delete < Base
Errors = ::Gitlab::Graphql::Errors
graphql_name "DesignManagementDelete"
Errors = ::Gitlab::Graphql::Errors
argument :filenames, [GraphQL::Types::String],
required: true,
description: "Filenames of the designs to delete.",
......
......@@ -3,10 +3,10 @@
module Mutations
module Groups
class Update < Mutations::BaseMutation
include Mutations::ResolvesGroup
graphql_name 'GroupUpdate'
include Mutations::ResolvesGroup
authorize :admin_group
field :group, Types::GroupType,
......
......@@ -3,12 +3,12 @@
module Mutations
module Issues
class Create < BaseMutation
graphql_name 'CreateIssue'
include Mutations::SpamProtection
include FindsProject
include CommonMutationArguments
graphql_name 'CreateIssue'
authorize :create_issue
argument :project_path, GraphQL::Types::ID,
......
......@@ -3,10 +3,10 @@
module Mutations
module Issues
class SetConfidential < Base
include Mutations::SpamProtection
graphql_name 'IssueSetConfidential'
include Mutations::SpamProtection
argument :confidential,
GraphQL::Types::Boolean,
required: true,
......
......@@ -3,10 +3,10 @@
module Mutations
module JiraImport
class ImportUsers < BaseMutation
include FindsProject
graphql_name 'JiraImportUsers'
include FindsProject
authorize :admin_project
field :jira_users,
......
......@@ -3,10 +3,10 @@
module Mutations
module JiraImport
class Start < BaseMutation
include FindsProject
graphql_name 'JiraImportStart'
include FindsProject
authorize :admin_project
field :jira_import,
......
......@@ -3,10 +3,10 @@
module Mutations
module Labels
class Create < BaseMutation
include Mutations::ResolvesResourceParent
graphql_name 'LabelCreate'
include Mutations::ResolvesResourceParent
field :label,
Types::LabelType,
null: true,
......
......@@ -3,12 +3,6 @@
module Mutations
module MergeRequests
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'
authorize :accept_merge_request
description <<~DESC
......@@ -17,6 +11,12 @@ module Mutations
immediately if possible, or using one of the automatic merge strategies.
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,
::Types::MergeStrategyEnum,
required: false,
......
......@@ -3,10 +3,10 @@
module Mutations
module MergeRequests
class Create < BaseMutation
include FindsProject
graphql_name 'MergeRequestCreate'
include FindsProject
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Project full path the merge request is associated with.'
......
......@@ -4,10 +4,10 @@ module Mutations
module Namespace
module PackageSettings
class Update < Mutations::BaseMutation
include Mutations::ResolvesNamespace
graphql_name 'UpdateNamespacePackageSettings'
include Mutations::ResolvesNamespace
authorize :create_package_settings
argument :namespace_path,
......
......@@ -3,14 +3,13 @@
module Mutations
module ReleaseAssetLinks
class Create < BaseMutation
include FindsProject
graphql_name 'ReleaseAssetLinkCreate'
authorize :create_release
include FindsProject
include Types::ReleaseAssetLinkSharedInputArguments
authorize :create_release
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Full path of the project the asset link is associated with.'
......
......@@ -3,14 +3,14 @@
module Mutations
module Snippets
class Create < BaseMutation
graphql_name 'CreateSnippet'
include ServiceCompatibility
include CanMutateSpammable
include Mutations::SpamProtection
authorize :create_snippet
graphql_name 'CreateSnippet'
field :snippet,
Types::SnippetType,
null: true,
......
......@@ -3,12 +3,12 @@
module Mutations
module Snippets
class Update < Base
graphql_name 'UpdateSnippet'
include ServiceCompatibility
include CanMutateSpammable
include Mutations::SpamProtection
graphql_name 'UpdateSnippet'
argument :id, ::Types::GlobalIDType[::Snippet],
required: true,
description: 'Global ID of the snippet to update.'
......
......@@ -3,11 +3,11 @@
module Mutations
module WorkItems
class Create < BaseMutation
graphql_name 'WorkItemCreate'
include Mutations::SpamProtection
include FindsProject
graphql_name 'WorkItemCreate'
authorize :create_work_item
argument :description, GraphQL::Types::String,
......
......@@ -3,11 +3,10 @@
module Mutations
module WorkItems
class Delete < BaseMutation
graphql_name 'WorkItemDelete'
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."
graphql_name 'WorkItemDelete'
authorize :delete_work_item
argument :id, ::Types::GlobalIDType[::WorkItem],
......
......@@ -3,12 +3,11 @@
module Mutations
module WorkItems
class Update < BaseMutation
include Mutations::SpamProtection
graphql_name 'WorkItemUpdate'
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."
graphql_name 'WorkItemUpdate'
include Mutations::SpamProtection
authorize :update_work_item
......
......@@ -5,10 +5,11 @@ module Types
module Analytics
module UsageTrends
class MeasurementType < BaseObject
include Gitlab::Graphql::Authorize::AuthorizeResource
graphql_name 'UsageTrendsMeasurement'
description 'Represents a recorded measurement (object count) for the Admins'
include Gitlab::Graphql::Authorize::AuthorizeResource
authorize :read_usage_trends_measurement
field :recorded_at, Types::TimeType, null: true,
......
......@@ -3,11 +3,11 @@
module Types
module AlertManagement
class PrometheusIntegrationType < ::Types::BaseObject
include ::Gitlab::Routing
graphql_name 'AlertManagementPrometheusIntegration'
description 'An endpoint and credentials used to accept Prometheus alerts for a project'
include ::Gitlab::Routing
implements(Types::AlertManagement::IntegrationType)
authorize :admin_project
......
......@@ -3,11 +3,11 @@
module Types
# rubocop: disable Graphql/AuthorizeTypes
class BoardListType < BaseObject
include Gitlab::Utils::StrongMemoize
graphql_name 'BoardList'
description 'Represents a list for an issue board'
include Gitlab::Utils::StrongMemoize
alias_method :list, :object
field :id, GraphQL::Types::ID,
......
......@@ -3,12 +3,13 @@
module Types
module Ci
class RunnerType < BaseObject
graphql_name 'CiRunner'
edge_type_class(RunnerWebUrlEdge)
connection_type_class(Types::CountableConnectionType)
graphql_name 'CiRunner'
authorize :read_runner
present_using ::Ci::RunnerPresenter
expose_permissions Types::PermissionTypes::Ci::Runner
JOB_COUNT_LIMIT = 1000
......
......@@ -2,14 +2,14 @@
module Types
class GroupInvitationType < BaseObject
graphql_name 'GroupInvitation'
description 'Represents a Group Invitation'
expose_permissions Types::PermissionTypes::Group
authorize :admin_group
implements InvitationInterface
graphql_name 'GroupInvitation'
description 'Represents a Group Invitation'
field :group, Types::GroupType, null: true,
description: 'Group that a User is invited to.'
......
......@@ -2,14 +2,14 @@
module Types
class GroupMemberType < BaseObject
graphql_name 'GroupMember'
description 'Represents a Group Membership'
expose_permissions Types::PermissionTypes::Group
authorize :read_group
implements MemberInterface
graphql_name 'GroupMember'
description 'Represents a Group Membership'
field :group, Types::GroupType, null: true,
description: 'Group that a User is a member of.'
......
......@@ -3,11 +3,12 @@
module Types
module MergeRequests
class AssigneeType < ::Types::UserType
graphql_name 'MergeRequestAssignee'
description 'A user assigned to a merge request.'
include FindClosest
include ::Types::MergeRequests::InteractsWithMergeRequest
graphql_name 'MergeRequestAssignee'
description 'A user assigned to a merge request.'
authorize :read_user
end
end
......
......@@ -3,11 +3,12 @@
module Types
module MergeRequests
class ReviewerType < ::Types::UserType
graphql_name 'MergeRequestReviewer'
description 'A user assigned to a merge request as a reviewer.'
include FindClosest
include ::Types::MergeRequests::InteractsWithMergeRequest
graphql_name 'MergeRequestReviewer'
description 'A user assigned to a merge request as a reviewer.'
authorize :read_user
end
end
......
......@@ -4,8 +4,8 @@ module Types
module Metrics
module Dashboards
class AnnotationType < ::Types::BaseObject
authorize :read_metrics_dashboard_annotation
graphql_name 'MetricsDashboardAnnotation'
authorize :read_metrics_dashboard_annotation
field :description, GraphQL::Types::String, null: true,
description: 'Description of the annotation.'
......
......@@ -2,10 +2,10 @@
module Types
class MutationType < BaseObject
include Gitlab::Graphql::MountMutation
graphql_name 'Mutation'
include Gitlab::Graphql::MountMutation
mount_mutation Mutations::Admin::SidekiqQueues::DeleteJobs
mount_mutation Mutations::AlertManagement::CreateAlertIssue
mount_mutation Mutations::AlertManagement::UpdateAlertStatus
......
......@@ -3,10 +3,10 @@
module Types
module Notes
class DiscussionType < BaseObject
DiscussionID = ::Types::GlobalIDType[::Discussion]
graphql_name 'Discussion'
DiscussionID = ::Types::GlobalIDType[::Discussion]
authorize :read_note
implements(Types::ResolvableInterface)
......
......@@ -3,10 +3,11 @@
module Types
module Packages
class PackageDetailsType < PackageType
include ::PackagesHelper
graphql_name 'PackageDetailsType'
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
field :versions, ::Types::Packages::PackageType.connection_type, null: true,
......
......@@ -3,8 +3,8 @@
module Types
module PermissionTypes
class Issue < BasePermissionType
description 'Check permissions for the current user on a issue'
graphql_name 'IssuePermissions'
description 'Check permissions for the current user on a issue'
abilities :read_issue, :admin_issue, :update_issue, :reopen_issue,
:read_design, :create_design, :destroy_design,
......
......@@ -3,15 +3,16 @@
module Types
module PermissionTypes
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
remove_source_branch
cherry_pick_on_current_merge_request
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,
:update_merge_request, :create_note
......
......@@ -3,10 +3,10 @@
module Types
# rubocop: disable Graphql/AuthorizeTypes
class QueryComplexityType < ::Types::BaseObject
ANALYZER = GraphQL::Analysis::QueryComplexity.new { |_query, complexity| complexity }
graphql_name 'QueryComplexity'
ANALYZER = GraphQL::Analysis::QueryComplexity.new { |_query, complexity| complexity }
alias_method :query, :object
field :limit, GraphQL::Types::Int,
......
......@@ -4,10 +4,10 @@ module Types
# rubocop: disable Graphql/AuthorizeTypes
# This is presented through `Repository` that has its own authorization
class BlobType < BaseObject
present_using BlobPresenter
graphql_name 'RepositoryBlob'
present_using BlobPresenter
field :id, GraphQL::Types::ID, null: false,
description: 'ID of the blob.'
......
......@@ -3,10 +3,10 @@
module Types
module Terraform
class StateVersionType < BaseObject
include ::API::Helpers::RelatedResourcesHelpers
graphql_name 'TerraformStateVersion'
include ::API::Helpers::RelatedResourcesHelpers
authorize :read_terraform_state
field :id, GraphQL::Types::ID,
......
......@@ -4,12 +4,11 @@ module Types
# rubocop: disable Graphql/AuthorizeTypes
# This is presented through `Repository` that has its own authorization
class BlobType < BaseObject
implements Types::Tree::EntryType
graphql_name 'Blob'
implements Types::Tree::EntryType
present_using BlobPresenter
graphql_name 'Blob'
field :web_url, GraphQL::Types::String, null: true,
description: 'Web URL of the blob.'
field :web_path, GraphQL::Types::String, null: true,
......
......@@ -4,10 +4,10 @@ module Types
# rubocop: disable Graphql/AuthorizeTypes
# This is presented through `Repository` that has its own authorization
class SubmoduleType < BaseObject
implements Types::Tree::EntryType
graphql_name 'Submodule'
implements Types::Tree::EntryType
field :web_url, type: GraphQL::Types::String, null: true,
description: 'Web URL for the sub-module.'
field :tree_url, type: GraphQL::Types::String, null: true,
......
......@@ -4,13 +4,12 @@ module Types
# rubocop: disable Graphql/AuthorizeTypes
# This is presented through `Repository` that has its own authorization
class TreeEntryType < BaseObject
implements Types::Tree::EntryType
present_using TreeEntryPresenter
graphql_name 'TreeEntry'
description 'Represents a directory'
implements Types::Tree::EntryType
present_using TreeEntryPresenter
field :web_url, GraphQL::Types::String, null: true,
description: 'Web URL for the tree entry (directory).'
field :web_path, GraphQL::Types::String, null: true,
......
......@@ -5,12 +5,11 @@ module Mutations
module DevopsAdoption
module EnabledNamespaces
class BulkEnable < BaseMutation
include Mixins::CommonMethods
graphql_name 'BulkEnableDevopsAdoptionNamespaces'
description '**BETA** This endpoint is subject to change without notice.'
include Mixins::CommonMethods
argument :namespace_ids, [::Types::GlobalIDType[::Namespace]],
required: true,
description: 'List of Namespace IDs.'
......
......@@ -5,12 +5,11 @@ module Mutations
module DevopsAdoption
module EnabledNamespaces
class Disable < BaseMutation
include Mixins::CommonMethods
graphql_name 'DisableDevopsAdoptionNamespace'
description '**BETA** This endpoint is subject to change without notice.'
include Mixins::CommonMethods
argument :id, [::Types::GlobalIDType[::Analytics::DevopsAdoption::EnabledNamespace]],
required: true,
description: 'One or many IDs of the enabled namespaces to disable.'
......
......@@ -5,12 +5,11 @@ module Mutations
module DevopsAdoption
module EnabledNamespaces
class Enable < BaseMutation
include Mixins::CommonMethods
graphql_name 'EnableDevopsAdoptionNamespace'
description '**BETA** This endpoint is subject to change without notice.'
include Mixins::CommonMethods
argument :namespace_id, ::Types::GlobalIDType[::Namespace],
required: true,
description: 'Namespace ID.'
......
......@@ -6,10 +6,10 @@ module Mutations
module API
module CiConfiguration
class Create < BaseMutation
include FindsProject
graphql_name 'ApiFuzzingCiConfigurationCreate'
include FindsProject
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Full path of the project.'
......
......@@ -4,10 +4,10 @@ module Mutations
module AppSec::Fuzzing::Coverage
module Corpus
class Create < BaseMutation
include FindsProject
graphql_name 'CorpusCreate'
include FindsProject
authorize :create_coverage_fuzzing_corpus
argument :package_id, Types::GlobalIDType[::Packages::Package],
......
......@@ -4,12 +4,12 @@ module Mutations
module Boards
module EpicBoards
class Create < ::Mutations::BaseMutation
graphql_name 'EpicBoardCreate'
include Mutations::ResolvesGroup
include Mutations::Boards::CommonMutationArguments
prepend Mutations::Boards::ScopedBoardMutation
graphql_name 'EpicBoardCreate'
authorize :admin_epic_board
argument :group_path, GraphQL::Types::ID,
......
......@@ -4,11 +4,11 @@ module Mutations
module Boards
module EpicBoards
class Update < ::Mutations::BaseMutation
graphql_name 'EpicBoardUpdate'
include Mutations::Boards::CommonMutationArguments
prepend Mutations::Boards::ScopedBoardMutation
graphql_name 'EpicBoardUpdate'
authorize :admin_epic_board
argument :id,
......
......@@ -4,10 +4,10 @@ module Mutations
module Boards
module Epics
class Create < ::Mutations::BaseMutation
include Mutations::ResolvesGroup
graphql_name 'BoardEpicCreate'
include Mutations::ResolvesGroup
argument :group_path, GraphQL::Types::ID,
required: true,
description: 'Group the epic to create is in.'
......
......@@ -4,10 +4,10 @@ module Mutations
module Dast
module Profiles
class Create < BaseMutation
include FindsProject
graphql_name 'DastProfileCreate'
include FindsProject
field :dast_profile, ::Types::Dast::ProfileType,
null: true,
description: 'Created profile.'
......
......@@ -4,10 +4,10 @@ module Mutations
module Dast
module Profiles
class Run < BaseMutation
include FindsProject
graphql_name 'DastProfileRun'
include FindsProject
ProfileID = ::Types::GlobalIDType[::Dast::Profile]
field :pipeline_url, GraphQL::Types::String,
......
......@@ -4,10 +4,10 @@ module Mutations
module Dast
module Profiles
class Update < BaseMutation
include FindsProject
graphql_name 'DastProfileUpdate'
include FindsProject
ProfileID = ::Types::GlobalIDType[::Dast::Profile]
SiteProfileID = ::Types::GlobalIDType[::DastSiteProfile]
ScannerProfileID = ::Types::GlobalIDType[::DastScannerProfile]
......
......@@ -3,12 +3,12 @@
module Mutations
module DastOnDemandScans
class Create < BaseMutation
graphql_name 'DastOnDemandScanCreate'
include FindsProject
InvalidGlobalID = Class.new(StandardError)
graphql_name 'DastOnDemandScanCreate'
field :pipeline_url, GraphQL::Types::String,
null: true,
description: 'URL of the pipeline that was created.'
......
......@@ -3,10 +3,10 @@
module Mutations
module DastScannerProfiles
class Create < BaseMutation
include FindsProject
graphql_name 'DastScannerProfileCreate'
include FindsProject
field :id, ::Types::GlobalIDType[::DastScannerProfile],
null: true,
description: 'ID of the scanner profile.'
......
......@@ -3,10 +3,10 @@
module Mutations
module DastScannerProfiles
class Delete < BaseMutation
include FindsProject
graphql_name 'DastScannerProfileDelete'
include FindsProject
ScannerProfileID = ::Types::GlobalIDType[::DastScannerProfile]
argument :full_path, GraphQL::Types::ID,
......
......@@ -3,10 +3,10 @@
module Mutations
module DastScannerProfiles
class Update < BaseMutation
include FindsProject
graphql_name 'DastScannerProfileUpdate'
include FindsProject
ScannerProfileID = ::Types::GlobalIDType[::DastScannerProfile]
field :id, ScannerProfileID,
......
......@@ -3,11 +3,11 @@
module Mutations
module DastSiteProfiles
class Create < BaseMutation
graphql_name 'DastSiteProfileCreate'
include FindsProject
include Mutations::AppSec::Dast::SiteProfiles::SharedArguments
graphql_name 'DastSiteProfileCreate'
field :id, SiteProfileID,
null: true,
description: 'ID of the site profile.'
......
......@@ -3,11 +3,11 @@
module Mutations
module DastSiteProfiles
class Update < BaseMutation
graphql_name 'DastSiteProfileUpdate'
include FindsProject
include Mutations::AppSec::Dast::SiteProfiles::SharedArguments
graphql_name 'DastSiteProfileUpdate'
field :id, SiteProfileID,
null: true,
description: 'ID of the site profile.'
......
......@@ -3,10 +3,10 @@
module Mutations
module DastSiteTokens
class Create < BaseMutation
include FindsProject
graphql_name 'DastSiteTokenCreate'
include FindsProject
field :id, ::Types::GlobalIDType[::DastSiteToken],
null: true,
description: 'ID of the site token.'
......
......@@ -3,10 +3,10 @@
module Mutations
module DastSiteValidations
class Create < BaseMutation
include FindsProject
graphql_name 'DastSiteValidationCreate'
include FindsProject
field :id, ::Types::GlobalIDType[::DastSiteValidation],
null: true,
description: 'ID of the site validation.'
......
......@@ -3,10 +3,10 @@
module Mutations
module DastSiteValidations
class Revoke < BaseMutation
include FindsProject
graphql_name 'DastSiteValidationRevoke'
include FindsProject
argument :full_path, GraphQL::Types::ID,
required: true,
description: 'Project the site validation belongs to.'
......
......@@ -3,10 +3,10 @@
module Mutations
module Epics
class AddIssue < Base
include Mutations::ResolvesIssuable
graphql_name 'EpicAddIssue'
include Mutations::ResolvesIssuable
authorize :admin_epic
argument :project_path, GraphQL::Types::ID,
......
......@@ -3,11 +3,11 @@
module Mutations
module Epics
class Create < BaseMutation
graphql_name 'CreateEpic'
include Mutations::ResolvesGroup
prepend Mutations::SharedEpicArguments
graphql_name 'CreateEpic'
authorize :create_epic
field :epic,
......
......@@ -3,10 +3,10 @@
module Mutations
module Epics
class Update < Base
prepend Mutations::SharedEpicArguments
graphql_name 'UpdateEpic'
prepend Mutations::SharedEpicArguments
argument :state_event,
Types::EpicStateEventEnum,
required: false,
......
......@@ -4,10 +4,10 @@ module Mutations
module IncidentManagement
module EscalationPolicy
class Create < Base
include ResolvesProject
graphql_name 'EscalationPolicyCreate'
include ResolvesProject
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Project to create the escalation policy for.'
......
......@@ -4,10 +4,10 @@ module Mutations
module IncidentManagement
module OncallRotation
class Create < Base
include ResolvesProject
graphql_name 'OncallRotationCreate'
include ResolvesProject
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Project to create the on-call schedule in.'
......
......@@ -4,10 +4,10 @@ module Mutations
module IncidentManagement
module OncallRotation
class Update < Base
include ResolvesProject
graphql_name 'OncallRotationUpdate'
include ResolvesProject
argument :id, ::Types::GlobalIDType[::IncidentManagement::OncallRotation],
required: true,
description: 'ID of the on-call schedule to create the on-call rotation in.'
......
......@@ -4,10 +4,10 @@ module Mutations
module IncidentManagement
module OncallSchedule
class Create < OncallScheduleBase
include FindsProject
graphql_name 'OncallScheduleCreate'
include FindsProject
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Project to create the on-call schedule in.'
......
......@@ -3,10 +3,10 @@
module Mutations
module Issues
class PromoteToEpic < Base
include Mutations::ResolvesGroup
graphql_name 'PromoteToEpic'
include Mutations::ResolvesGroup
argument :group_path, GraphQL::Types::ID,
required: false,
description: 'Group the promoted epic will belong to.'
......
......@@ -4,10 +4,10 @@ module Mutations
module Iterations
module Cadences
class Create < BaseMutation
include Mutations::ResolvesGroup
graphql_name 'IterationCadenceCreate'
include Mutations::ResolvesGroup
authorize :create_iteration_cadence
argument :group_path, GraphQL::Types::ID, required: true,
......
......@@ -3,10 +3,10 @@
module Mutations
module Iterations
class Create < BaseMutation
include Mutations::ResolvesResourceParent
graphql_name 'iterationCreate'
include Mutations::ResolvesResourceParent
authorize :create_iteration
field :iteration,
......
......@@ -3,11 +3,11 @@
module Mutations
module Iterations
class Update < BaseMutation
graphql_name 'UpdateIteration'
include Mutations::ResolvesGroup
include ResolvesProject
graphql_name 'UpdateIteration'
authorize :admin_iteration
field :iteration,
......
......@@ -3,10 +3,10 @@
module Mutations
module Projects
class SetLocked < BaseMutation
include FindsProject
graphql_name 'ProjectSetLocked'
include FindsProject
authorize :push_code
argument :project_path, GraphQL::Types::ID,
......
......@@ -4,10 +4,10 @@ module Mutations
module QualityManagement
module TestCases
class Create < BaseMutation
include FindsProject
graphql_name 'CreateTestCase'
include FindsProject
authorize :create_test_case
argument :title, GraphQL::Types::String,
......
......@@ -3,10 +3,10 @@
module Mutations
module RequirementsManagement
class CreateRequirement < BaseRequirement
include FindsProject
graphql_name 'CreateRequirement'
include FindsProject
authorize :create_requirement
def resolve(args)
......
......@@ -3,11 +3,11 @@
module Mutations
module RequirementsManagement
class ExportRequirements < BaseMutation
graphql_name 'ExportRequirements'
include FindsProject
include CommonRequirementArguments
graphql_name 'ExportRequirements'
authorize :export_requirements
argument :project_path, GraphQL::Types::ID,
......
......@@ -3,10 +3,10 @@
module Mutations
module Security
class TrainingProviderUpdate < BaseMutation
include FindsProject
graphql_name 'SecurityTrainingUpdate'
include FindsProject
authorize :access_security_and_compliance
argument :project_path, GraphQL::Types::ID,
......
......@@ -3,14 +3,13 @@
module Mutations
module SecurityPolicy
class AssignSecurityPolicyProject < BaseMutation
include FindsProject
graphql_name 'SecurityPolicyProjectAssign'
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, '\
'this reassigns the project\'s security policy project with the given `security_policy_project_id`'
include FindsProject
authorize :update_security_orchestration_policy_project
argument :project_path, GraphQL::Types::ID,
......
......@@ -3,12 +3,11 @@
module Mutations
module SecurityPolicy
class CommitScanExecutionPolicy < BaseMutation
include FindsProject
graphql_name 'ScanExecutionPolicyCommit'
description 'Commits the `policy_yaml` content to the assigned security policy project for the given project(`project_path`)'
include FindsProject
authorize :security_orchestration_policies
argument :project_path, GraphQL::Types::ID,
......
......@@ -3,12 +3,11 @@
module Mutations
module SecurityPolicy
class CreateSecurityPolicyProject < BaseMutation
include FindsProject
graphql_name 'SecurityPolicyProjectCreate'
description 'Creates and assigns a security policy project for the given project(`project_path`)'
include FindsProject
authorize :update_security_orchestration_policy_project
argument :project_path, GraphQL::Types::ID,
......
......@@ -3,12 +3,11 @@
module Mutations
module SecurityPolicy
class UnassignSecurityPolicyProject < BaseMutation
include FindsProject
graphql_name 'SecurityPolicyProjectUnassign'
description 'Unassigns the security policy project for the given project(`project_path`).'
include FindsProject
authorize :update_security_orchestration_policy_project
argument :project_path, GraphQL::Types::ID,
......
......@@ -5,11 +5,11 @@ module Types
module CloudLicenses
# rubocop: disable Graphql/AuthorizeTypes
class CurrentLicenseType < BaseObject
include ::Types::Admin::CloudLicenses::LicenseType
graphql_name 'CurrentLicense'
description 'Represents the current license'
include ::Types::Admin::CloudLicenses::LicenseType
field :last_sync, ::Types::TimeType, null: true,
description: 'Date when the license was last synced.',
method: :last_synced_at
......
......@@ -5,10 +5,10 @@ module Types
module CloudLicenses
# rubocop: disable Graphql/AuthorizeTypes
class LicenseHistoryEntryType < BaseObject
include ::Types::Admin::CloudLicenses::LicenseType
graphql_name 'LicenseHistoryEntry'
description 'Represents an entry from the Cloud License history'
include ::Types::Admin::CloudLicenses::LicenseType
end
end
end
......
......@@ -5,6 +5,9 @@ module Types
module CloudLicenses
# rubocop: disable Graphql/AuthorizeTypes
class SubscriptionFutureEntryType < BaseObject
graphql_name 'SubscriptionFutureEntry'
description 'Represents an entry from the future subscriptions'
field :type, GraphQL::Types::String, null: false,
description: 'Type of license the subscription will yield.'
......@@ -28,9 +31,6 @@ module Types
field :users_in_license_count, GraphQL::Types::Int, null: true,
description: 'Number of paid user seats.'
graphql_name 'SubscriptionFutureEntry'
description 'Represents an entry from the future subscriptions'
end
end
end
......
......@@ -4,11 +4,11 @@ module Types
module Boards
# rubocop: disable Graphql/AuthorizeTypes
class EpicListType < BaseObject
include Gitlab::Utils::StrongMemoize
graphql_name 'EpicList'
description 'Represents an epic board list'
include Gitlab::Utils::StrongMemoize
accepts ::Boards::EpicList
alias_method :list, :object
......
......@@ -2,11 +2,11 @@
module Types
class DastSiteProfileType < BaseObject
REDACTED_REQUEST_HEADERS = '[Redacted]'
graphql_name 'DastSiteProfile'
description 'Represents a DAST Site Profile'
REDACTED_REQUEST_HEADERS = '[Redacted]'
present_using ::Dast::SiteProfilePresenter
authorize :read_on_demand_dast_scan
......
......@@ -2,10 +2,11 @@
module Types
class EpicType < BaseObject
include ::Gitlab::Graphql::Aggregations::Epics::Constants
graphql_name 'Epic'
description 'Represents an epic'
include ::Gitlab::Graphql::Aggregations::Epics::Constants
accepts ::Epic
authorize :read_epic
......
This diff is collapsed.
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