Commit 0a2cacb6 authored by Luke Duncalfe's avatar Luke Duncalfe

Fix Graphql/Descriptions FOSS mutations offenses

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46721 introduced a
new rubocop that enforced periods at the end of GraphQL description
strings. Existing offenses were added to `.rubocop_manual_todo.yml`.

This change fixes offenses in `app/graphql/mutations` and subdirectories
and removes the exclusion of them from `.rubocop_manual_todo.yml`.

The changes were generated using the following autocorrect:

    bundle exec rubocop app/graphql/mutations \
      --auto-correct \
      --only Graphql/Descriptions

https://gitlab.com/gitlab-org/gitlab/-/issues/292426
parent 81832751
......@@ -662,73 +662,6 @@ RSpec/TimecopTravel:
Graphql/Descriptions:
Exclude:
- 'app/graphql/mutations/admin/sidekiq_queues/delete_jobs.rb'
- 'app/graphql/mutations/alert_management/base.rb'
- 'app/graphql/mutations/alert_management/http_integration/create.rb'
- 'app/graphql/mutations/alert_management/http_integration/destroy.rb'
- 'app/graphql/mutations/alert_management/http_integration/http_integration_base.rb'
- 'app/graphql/mutations/alert_management/http_integration/reset_token.rb'
- 'app/graphql/mutations/alert_management/http_integration/update.rb'
- 'app/graphql/mutations/alert_management/prometheus_integration/create.rb'
- 'app/graphql/mutations/alert_management/prometheus_integration/prometheus_integration_base.rb'
- 'app/graphql/mutations/alert_management/prometheus_integration/reset_token.rb'
- 'app/graphql/mutations/alert_management/prometheus_integration/update.rb'
- 'app/graphql/mutations/alert_management/update_alert_status.rb'
- 'app/graphql/mutations/award_emojis/base.rb'
- 'app/graphql/mutations/boards/destroy.rb'
- 'app/graphql/mutations/boards/issues/issue_move_list.rb'
- 'app/graphql/mutations/boards/lists/base.rb'
- 'app/graphql/mutations/boards/lists/create.rb'
- 'app/graphql/mutations/boards/lists/update.rb'
- 'app/graphql/mutations/branches/create.rb'
- 'app/graphql/mutations/ci/base.rb'
- 'app/graphql/mutations/ci/pipeline_retry.rb'
- 'app/graphql/mutations/commits/create.rb'
- 'app/graphql/mutations/concerns/mutations/resolves_resource_parent.rb'
- 'app/graphql/mutations/concerns/mutations/resolves_subscription.rb'
- 'app/graphql/mutations/concerns/mutations/spammable_mutation_fields.rb'
- 'app/graphql/mutations/container_expiration_policies/update.rb'
- 'app/graphql/mutations/container_repositories/destroy_tags.rb'
- 'app/graphql/mutations/custom_emoji/create.rb'
- 'app/graphql/mutations/design_management/base.rb'
- 'app/graphql/mutations/design_management/delete.rb'
- 'app/graphql/mutations/design_management/move.rb'
- 'app/graphql/mutations/design_management/upload.rb'
- 'app/graphql/mutations/discussions/toggle_resolve.rb'
- 'app/graphql/mutations/environments/canary_ingress/update.rb'
- 'app/graphql/mutations/issues/base.rb'
- 'app/graphql/mutations/issues/create.rb'
- 'app/graphql/mutations/issues/move.rb'
- 'app/graphql/mutations/issues/set_due_date.rb'
- 'app/graphql/mutations/issues/set_locked.rb'
- 'app/graphql/mutations/issues/update.rb'
- 'app/graphql/mutations/jira_import/import_users.rb'
- 'app/graphql/mutations/jira_import/start.rb'
- 'app/graphql/mutations/labels/create.rb'
- 'app/graphql/mutations/merge_requests/base.rb'
- 'app/graphql/mutations/merge_requests/create.rb'
- 'app/graphql/mutations/metrics/dashboard/annotations/create.rb'
- 'app/graphql/mutations/metrics/dashboard/annotations/delete.rb'
- 'app/graphql/mutations/notes/base.rb'
- 'app/graphql/mutations/notes/create/base.rb'
- 'app/graphql/mutations/notes/create/note.rb'
- 'app/graphql/mutations/notes/destroy.rb'
- 'app/graphql/mutations/notes/reposition_image_diff_note.rb'
- 'app/graphql/mutations/notes/update/base.rb'
- 'app/graphql/mutations/releases/base.rb'
- 'app/graphql/mutations/releases/create.rb'
- 'app/graphql/mutations/releases/update.rb'
- 'app/graphql/mutations/snippets/base.rb'
- 'app/graphql/mutations/snippets/create.rb'
- 'app/graphql/mutations/snippets/destroy.rb'
- 'app/graphql/mutations/snippets/mark_as_spam.rb'
- 'app/graphql/mutations/snippets/update.rb'
- 'app/graphql/mutations/terraform/state/base.rb'
- 'app/graphql/mutations/todos/create.rb'
- 'app/graphql/mutations/todos/mark_all_done.rb'
- 'app/graphql/mutations/todos/mark_done.rb'
- 'app/graphql/mutations/todos/restore.rb'
- 'app/graphql/mutations/todos/restore_many.rb'
- 'app/graphql/resolvers/admin/analytics/instance_statistics/measurements_resolver.rb'
- 'app/graphql/resolvers/alert_management/alert_resolver.rb'
- 'app/graphql/resolvers/alert_management/alert_status_counts_resolver.rb'
......
......@@ -18,12 +18,12 @@ module Mutations
argument :queue_name,
GraphQL::STRING_TYPE,
required: true,
description: 'The name of the queue to delete jobs from'
description: 'The name of the queue to delete jobs from.'
field :result,
Types::Admin::SidekiqQueues::DeleteJobsResponseType,
null: true,
description: 'Information about the status of the deletion request'
description: 'Information about the status of the deletion request.'
def ready?(**args)
unless current_user&.admin?
......
......@@ -7,26 +7,26 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: "The project the alert to mutate is in"
description: "The project the alert to mutate is in."
argument :iid, GraphQL::STRING_TYPE,
required: true,
description: "The IID of the alert to mutate"
description: "The IID of the alert to mutate."
field :alert,
Types::AlertManagement::AlertType,
null: true,
description: "The alert after mutation"
description: "The alert after mutation."
field :todo,
Types::TodoType,
null: true,
description: "The todo after mutation"
description: "The todo after mutation."
field :issue,
Types::IssueType,
null: true,
description: "The issue created after mutation"
description: "The issue created after mutation."
authorize :update_alert_management_alert
......
......@@ -10,15 +10,15 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: 'The project to create the integration in'
description: 'The project to create the integration in.'
argument :name, GraphQL::STRING_TYPE,
required: true,
description: 'The name of the integration'
description: 'The name of the integration.'
argument :active, GraphQL::BOOLEAN_TYPE,
required: true,
description: 'Whether the integration is receiving alerts'
description: 'Whether the integration is receiving alerts.'
def resolve(args)
project = authorized_find!(full_path: args[:project_path])
......
......@@ -8,7 +8,7 @@ module Mutations
argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration],
required: true,
description: "The ID of the integration to remove"
description: "The ID of the integration to remove."
def resolve(id:)
integration = authorized_find!(id: id)
......
......@@ -7,7 +7,7 @@ module Mutations
field :integration,
Types::AlertManagement::HttpIntegrationType,
null: true,
description: "The HTTP integration"
description: "The HTTP integration."
authorize :admin_operations
......
......@@ -8,7 +8,7 @@ module Mutations
argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration],
required: true,
description: "The ID of the integration to mutate"
description: "The ID of the integration to mutate."
def resolve(id:)
integration = authorized_find!(id: id)
......
......@@ -8,15 +8,15 @@ module Mutations
argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration],
required: true,
description: "The ID of the integration to mutate"
description: "The ID of the integration to mutate."
argument :name, GraphQL::STRING_TYPE,
required: false,
description: "The name of the integration"
description: "The name of the integration."
argument :active, GraphQL::BOOLEAN_TYPE,
required: false,
description: "Whether the integration is receiving alerts"
description: "Whether the integration is receiving alerts."
def resolve(args)
integration = authorized_find!(id: args[:id])
......
......@@ -10,15 +10,15 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: 'The project to create the integration in'
description: 'The project to create the integration in.'
argument :active, GraphQL::BOOLEAN_TYPE,
required: true,
description: 'Whether the integration is receiving alerts'
description: 'Whether the integration is receiving alerts.'
argument :api_url, GraphQL::STRING_TYPE,
required: true,
description: 'Endpoint at which prometheus can be queried'
description: 'Endpoint at which prometheus can be queried.'
def resolve(args)
project = authorized_find!(full_path: args[:project_path])
......
......@@ -7,7 +7,7 @@ module Mutations
field :integration,
Types::AlertManagement::PrometheusIntegrationType,
null: true,
description: "The newly created integration"
description: "The newly created integration."
authorize :admin_project
......
......@@ -8,7 +8,7 @@ module Mutations
argument :id, Types::GlobalIDType[::PrometheusService],
required: true,
description: "The ID of the integration to mutate"
description: "The ID of the integration to mutate."
def resolve(id:)
integration = authorized_find!(id: id)
......
......@@ -8,15 +8,15 @@ module Mutations
argument :id, Types::GlobalIDType[::PrometheusService],
required: true,
description: "The ID of the integration to mutate"
description: "The ID of the integration to mutate."
argument :active, GraphQL::BOOLEAN_TYPE,
required: false,
description: "Whether the integration is receiving alerts"
description: "Whether the integration is receiving alerts."
argument :api_url, GraphQL::STRING_TYPE,
required: false,
description: "Endpoint at which prometheus can be queried"
description: "Endpoint at which prometheus can be queried."
def resolve(args)
integration = authorized_find!(id: args[:id])
......
......@@ -7,7 +7,7 @@ module Mutations
argument :status, Types::AlertManagement::StatusEnum,
required: true,
description: 'The status to set the alert'
description: 'The status to set the alert.'
def resolve(project_path:, iid:, status:)
alert = authorized_find!(project_path: project_path, iid: iid)
......
......@@ -12,7 +12,7 @@ module Mutations
argument :awardable_id,
::Types::GlobalIDType[::Awardable],
required: true,
description: 'The global ID of the awardable resource'
description: 'The global ID of the awardable resource.'
argument :name,
GraphQL::STRING_TYPE,
......@@ -22,7 +22,7 @@ module Mutations
field :award_emoji,
Types::AwardEmojis::AwardEmojiType,
null: true,
description: 'The award emoji after mutation'
description: 'The award emoji after mutation.'
private
......
......@@ -8,11 +8,11 @@ module Mutations
field :board,
Types::BoardType,
null: true,
description: 'The board after mutation'
description: 'The board after mutation.'
argument :id,
::Types::GlobalIDType[::Board],
required: true,
description: 'The global ID of the board to destroy'
description: 'The global ID of the board to destroy.'
authorize :admin_board
......
......@@ -9,31 +9,31 @@ module Mutations
argument :board_id, GraphQL::ID_TYPE,
required: true,
loads: Types::BoardType,
description: 'Global ID of the board that the issue is in'
description: 'Global ID of the board that the issue is in.'
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: 'Project the issue to mutate is in'
description: 'Project the issue to mutate is in.'
argument :iid, GraphQL::STRING_TYPE,
required: true,
description: 'IID of the issue to mutate'
description: 'IID of the issue to mutate.'
argument :from_list_id, GraphQL::ID_TYPE,
required: false,
description: 'ID of the board list that the issue will be moved from'
description: 'ID of the board list that the issue will be moved from.'
argument :to_list_id, GraphQL::ID_TYPE,
required: false,
description: 'ID of the board list that the issue will be moved to'
description: 'ID of the board list that the issue will be moved to.'
argument :move_before_id, GraphQL::ID_TYPE,
required: false,
description: 'ID of issue that should be placed before the current issue'
description: 'ID of issue that should be placed before the current issue.'
argument :move_after_id, GraphQL::ID_TYPE,
required: false,
description: 'ID of issue that should be placed after the current issue'
description: 'ID of issue that should be placed after the current issue.'
def ready?(**args)
if move_arguments(args).blank?
......
......@@ -8,12 +8,12 @@ module Mutations
argument :board_id, ::Types::GlobalIDType[::Board],
required: true,
description: 'Global ID of the issue board to mutate'
description: 'Global ID of the issue board to mutate.'
field :list,
Types::BoardListType,
null: true,
description: 'List of the issue board'
description: 'List of the issue board.'
authorize :admin_list
......
......@@ -8,11 +8,11 @@ module Mutations
argument :backlog, GraphQL::BOOLEAN_TYPE,
required: false,
description: 'Create the backlog list'
description: 'Create the backlog list.'
argument :label_id, ::Types::GlobalIDType[::Label],
required: false,
description: 'Global ID of an existing label'
description: 'Global ID of an existing label.'
def ready?(**args)
if args.slice(*mutually_exclusive_args).size != 1
......
......@@ -13,16 +13,16 @@ module Mutations
argument :position, GraphQL::INT_TYPE,
required: false,
description: 'Position of list within the board'
description: 'Position of list within the board.'
argument :collapsed, GraphQL::BOOLEAN_TYPE,
required: false,
description: 'Indicates if list is collapsed for this user'
description: 'Indicates if list is collapsed for this user.'
field :list,
Types::BoardListType,
null: true,
description: 'Mutated list'
description: 'Mutated list.'
def resolve(list: nil, **args)
raise_resource_not_available_error! unless can_read_list?(list)
......
......@@ -9,21 +9,21 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: 'Project full path the branch is associated with'
description: 'Project full path the branch is associated with.'
argument :name, GraphQL::STRING_TYPE,
required: true,
description: 'Name of the branch'
description: 'Name of the branch.'
argument :ref,
GraphQL::STRING_TYPE,
required: true,
description: 'Branch name or commit SHA to create branch from'
description: 'Branch name or commit SHA to create branch from.'
field :branch,
Types::BranchType,
null: true,
description: 'Branch after mutation'
description: 'Branch after mutation.'
authorize :push_code
......
......@@ -9,15 +9,15 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: 'Project full path the branch is associated with'
description: 'Project full path the branch is associated with.'
argument :branch, GraphQL::STRING_TYPE,
required: true,
description: 'Name of the branch to commit into, it can be a new branch'
description: 'Name of the branch to commit into, it can be a new branch.'
argument :start_branch, GraphQL::STRING_TYPE,
required: false,
description: 'If on a new branch, name of the original branch'
description: 'If on a new branch, name of the original branch.'
argument :message,
GraphQL::STRING_TYPE,
......@@ -27,12 +27,12 @@ module Mutations
argument :actions,
[Types::CommitActionType],
required: true,
description: 'Array of action hashes to commit as a batch'
description: 'Array of action hashes to commit as a batch.'
field :commit,
Types::CommitType,
null: true,
description: 'The commit after mutation'
description: 'The commit after mutation.'
authorize :push_code
......
......@@ -9,11 +9,11 @@ module Mutations
included do
argument :project_path, GraphQL::ID_TYPE,
required: false,
description: 'The project full path the resource is associated with'
description: 'The project full path the resource is associated with.'
argument :group_path, GraphQL::ID_TYPE,
required: false,
description: 'The group full path the resource is associated with'
description: 'The group full path the resource is associated with.'
end
def ready?(**args)
......
......@@ -7,7 +7,7 @@ module Mutations
argument :subscribed_state,
GraphQL::BOOLEAN_TYPE,
required: true,
description: 'The desired state of the subscription'
description: 'The desired state of the subscription.'
end
def resolve(project_path:, iid:, subscribed_state:)
......
......@@ -8,7 +8,7 @@ module Mutations
field :spam,
GraphQL::BOOLEAN_TYPE,
null: true,
description: 'Indicates whether the operation returns a record detected as spam'
description: 'Indicates whether the operation returns a record detected as spam.'
end
def with_spam_params(&block)
......
......@@ -12,7 +12,7 @@ module Mutations
argument :project_path,
GraphQL::ID_TYPE,
required: true,
description: 'The project path where the container expiration policy is located'
description: 'The project path where the container expiration policy is located.'
argument :enabled,
GraphQL::BOOLEAN_TYPE,
......@@ -47,7 +47,7 @@ module Mutations
field :container_expiration_policy,
Types::ContainerExpirationPolicyType,
null: true,
description: 'The container expiration policy after mutation'
description: 'The container expiration policy after mutation.'
def resolve(project_path:, **args)
project = authorized_find!(full_path: project_path)
......
......@@ -28,7 +28,7 @@ module Mutations
field :deleted_tag_names,
[GraphQL::STRING_TYPE],
description: 'Deleted container repository tags',
description: 'Deleted container repository tags.',
null: false
def resolve(id:, tag_names:)
......
......@@ -12,20 +12,20 @@ module Mutations
field :custom_emoji,
Types::CustomEmojiType,
null: true,
description: 'The new custom emoji'
description: 'The new custom emoji.'
argument :group_path, GraphQL::ID_TYPE,
required: true,
description: 'Namespace full path the emoji is associated with'
description: 'Namespace full path the emoji is associated with.'
argument :name, GraphQL::STRING_TYPE,
required: true,
description: 'Name of the emoji'
description: 'Name of the emoji.'
argument :url, GraphQL::STRING_TYPE,
required: true,
as: :file,
description: 'Location of the emoji file'
description: 'Location of the emoji file.'
def resolve(group_path:, **args)
group = authorized_find!(group_path: group_path)
......
......@@ -7,11 +7,11 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: "The project where the issue is to upload designs for"
description: "The project where the issue is to upload designs for."
argument :iid, GraphQL::ID_TYPE,
required: true,
description: "The IID of the issue to modify designs for"
description: "The IID of the issue to modify designs for."
private
......
......@@ -9,14 +9,14 @@ module Mutations
argument :filenames, [GraphQL::STRING_TYPE],
required: true,
description: "The filenames of the designs to delete",
description: "The filenames of the designs to delete.",
prepare: ->(names, _ctx) do
names.presence || (raise Errors::ArgumentError, 'no filenames')
end
field :version, Types::DesignManagement::VersionType,
null: true, # null on error
description: 'The new version in which the designs are deleted'
description: 'The new version in which the designs are deleted.'
authorize :destroy_design
......
......@@ -8,17 +8,17 @@ module Mutations
DesignID = ::Types::GlobalIDType[::DesignManagement::Design]
argument :id, DesignID, required: true, as: :current_design,
description: "ID of the design to move"
description: "ID of the design to move."
argument :previous, DesignID, required: false, as: :previous_design,
description: "ID of the immediately preceding design"
description: "ID of the immediately preceding design."
argument :next, DesignID, required: false, as: :next_design,
description: "ID of the immediately following design"
description: "ID of the immediately following design."
field :design_collection, Types::DesignManagement::DesignCollectionType,
null: true,
description: "The current state of the collection"
description: "The current state of the collection."
def resolve(**args)
service = ::DesignManagement::MoveDesignsService.new(current_user, parameters(**args))
......
......@@ -7,13 +7,13 @@ module Mutations
argument :files, [ApolloUploadServer::Upload],
required: true,
description: "The files to upload"
description: "The files to upload."
authorize :create_design
field :designs, [Types::DesignManagement::DesignType],
null: false,
description: "The designs that were uploaded by the mutation"
description: "The designs that were uploaded by the mutation."
field :skipped_designs, [Types::DesignManagement::DesignType],
null: false,
......
......@@ -10,17 +10,17 @@ module Mutations
argument :id,
Types::GlobalIDType[Discussion],
required: true,
description: 'The global ID of the discussion'
description: 'The global ID of the discussion.'
argument :resolve,
GraphQL::BOOLEAN_TYPE,
required: true,
description: 'Will resolve the discussion when true, and unresolve the discussion when false'
description: 'Will resolve the discussion when true, and unresolve the discussion when false.'
field :discussion,
Types::Notes::DiscussionType,
null: true,
description: 'The discussion after mutation'
description: 'The discussion after mutation.'
def resolve(id:, resolve:)
discussion = authorized_find_discussion!(id: id)
......
......@@ -11,12 +11,12 @@ module Mutations
argument :id,
::Types::GlobalIDType[::Environment],
required: true,
description: 'The global ID of the environment to update'
description: 'The global ID of the environment to update.'
argument :weight,
GraphQL::INT_TYPE,
required: true,
description: 'The weight of the Canary Ingress'
description: 'The weight of the Canary Ingress.'
def resolve(id:, **kwargs)
environment = authorized_find!(id: id)
......
......@@ -7,16 +7,16 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: "The project the issue to mutate is in"
description: "The project the issue to mutate is in."
argument :iid, GraphQL::STRING_TYPE,
required: true,
description: "The IID of the issue to mutate"
description: "The IID of the issue to mutate."
field :issue,
Types::IssueType,
null: true,
description: "The issue after mutation"
description: "The issue after mutation."
authorize :update_issue
......
......@@ -12,11 +12,11 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: 'Project full path the issue is associated with'
description: 'Project full path the issue is associated with.'
argument :iid, GraphQL::INT_TYPE,
required: false,
description: 'The IID (internal ID) of a project issue. Only admins and project owners can modify'
description: 'The IID (internal ID) of a project issue. Only admins and project owners can modify.'
argument :title, GraphQL::STRING_TYPE,
required: true,
......@@ -24,7 +24,7 @@ module Mutations
argument :milestone_id, ::Types::GlobalIDType[::Milestone],
required: false,
description: 'The ID of the milestone to assign to the issue. On update milestone will be removed if set to null'
description: 'The ID of the milestone to assign to the issue. On update milestone will be removed if set to null.'
argument :labels, [GraphQL::STRING_TYPE],
required: false,
......@@ -32,28 +32,28 @@ module Mutations
argument :label_ids, [::Types::GlobalIDType[::Label]],
required: false,
description: 'The IDs of labels to be added to the issue'
description: 'The IDs of labels to be added to the issue.'
argument :created_at, Types::TimeType,
required: false,
description: 'Timestamp when the issue was created. Available only for admins and project owners'
description: 'Timestamp when the issue was created. Available only for admins and project owners.'
argument :merge_request_to_resolve_discussions_of, ::Types::GlobalIDType[::MergeRequest],
required: false,
description: 'The IID of a merge request for which to resolve discussions'
description: 'The IID of a merge request for which to resolve discussions.'
argument :discussion_to_resolve, GraphQL::STRING_TYPE,
required: false,
description: 'The ID of a discussion to resolve. Also pass `merge_request_to_resolve_discussions_of`'
description: 'The ID of a discussion to resolve. Also pass `merge_request_to_resolve_discussions_of`.'
argument :assignee_ids, [::Types::GlobalIDType[::User]],
required: false,
description: 'The array of user IDs to assign to the issue'
description: 'The array of user IDs to assign to the issue.'
field :issue,
Types::IssueType,
null: true,
description: 'The issue after mutation'
description: 'The issue after mutation.'
def ready?(**args)
if args.slice(*mutually_exclusive_label_args).size > 1
......
......@@ -8,7 +8,7 @@ module Mutations
argument :target_project_path,
GraphQL::ID_TYPE,
required: true,
description: 'The project to move the issue to'
description: 'The project to move the issue to.'
def resolve(project_path:, iid:, target_project_path:)
Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab/-/issues/267762')
......
......@@ -8,7 +8,7 @@ module Mutations
argument :due_date,
Types::TimeType,
required: true,
description: 'The desired due date for the issue'
description: 'The desired due date for the issue.'
def resolve(project_path:, iid:, due_date:)
issue = authorized_find!(project_path: project_path, iid: iid)
......
......@@ -8,7 +8,7 @@ module Mutations
argument :locked,
GraphQL::BOOLEAN_TYPE,
required: true,
description: 'Whether or not to lock discussion on the issue'
description: 'Whether or not to lock discussion on the issue.'
def resolve(project_path:, iid:, locked:)
issue = authorized_find!(project_path: project_path, iid: iid)
......
......@@ -13,18 +13,18 @@ module Mutations
argument :milestone_id, GraphQL::ID_TYPE, # rubocop: disable Graphql/IDType
required: false,
description: 'The ID of the milestone to assign to the issue. On update milestone will be removed if set to null'
description: 'The ID of the milestone to assign to the issue. On update milestone will be removed if set to null.'
argument :add_label_ids, [GraphQL::ID_TYPE],
required: false,
description: 'The IDs of labels to be added to the issue'
description: 'The IDs of labels to be added to the issue.'
argument :remove_label_ids, [GraphQL::ID_TYPE],
required: false,
description: 'The IDs of labels to be removed from the issue'
description: 'The IDs of labels to be removed from the issue.'
argument :state_event, Types::IssueStateEventEnum,
description: 'Close or reopen an issue',
description: 'Close or reopen an issue.',
required: false
def resolve(project_path:, iid:, **args)
......
......@@ -14,10 +14,10 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: 'The project to import the Jira users into'
description: 'The project to import the Jira users into.'
argument :start_at, GraphQL::INT_TYPE,
required: false,
description: 'The index of the record the import should started at, default 0 (50 records returned)'
description: 'The index of the record the import should started at, default 0 (50 records returned).'
def resolve(project_path:, start_at: 0)
project = authorized_find!(full_path: project_path)
......
......@@ -10,21 +10,21 @@ module Mutations
field :jira_import,
Types::JiraImportType,
null: true,
description: 'The Jira import data after mutation'
description: 'The Jira import data after mutation.'
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: 'The project to import the Jira project into'
description: 'The project to import the Jira project into.'
argument :jira_project_key, GraphQL::STRING_TYPE,
required: true,
description: 'Project key of the importer Jira project'
description: 'Project key of the importer Jira project.'
argument :jira_project_name, GraphQL::STRING_TYPE,
required: false,
description: 'Project name of the importer Jira project'
description: 'Project name of the importer Jira project.'
argument :users_mapping,
[Types::JiraUsersMappingInputType],
required: false,
description: 'The mapping of Jira to GitLab users'
description: 'The mapping of Jira to GitLab users.'
def resolve(project_path:, jira_project_key:, users_mapping:)
project = authorized_find!(full_path: project_path)
......
......@@ -10,20 +10,20 @@ module Mutations
field :label,
Types::LabelType,
null: true,
description: 'The label after mutation'
description: 'The label after mutation.'
argument :title, GraphQL::STRING_TYPE,
required: true,
description: 'Title of the label'
description: 'Title of the label.'
argument :description, GraphQL::STRING_TYPE,
required: false,
description: 'Description of the label'
description: 'Description of the label.'
argument :color, GraphQL::STRING_TYPE,
required: false,
default_value: Label::DEFAULT_COLOR,
description: "The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names in https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords"
description: "The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names in https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords."
authorize :admin_label
......
......@@ -7,16 +7,16 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: "The project the merge request to mutate is in"
description: "The project the merge request to mutate is in."
argument :iid, GraphQL::STRING_TYPE,
required: true,
description: "The IID of the merge request to mutate"
description: "The IID of the merge request to mutate."
field :merge_request,
Types::MergeRequestType,
null: true,
description: "The merge request after mutation"
description: "The merge request after mutation."
authorize :update_merge_request
......
......@@ -9,7 +9,7 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: 'Project full path the merge request is associated with'
description: 'Project full path the merge request is associated with.'
argument :title, GraphQL::STRING_TYPE,
required: true,
......@@ -34,7 +34,7 @@ module Mutations
field :merge_request,
Types::MergeRequestType,
null: true,
description: 'The merge request after mutation'
description: 'The merge request after mutation.'
authorize :create_merge_request_from
......
......@@ -15,35 +15,35 @@ module Mutations
field :annotation,
Types::Metrics::Dashboards::AnnotationType,
null: true,
description: 'The created annotation'
description: 'The created annotation.'
argument :environment_id,
::Types::GlobalIDType[::Environment],
required: false,
description: 'The global ID of the environment to add an annotation to'
description: 'The global ID of the environment to add an annotation to.'
argument :cluster_id,
::Types::GlobalIDType[::Clusters::Cluster],
required: false,
description: 'The global ID of the cluster to add an annotation to'
description: 'The global ID of the cluster to add an annotation to.'
argument :starting_at, Types::TimeType,
required: true,
description: 'Timestamp indicating starting moment to which the annotation relates'
description: 'Timestamp indicating starting moment to which the annotation relates.'
argument :ending_at, Types::TimeType,
required: false,
description: 'Timestamp indicating ending moment to which the annotation relates'
description: 'Timestamp indicating ending moment to which the annotation relates.'
argument :dashboard_path,
GraphQL::STRING_TYPE,
required: true,
description: 'The path to a file defining the dashboard on which the annotation should be added'
description: 'The path to a file defining the dashboard on which the annotation should be added.'
argument :description,
GraphQL::STRING_TYPE,
required: true,
description: 'The description of the annotation'
description: 'The description of the annotation.'
AnnotationSource = Struct.new(:object, keyword_init: true) do
def type_keys
......
......@@ -11,7 +11,7 @@ module Mutations
argument :id, ::Types::GlobalIDType[::Metrics::Dashboard::Annotation],
required: true,
description: 'Global ID of the annotation to delete'
description: 'Global ID of the annotation to delete.'
def resolve(id:)
annotation = authorized_find!(id: id)
......
......@@ -6,7 +6,7 @@ module Mutations
field :note,
Types::Notes::NoteType,
null: true,
description: 'The note after mutation'
description: 'The note after mutation.'
private
......
......@@ -11,7 +11,7 @@ module Mutations
argument :noteable_id,
::Types::GlobalIDType[::Noteable],
required: true,
description: 'The global ID of the resource to add a note to'
description: 'The global ID of the resource to add a note to.'
argument :body,
GraphQL::STRING_TYPE,
......
......@@ -9,7 +9,7 @@ module Mutations
argument :discussion_id,
::Types::GlobalIDType[::Discussion],
required: false,
description: 'The global ID of the discussion this note is in reply to'
description: 'The global ID of the discussion this note is in reply to.'
private
......
......@@ -10,7 +10,7 @@ module Mutations
argument :id,
::Types::GlobalIDType[::Note],
required: true,
description: 'The global ID of the note to destroy'
description: 'The global ID of the note to destroy.'
def resolve(id:)
note = authorized_find!(id: id)
......
......@@ -16,7 +16,7 @@ module Mutations
loads: Types::Notes::NoteType,
as: :note,
required: true,
description: 'The global ID of the DiffNote to update'
description: 'The global ID of the DiffNote to update.'
argument :position,
Types::Notes::UpdateDiffImagePositionInputType,
......
......@@ -11,7 +11,7 @@ module Mutations
argument :id,
::Types::GlobalIDType[::Note],
required: true,
description: 'The global ID of the note to update'
description: 'The global ID of the note to update.'
def resolve(args)
note = authorized_find!(id: args[:id])
......
......@@ -7,7 +7,7 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: 'Full path of the project the release is associated with'
description: 'Full path of the project the release is associated with.'
private
......
......@@ -8,23 +8,23 @@ module Mutations
field :release,
Types::ReleaseType,
null: true,
description: 'The release after mutation'
description: 'The release after mutation.'
argument :tag_name, GraphQL::STRING_TYPE,
required: true, as: :tag,
description: 'Name of the tag to associate with the release'
description: 'Name of the tag to associate with the release.'
argument :ref, GraphQL::STRING_TYPE,
required: false,
description: 'The commit SHA or branch name to use if creating a new tag'
description: 'The commit SHA or branch name to use if creating a new tag.'
argument :name, GraphQL::STRING_TYPE,
required: false,
description: 'Name of the release'
description: 'Name of the release.'
argument :description, GraphQL::STRING_TYPE,
required: false,
description: 'Description (also known as "release notes") of the release'
description: 'Description (also known as "release notes") of the release.'
argument :released_at, Types::TimeType,
required: false,
......@@ -36,7 +36,7 @@ module Mutations
argument :assets, Types::ReleaseAssetsInputType,
required: false,
description: 'Assets associated to the release'
description: 'Assets associated to the release.'
authorize :create_release
......
......@@ -12,19 +12,19 @@ module Mutations
argument :tag_name, GraphQL::STRING_TYPE,
required: true, as: :tag,
description: 'Name of the tag associated with the release'
description: 'Name of the tag associated with the release.'
argument :name, GraphQL::STRING_TYPE,
required: false,
description: 'Name of the release'
description: 'Name of the release.'
argument :description, GraphQL::STRING_TYPE,
required: false,
description: 'Description (release notes) of the release'
description: 'Description (release notes) of the release.'
argument :released_at, Types::TimeType,
required: false,
description: 'The release date'
description: 'The release date.'
argument :milestones, [GraphQL::STRING_TYPE],
required: false,
......
......@@ -6,7 +6,7 @@ module Mutations
field :snippet,
Types::SnippetType,
null: true,
description: 'The snippet after mutation'
description: 'The snippet after mutation.'
private
......
......@@ -12,30 +12,30 @@ module Mutations
field :snippet,
Types::SnippetType,
null: true,
description: 'The snippet after mutation'
description: 'The snippet after mutation.'
argument :title, GraphQL::STRING_TYPE,
required: true,
description: 'Title of the snippet'
description: 'Title of the snippet.'
argument :description, GraphQL::STRING_TYPE,
required: false,
description: 'Description of the snippet'
description: 'Description of the snippet.'
argument :visibility_level, Types::VisibilityLevelsEnum,
description: 'The visibility level of the snippet',
description: 'The visibility level of the snippet.',
required: true
argument :project_path, GraphQL::ID_TYPE,
required: false,
description: 'The project full path the snippet is associated with'
description: 'The project full path the snippet is associated with.'
argument :uploaded_files, [GraphQL::STRING_TYPE],
required: false,
description: 'The paths to files uploaded in the snippet description'
description: 'The paths to files uploaded in the snippet description.'
argument :blob_actions, [Types::Snippets::BlobActionInputType],
description: 'Actions to perform over the snippet repository and blobs',
description: 'Actions to perform over the snippet repository and blobs.',
required: false
def resolve(project_path: nil, **args)
......
......@@ -9,7 +9,7 @@ module Mutations
argument :id, ::Types::GlobalIDType[::Snippet],
required: true,
description: 'The global ID of the snippet to destroy'
description: 'The global ID of the snippet to destroy.'
def resolve(id:)
snippet = authorized_find!(id: id)
......
......@@ -7,7 +7,7 @@ module Mutations
argument :id, ::Types::GlobalIDType[::Snippet],
required: true,
description: 'The global ID of the snippet to update'
description: 'The global ID of the snippet to update.'
def resolve(id:)
snippet = authorized_find!(id: id)
......
......@@ -9,22 +9,22 @@ module Mutations
argument :id, ::Types::GlobalIDType[::Snippet],
required: true,
description: 'The global ID of the snippet to update'
description: 'The global ID of the snippet to update.'
argument :title, GraphQL::STRING_TYPE,
required: false,
description: 'Title of the snippet'
description: 'Title of the snippet.'
argument :description, GraphQL::STRING_TYPE,
required: false,
description: 'Description of the snippet'
description: 'Description of the snippet.'
argument :visibility_level, Types::VisibilityLevelsEnum,
description: 'The visibility level of the snippet',
description: 'The visibility level of the snippet.',
required: false
argument :blob_actions, [Types::Snippets::BlobActionInputType],
description: 'Actions to perform over the snippet repository and blobs',
description: 'Actions to perform over the snippet repository and blobs.',
required: false
def resolve(id:, **args)
......
......@@ -9,7 +9,7 @@ module Mutations
argument :id,
Types::GlobalIDType[::Terraform::State],
required: true,
description: 'Global ID of the Terraform state'
description: 'Global ID of the Terraform state.'
private
......
......@@ -10,11 +10,11 @@ module Mutations
argument :target_id,
Types::GlobalIDType[Todoable],
required: true,
description: "The global ID of the to-do item's parent. Issues, merge requests, designs and epics are supported"
description: "The global ID of the to-do item's parent. Issues, merge requests, designs and epics are supported."
field :todo, Types::TodoType,
null: true,
description: 'The to-do created'
description: 'The to-do created.'
def resolve(target_id:)
id = ::Types::GlobalIDType[Todoable].coerce_isolated_input(target_id)
......
......@@ -11,11 +11,11 @@ module Mutations
[::Types::GlobalIDType[::Todo]],
null: false,
deprecated: { reason: 'Use todos', milestone: '13.2' },
description: 'Ids of the updated todos'
description: 'Ids of the updated todos.'
field :todos, [::Types::TodoType],
null: false,
description: 'Updated todos'
description: 'Updated todos.'
def resolve
authorize!(current_user)
......
......@@ -10,11 +10,11 @@ module Mutations
argument :id,
::Types::GlobalIDType[::Todo],
required: true,
description: 'The global ID of the todo to mark as done'
description: 'The global ID of the todo to mark as done.'
field :todo, Types::TodoType,
null: false,
description: 'The requested todo'
description: 'The requested todo.'
def resolve(id:)
todo = authorized_find!(id: id)
......
......@@ -10,11 +10,11 @@ module Mutations
argument :id,
::Types::GlobalIDType[::Todo],
required: true,
description: 'The global ID of the todo to restore'
description: 'The global ID of the todo to restore.'
field :todo, Types::TodoType,
null: false,
description: 'The requested todo'
description: 'The requested todo.'
def resolve(id:)
todo = authorized_find!(id: id)
......
......@@ -10,16 +10,16 @@ module Mutations
argument :ids,
[::Types::GlobalIDType[::Todo]],
required: true,
description: 'The global IDs of the todos to restore (a maximum of 50 is supported at once)'
description: 'The global IDs of the todos to restore (a maximum of 50 is supported at once).'
field :updated_ids, [::Types::GlobalIDType[Todo]],
null: false,
description: 'The IDs of the updated todo items',
description: 'The IDs of the updated todo items.',
deprecated: { reason: 'Use todos', milestone: '13.2' }
field :todos, [::Types::TodoType],
null: false,
description: 'Updated todos'
description: 'Updated todos.'
def resolve(ids:)
check_update_amount_limit!(ids)
......
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