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: ...@@ -662,73 +662,6 @@ RSpec/TimecopTravel:
Graphql/Descriptions: Graphql/Descriptions:
Exclude: 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/admin/analytics/instance_statistics/measurements_resolver.rb'
- 'app/graphql/resolvers/alert_management/alert_resolver.rb' - 'app/graphql/resolvers/alert_management/alert_resolver.rb'
- 'app/graphql/resolvers/alert_management/alert_status_counts_resolver.rb' - 'app/graphql/resolvers/alert_management/alert_status_counts_resolver.rb'
......
...@@ -18,12 +18,12 @@ module Mutations ...@@ -18,12 +18,12 @@ module Mutations
argument :queue_name, argument :queue_name,
GraphQL::STRING_TYPE, GraphQL::STRING_TYPE,
required: true, required: true,
description: 'The name of the queue to delete jobs from' description: 'The name of the queue to delete jobs from.'
field :result, field :result,
Types::Admin::SidekiqQueues::DeleteJobsResponseType, Types::Admin::SidekiqQueues::DeleteJobsResponseType,
null: true, null: true,
description: 'Information about the status of the deletion request' description: 'Information about the status of the deletion request.'
def ready?(**args) def ready?(**args)
unless current_user&.admin? unless current_user&.admin?
......
...@@ -7,26 +7,26 @@ module Mutations ...@@ -7,26 +7,26 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: true, 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, argument :iid, GraphQL::STRING_TYPE,
required: true, required: true,
description: "The IID of the alert to mutate" description: "The IID of the alert to mutate."
field :alert, field :alert,
Types::AlertManagement::AlertType, Types::AlertManagement::AlertType,
null: true, null: true,
description: "The alert after mutation" description: "The alert after mutation."
field :todo, field :todo,
Types::TodoType, Types::TodoType,
null: true, null: true,
description: "The todo after mutation" description: "The todo after mutation."
field :issue, field :issue,
Types::IssueType, Types::IssueType,
null: true, null: true,
description: "The issue created after mutation" description: "The issue created after mutation."
authorize :update_alert_management_alert authorize :update_alert_management_alert
......
...@@ -10,15 +10,15 @@ module Mutations ...@@ -10,15 +10,15 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: true, required: true,
description: 'The project to create the integration in' description: 'The project to create the integration in.'
argument :name, GraphQL::STRING_TYPE, argument :name, GraphQL::STRING_TYPE,
required: true, required: true,
description: 'The name of the integration' description: 'The name of the integration.'
argument :active, GraphQL::BOOLEAN_TYPE, argument :active, GraphQL::BOOLEAN_TYPE,
required: true, required: true,
description: 'Whether the integration is receiving alerts' description: 'Whether the integration is receiving alerts.'
def resolve(args) def resolve(args)
project = authorized_find!(full_path: args[:project_path]) project = authorized_find!(full_path: args[:project_path])
......
...@@ -8,7 +8,7 @@ module Mutations ...@@ -8,7 +8,7 @@ module Mutations
argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration], argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration],
required: true, required: true,
description: "The ID of the integration to remove" description: "The ID of the integration to remove."
def resolve(id:) def resolve(id:)
integration = authorized_find!(id: id) integration = authorized_find!(id: id)
......
...@@ -7,7 +7,7 @@ module Mutations ...@@ -7,7 +7,7 @@ module Mutations
field :integration, field :integration,
Types::AlertManagement::HttpIntegrationType, Types::AlertManagement::HttpIntegrationType,
null: true, null: true,
description: "The HTTP integration" description: "The HTTP integration."
authorize :admin_operations authorize :admin_operations
......
...@@ -8,7 +8,7 @@ module Mutations ...@@ -8,7 +8,7 @@ module Mutations
argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration], argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration],
required: true, required: true,
description: "The ID of the integration to mutate" description: "The ID of the integration to mutate."
def resolve(id:) def resolve(id:)
integration = authorized_find!(id: id) integration = authorized_find!(id: id)
......
...@@ -8,15 +8,15 @@ module Mutations ...@@ -8,15 +8,15 @@ module Mutations
argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration], argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration],
required: true, required: true,
description: "The ID of the integration to mutate" description: "The ID of the integration to mutate."
argument :name, GraphQL::STRING_TYPE, argument :name, GraphQL::STRING_TYPE,
required: false, required: false,
description: "The name of the integration" description: "The name of the integration."
argument :active, GraphQL::BOOLEAN_TYPE, argument :active, GraphQL::BOOLEAN_TYPE,
required: false, required: false,
description: "Whether the integration is receiving alerts" description: "Whether the integration is receiving alerts."
def resolve(args) def resolve(args)
integration = authorized_find!(id: args[:id]) integration = authorized_find!(id: args[:id])
......
...@@ -10,15 +10,15 @@ module Mutations ...@@ -10,15 +10,15 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: true, required: true,
description: 'The project to create the integration in' description: 'The project to create the integration in.'
argument :active, GraphQL::BOOLEAN_TYPE, argument :active, GraphQL::BOOLEAN_TYPE,
required: true, required: true,
description: 'Whether the integration is receiving alerts' description: 'Whether the integration is receiving alerts.'
argument :api_url, GraphQL::STRING_TYPE, argument :api_url, GraphQL::STRING_TYPE,
required: true, required: true,
description: 'Endpoint at which prometheus can be queried' description: 'Endpoint at which prometheus can be queried.'
def resolve(args) def resolve(args)
project = authorized_find!(full_path: args[:project_path]) project = authorized_find!(full_path: args[:project_path])
......
...@@ -7,7 +7,7 @@ module Mutations ...@@ -7,7 +7,7 @@ module Mutations
field :integration, field :integration,
Types::AlertManagement::PrometheusIntegrationType, Types::AlertManagement::PrometheusIntegrationType,
null: true, null: true,
description: "The newly created integration" description: "The newly created integration."
authorize :admin_project authorize :admin_project
......
...@@ -8,7 +8,7 @@ module Mutations ...@@ -8,7 +8,7 @@ module Mutations
argument :id, Types::GlobalIDType[::PrometheusService], argument :id, Types::GlobalIDType[::PrometheusService],
required: true, required: true,
description: "The ID of the integration to mutate" description: "The ID of the integration to mutate."
def resolve(id:) def resolve(id:)
integration = authorized_find!(id: id) integration = authorized_find!(id: id)
......
...@@ -8,15 +8,15 @@ module Mutations ...@@ -8,15 +8,15 @@ module Mutations
argument :id, Types::GlobalIDType[::PrometheusService], argument :id, Types::GlobalIDType[::PrometheusService],
required: true, required: true,
description: "The ID of the integration to mutate" description: "The ID of the integration to mutate."
argument :active, GraphQL::BOOLEAN_TYPE, argument :active, GraphQL::BOOLEAN_TYPE,
required: false, required: false,
description: "Whether the integration is receiving alerts" description: "Whether the integration is receiving alerts."
argument :api_url, GraphQL::STRING_TYPE, argument :api_url, GraphQL::STRING_TYPE,
required: false, required: false,
description: "Endpoint at which prometheus can be queried" description: "Endpoint at which prometheus can be queried."
def resolve(args) def resolve(args)
integration = authorized_find!(id: args[:id]) integration = authorized_find!(id: args[:id])
......
...@@ -7,7 +7,7 @@ module Mutations ...@@ -7,7 +7,7 @@ module Mutations
argument :status, Types::AlertManagement::StatusEnum, argument :status, Types::AlertManagement::StatusEnum,
required: true, required: true,
description: 'The status to set the alert' description: 'The status to set the alert.'
def resolve(project_path:, iid:, status:) def resolve(project_path:, iid:, status:)
alert = authorized_find!(project_path: project_path, iid: iid) alert = authorized_find!(project_path: project_path, iid: iid)
......
...@@ -12,7 +12,7 @@ module Mutations ...@@ -12,7 +12,7 @@ module Mutations
argument :awardable_id, argument :awardable_id,
::Types::GlobalIDType[::Awardable], ::Types::GlobalIDType[::Awardable],
required: true, required: true,
description: 'The global ID of the awardable resource' description: 'The global ID of the awardable resource.'
argument :name, argument :name,
GraphQL::STRING_TYPE, GraphQL::STRING_TYPE,
...@@ -22,7 +22,7 @@ module Mutations ...@@ -22,7 +22,7 @@ module Mutations
field :award_emoji, field :award_emoji,
Types::AwardEmojis::AwardEmojiType, Types::AwardEmojis::AwardEmojiType,
null: true, null: true,
description: 'The award emoji after mutation' description: 'The award emoji after mutation.'
private private
......
...@@ -8,11 +8,11 @@ module Mutations ...@@ -8,11 +8,11 @@ module Mutations
field :board, field :board,
Types::BoardType, Types::BoardType,
null: true, null: true,
description: 'The board after mutation' description: 'The board after mutation.'
argument :id, argument :id,
::Types::GlobalIDType[::Board], ::Types::GlobalIDType[::Board],
required: true, required: true,
description: 'The global ID of the board to destroy' description: 'The global ID of the board to destroy.'
authorize :admin_board authorize :admin_board
......
...@@ -9,31 +9,31 @@ module Mutations ...@@ -9,31 +9,31 @@ module Mutations
argument :board_id, GraphQL::ID_TYPE, argument :board_id, GraphQL::ID_TYPE,
required: true, required: true,
loads: Types::BoardType, 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, argument :project_path, GraphQL::ID_TYPE,
required: true, required: true,
description: 'Project the issue to mutate is in' description: 'Project the issue to mutate is in.'
argument :iid, GraphQL::STRING_TYPE, argument :iid, GraphQL::STRING_TYPE,
required: true, required: true,
description: 'IID of the issue to mutate' description: 'IID of the issue to mutate.'
argument :from_list_id, GraphQL::ID_TYPE, argument :from_list_id, GraphQL::ID_TYPE,
required: false, 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, argument :to_list_id, GraphQL::ID_TYPE,
required: false, 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, argument :move_before_id, GraphQL::ID_TYPE,
required: false, 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, argument :move_after_id, GraphQL::ID_TYPE,
required: false, 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) def ready?(**args)
if move_arguments(args).blank? if move_arguments(args).blank?
......
...@@ -8,12 +8,12 @@ module Mutations ...@@ -8,12 +8,12 @@ module Mutations
argument :board_id, ::Types::GlobalIDType[::Board], argument :board_id, ::Types::GlobalIDType[::Board],
required: true, required: true,
description: 'Global ID of the issue board to mutate' description: 'Global ID of the issue board to mutate.'
field :list, field :list,
Types::BoardListType, Types::BoardListType,
null: true, null: true,
description: 'List of the issue board' description: 'List of the issue board.'
authorize :admin_list authorize :admin_list
......
...@@ -8,11 +8,11 @@ module Mutations ...@@ -8,11 +8,11 @@ module Mutations
argument :backlog, GraphQL::BOOLEAN_TYPE, argument :backlog, GraphQL::BOOLEAN_TYPE,
required: false, required: false,
description: 'Create the backlog list' description: 'Create the backlog list.'
argument :label_id, ::Types::GlobalIDType[::Label], argument :label_id, ::Types::GlobalIDType[::Label],
required: false, required: false,
description: 'Global ID of an existing label' description: 'Global ID of an existing label.'
def ready?(**args) def ready?(**args)
if args.slice(*mutually_exclusive_args).size != 1 if args.slice(*mutually_exclusive_args).size != 1
......
...@@ -13,16 +13,16 @@ module Mutations ...@@ -13,16 +13,16 @@ module Mutations
argument :position, GraphQL::INT_TYPE, argument :position, GraphQL::INT_TYPE,
required: false, required: false,
description: 'Position of list within the board' description: 'Position of list within the board.'
argument :collapsed, GraphQL::BOOLEAN_TYPE, argument :collapsed, GraphQL::BOOLEAN_TYPE,
required: false, required: false,
description: 'Indicates if list is collapsed for this user' description: 'Indicates if list is collapsed for this user.'
field :list, field :list,
Types::BoardListType, Types::BoardListType,
null: true, null: true,
description: 'Mutated list' description: 'Mutated list.'
def resolve(list: nil, **args) def resolve(list: nil, **args)
raise_resource_not_available_error! unless can_read_list?(list) raise_resource_not_available_error! unless can_read_list?(list)
......
...@@ -9,21 +9,21 @@ module Mutations ...@@ -9,21 +9,21 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: true, 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, argument :name, GraphQL::STRING_TYPE,
required: true, required: true,
description: 'Name of the branch' description: 'Name of the branch.'
argument :ref, argument :ref,
GraphQL::STRING_TYPE, GraphQL::STRING_TYPE,
required: true, required: true,
description: 'Branch name or commit SHA to create branch from' description: 'Branch name or commit SHA to create branch from.'
field :branch, field :branch,
Types::BranchType, Types::BranchType,
null: true, null: true,
description: 'Branch after mutation' description: 'Branch after mutation.'
authorize :push_code authorize :push_code
......
...@@ -9,15 +9,15 @@ module Mutations ...@@ -9,15 +9,15 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: true, 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, argument :branch, GraphQL::STRING_TYPE,
required: true, 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, argument :start_branch, GraphQL::STRING_TYPE,
required: false, 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, argument :message,
GraphQL::STRING_TYPE, GraphQL::STRING_TYPE,
...@@ -27,12 +27,12 @@ module Mutations ...@@ -27,12 +27,12 @@ module Mutations
argument :actions, argument :actions,
[Types::CommitActionType], [Types::CommitActionType],
required: true, required: true,
description: 'Array of action hashes to commit as a batch' description: 'Array of action hashes to commit as a batch.'
field :commit, field :commit,
Types::CommitType, Types::CommitType,
null: true, null: true,
description: 'The commit after mutation' description: 'The commit after mutation.'
authorize :push_code authorize :push_code
......
...@@ -9,11 +9,11 @@ module Mutations ...@@ -9,11 +9,11 @@ module Mutations
included do included do
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: false, 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, argument :group_path, GraphQL::ID_TYPE,
required: false, required: false,
description: 'The group full path the resource is associated with' description: 'The group full path the resource is associated with.'
end end
def ready?(**args) def ready?(**args)
......
...@@ -7,7 +7,7 @@ module Mutations ...@@ -7,7 +7,7 @@ module Mutations
argument :subscribed_state, argument :subscribed_state,
GraphQL::BOOLEAN_TYPE, GraphQL::BOOLEAN_TYPE,
required: true, required: true,
description: 'The desired state of the subscription' description: 'The desired state of the subscription.'
end end
def resolve(project_path:, iid:, subscribed_state:) def resolve(project_path:, iid:, subscribed_state:)
......
...@@ -8,7 +8,7 @@ module Mutations ...@@ -8,7 +8,7 @@ module Mutations
field :spam, field :spam,
GraphQL::BOOLEAN_TYPE, GraphQL::BOOLEAN_TYPE,
null: true, 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 end
def with_spam_params(&block) def with_spam_params(&block)
......
...@@ -12,7 +12,7 @@ module Mutations ...@@ -12,7 +12,7 @@ module Mutations
argument :project_path, argument :project_path,
GraphQL::ID_TYPE, GraphQL::ID_TYPE,
required: true, 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, argument :enabled,
GraphQL::BOOLEAN_TYPE, GraphQL::BOOLEAN_TYPE,
...@@ -47,7 +47,7 @@ module Mutations ...@@ -47,7 +47,7 @@ module Mutations
field :container_expiration_policy, field :container_expiration_policy,
Types::ContainerExpirationPolicyType, Types::ContainerExpirationPolicyType,
null: true, null: true,
description: 'The container expiration policy after mutation' description: 'The container expiration policy after mutation.'
def resolve(project_path:, **args) def resolve(project_path:, **args)
project = authorized_find!(full_path: project_path) project = authorized_find!(full_path: project_path)
......
...@@ -28,7 +28,7 @@ module Mutations ...@@ -28,7 +28,7 @@ module Mutations
field :deleted_tag_names, field :deleted_tag_names,
[GraphQL::STRING_TYPE], [GraphQL::STRING_TYPE],
description: 'Deleted container repository tags', description: 'Deleted container repository tags.',
null: false null: false
def resolve(id:, tag_names:) def resolve(id:, tag_names:)
......
...@@ -12,20 +12,20 @@ module Mutations ...@@ -12,20 +12,20 @@ module Mutations
field :custom_emoji, field :custom_emoji,
Types::CustomEmojiType, Types::CustomEmojiType,
null: true, null: true,
description: 'The new custom emoji' description: 'The new custom emoji.'
argument :group_path, GraphQL::ID_TYPE, argument :group_path, GraphQL::ID_TYPE,
required: true, 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, argument :name, GraphQL::STRING_TYPE,
required: true, required: true,
description: 'Name of the emoji' description: 'Name of the emoji.'
argument :url, GraphQL::STRING_TYPE, argument :url, GraphQL::STRING_TYPE,
required: true, required: true,
as: :file, as: :file,
description: 'Location of the emoji file' description: 'Location of the emoji file.'
def resolve(group_path:, **args) def resolve(group_path:, **args)
group = authorized_find!(group_path: group_path) group = authorized_find!(group_path: group_path)
......
...@@ -7,11 +7,11 @@ module Mutations ...@@ -7,11 +7,11 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: true, 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, argument :iid, GraphQL::ID_TYPE,
required: true, required: true,
description: "The IID of the issue to modify designs for" description: "The IID of the issue to modify designs for."
private private
......
...@@ -9,14 +9,14 @@ module Mutations ...@@ -9,14 +9,14 @@ module Mutations
argument :filenames, [GraphQL::STRING_TYPE], argument :filenames, [GraphQL::STRING_TYPE],
required: true, required: true,
description: "The filenames of the designs to delete", description: "The filenames of the designs to delete.",
prepare: ->(names, _ctx) do prepare: ->(names, _ctx) do
names.presence || (raise Errors::ArgumentError, 'no filenames') names.presence || (raise Errors::ArgumentError, 'no filenames')
end end
field :version, Types::DesignManagement::VersionType, field :version, Types::DesignManagement::VersionType,
null: true, # null on error 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 authorize :destroy_design
......
...@@ -8,17 +8,17 @@ module Mutations ...@@ -8,17 +8,17 @@ module Mutations
DesignID = ::Types::GlobalIDType[::DesignManagement::Design] DesignID = ::Types::GlobalIDType[::DesignManagement::Design]
argument :id, DesignID, required: true, as: :current_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, 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, 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, field :design_collection, Types::DesignManagement::DesignCollectionType,
null: true, null: true,
description: "The current state of the collection" description: "The current state of the collection."
def resolve(**args) def resolve(**args)
service = ::DesignManagement::MoveDesignsService.new(current_user, parameters(**args)) service = ::DesignManagement::MoveDesignsService.new(current_user, parameters(**args))
......
...@@ -7,13 +7,13 @@ module Mutations ...@@ -7,13 +7,13 @@ module Mutations
argument :files, [ApolloUploadServer::Upload], argument :files, [ApolloUploadServer::Upload],
required: true, required: true,
description: "The files to upload" description: "The files to upload."
authorize :create_design authorize :create_design
field :designs, [Types::DesignManagement::DesignType], field :designs, [Types::DesignManagement::DesignType],
null: false, 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], field :skipped_designs, [Types::DesignManagement::DesignType],
null: false, null: false,
......
...@@ -10,17 +10,17 @@ module Mutations ...@@ -10,17 +10,17 @@ module Mutations
argument :id, argument :id,
Types::GlobalIDType[Discussion], Types::GlobalIDType[Discussion],
required: true, required: true,
description: 'The global ID of the discussion' description: 'The global ID of the discussion.'
argument :resolve, argument :resolve,
GraphQL::BOOLEAN_TYPE, GraphQL::BOOLEAN_TYPE,
required: true, 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, field :discussion,
Types::Notes::DiscussionType, Types::Notes::DiscussionType,
null: true, null: true,
description: 'The discussion after mutation' description: 'The discussion after mutation.'
def resolve(id:, resolve:) def resolve(id:, resolve:)
discussion = authorized_find_discussion!(id: id) discussion = authorized_find_discussion!(id: id)
......
...@@ -11,12 +11,12 @@ module Mutations ...@@ -11,12 +11,12 @@ module Mutations
argument :id, argument :id,
::Types::GlobalIDType[::Environment], ::Types::GlobalIDType[::Environment],
required: true, required: true,
description: 'The global ID of the environment to update' description: 'The global ID of the environment to update.'
argument :weight, argument :weight,
GraphQL::INT_TYPE, GraphQL::INT_TYPE,
required: true, required: true,
description: 'The weight of the Canary Ingress' description: 'The weight of the Canary Ingress.'
def resolve(id:, **kwargs) def resolve(id:, **kwargs)
environment = authorized_find!(id: id) environment = authorized_find!(id: id)
......
...@@ -7,16 +7,16 @@ module Mutations ...@@ -7,16 +7,16 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: true, 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, argument :iid, GraphQL::STRING_TYPE,
required: true, required: true,
description: "The IID of the issue to mutate" description: "The IID of the issue to mutate."
field :issue, field :issue,
Types::IssueType, Types::IssueType,
null: true, null: true,
description: "The issue after mutation" description: "The issue after mutation."
authorize :update_issue authorize :update_issue
......
...@@ -12,11 +12,11 @@ module Mutations ...@@ -12,11 +12,11 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: true, 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, argument :iid, GraphQL::INT_TYPE,
required: false, 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, argument :title, GraphQL::STRING_TYPE,
required: true, required: true,
...@@ -24,7 +24,7 @@ module Mutations ...@@ -24,7 +24,7 @@ module Mutations
argument :milestone_id, ::Types::GlobalIDType[::Milestone], argument :milestone_id, ::Types::GlobalIDType[::Milestone],
required: false, 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], argument :labels, [GraphQL::STRING_TYPE],
required: false, required: false,
...@@ -32,28 +32,28 @@ module Mutations ...@@ -32,28 +32,28 @@ module Mutations
argument :label_ids, [::Types::GlobalIDType[::Label]], argument :label_ids, [::Types::GlobalIDType[::Label]],
required: false, 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, argument :created_at, Types::TimeType,
required: false, 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], argument :merge_request_to_resolve_discussions_of, ::Types::GlobalIDType[::MergeRequest],
required: false, 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, argument :discussion_to_resolve, GraphQL::STRING_TYPE,
required: false, 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]], argument :assignee_ids, [::Types::GlobalIDType[::User]],
required: false, 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, field :issue,
Types::IssueType, Types::IssueType,
null: true, null: true,
description: 'The issue after mutation' description: 'The issue after mutation.'
def ready?(**args) def ready?(**args)
if args.slice(*mutually_exclusive_label_args).size > 1 if args.slice(*mutually_exclusive_label_args).size > 1
......
...@@ -8,7 +8,7 @@ module Mutations ...@@ -8,7 +8,7 @@ module Mutations
argument :target_project_path, argument :target_project_path,
GraphQL::ID_TYPE, GraphQL::ID_TYPE,
required: true, 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:) def resolve(project_path:, iid:, target_project_path:)
Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab/-/issues/267762') Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab/-/issues/267762')
......
...@@ -8,7 +8,7 @@ module Mutations ...@@ -8,7 +8,7 @@ module Mutations
argument :due_date, argument :due_date,
Types::TimeType, Types::TimeType,
required: true, 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:) def resolve(project_path:, iid:, due_date:)
issue = authorized_find!(project_path: project_path, iid: iid) issue = authorized_find!(project_path: project_path, iid: iid)
......
...@@ -8,7 +8,7 @@ module Mutations ...@@ -8,7 +8,7 @@ module Mutations
argument :locked, argument :locked,
GraphQL::BOOLEAN_TYPE, GraphQL::BOOLEAN_TYPE,
required: true, 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:) def resolve(project_path:, iid:, locked:)
issue = authorized_find!(project_path: project_path, iid: iid) issue = authorized_find!(project_path: project_path, iid: iid)
......
...@@ -13,18 +13,18 @@ module Mutations ...@@ -13,18 +13,18 @@ module Mutations
argument :milestone_id, GraphQL::ID_TYPE, # rubocop: disable Graphql/IDType argument :milestone_id, GraphQL::ID_TYPE, # rubocop: disable Graphql/IDType
required: false, 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], argument :add_label_ids, [GraphQL::ID_TYPE],
required: false, 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], argument :remove_label_ids, [GraphQL::ID_TYPE],
required: false, 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, argument :state_event, Types::IssueStateEventEnum,
description: 'Close or reopen an issue', description: 'Close or reopen an issue.',
required: false required: false
def resolve(project_path:, iid:, **args) def resolve(project_path:, iid:, **args)
......
...@@ -14,10 +14,10 @@ module Mutations ...@@ -14,10 +14,10 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: true, 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, argument :start_at, GraphQL::INT_TYPE,
required: false, 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) def resolve(project_path:, start_at: 0)
project = authorized_find!(full_path: project_path) project = authorized_find!(full_path: project_path)
......
...@@ -10,21 +10,21 @@ module Mutations ...@@ -10,21 +10,21 @@ module Mutations
field :jira_import, field :jira_import,
Types::JiraImportType, Types::JiraImportType,
null: true, null: true,
description: 'The Jira import data after mutation' description: 'The Jira import data after mutation.'
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: true, 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, argument :jira_project_key, GraphQL::STRING_TYPE,
required: true, 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, argument :jira_project_name, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'Project name of the importer Jira project' description: 'Project name of the importer Jira project.'
argument :users_mapping, argument :users_mapping,
[Types::JiraUsersMappingInputType], [Types::JiraUsersMappingInputType],
required: false, 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:) def resolve(project_path:, jira_project_key:, users_mapping:)
project = authorized_find!(full_path: project_path) project = authorized_find!(full_path: project_path)
......
...@@ -10,20 +10,20 @@ module Mutations ...@@ -10,20 +10,20 @@ module Mutations
field :label, field :label,
Types::LabelType, Types::LabelType,
null: true, null: true,
description: 'The label after mutation' description: 'The label after mutation.'
argument :title, GraphQL::STRING_TYPE, argument :title, GraphQL::STRING_TYPE,
required: true, required: true,
description: 'Title of the label' description: 'Title of the label.'
argument :description, GraphQL::STRING_TYPE, argument :description, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'Description of the label' description: 'Description of the label.'
argument :color, GraphQL::STRING_TYPE, argument :color, GraphQL::STRING_TYPE,
required: false, required: false,
default_value: Label::DEFAULT_COLOR, 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 authorize :admin_label
......
...@@ -7,16 +7,16 @@ module Mutations ...@@ -7,16 +7,16 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: true, 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, argument :iid, GraphQL::STRING_TYPE,
required: true, required: true,
description: "The IID of the merge request to mutate" description: "The IID of the merge request to mutate."
field :merge_request, field :merge_request,
Types::MergeRequestType, Types::MergeRequestType,
null: true, null: true,
description: "The merge request after mutation" description: "The merge request after mutation."
authorize :update_merge_request authorize :update_merge_request
......
...@@ -9,7 +9,7 @@ module Mutations ...@@ -9,7 +9,7 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: true, 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, argument :title, GraphQL::STRING_TYPE,
required: true, required: true,
...@@ -34,7 +34,7 @@ module Mutations ...@@ -34,7 +34,7 @@ module Mutations
field :merge_request, field :merge_request,
Types::MergeRequestType, Types::MergeRequestType,
null: true, null: true,
description: 'The merge request after mutation' description: 'The merge request after mutation.'
authorize :create_merge_request_from authorize :create_merge_request_from
......
...@@ -15,35 +15,35 @@ module Mutations ...@@ -15,35 +15,35 @@ module Mutations
field :annotation, field :annotation,
Types::Metrics::Dashboards::AnnotationType, Types::Metrics::Dashboards::AnnotationType,
null: true, null: true,
description: 'The created annotation' description: 'The created annotation.'
argument :environment_id, argument :environment_id,
::Types::GlobalIDType[::Environment], ::Types::GlobalIDType[::Environment],
required: false, 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, argument :cluster_id,
::Types::GlobalIDType[::Clusters::Cluster], ::Types::GlobalIDType[::Clusters::Cluster],
required: false, 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, argument :starting_at, Types::TimeType,
required: true, 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, argument :ending_at, Types::TimeType,
required: false, 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, argument :dashboard_path,
GraphQL::STRING_TYPE, GraphQL::STRING_TYPE,
required: true, 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, argument :description,
GraphQL::STRING_TYPE, GraphQL::STRING_TYPE,
required: true, required: true,
description: 'The description of the annotation' description: 'The description of the annotation.'
AnnotationSource = Struct.new(:object, keyword_init: true) do AnnotationSource = Struct.new(:object, keyword_init: true) do
def type_keys def type_keys
......
...@@ -11,7 +11,7 @@ module Mutations ...@@ -11,7 +11,7 @@ module Mutations
argument :id, ::Types::GlobalIDType[::Metrics::Dashboard::Annotation], argument :id, ::Types::GlobalIDType[::Metrics::Dashboard::Annotation],
required: true, required: true,
description: 'Global ID of the annotation to delete' description: 'Global ID of the annotation to delete.'
def resolve(id:) def resolve(id:)
annotation = authorized_find!(id: id) annotation = authorized_find!(id: id)
......
...@@ -6,7 +6,7 @@ module Mutations ...@@ -6,7 +6,7 @@ module Mutations
field :note, field :note,
Types::Notes::NoteType, Types::Notes::NoteType,
null: true, null: true,
description: 'The note after mutation' description: 'The note after mutation.'
private private
......
...@@ -11,7 +11,7 @@ module Mutations ...@@ -11,7 +11,7 @@ module Mutations
argument :noteable_id, argument :noteable_id,
::Types::GlobalIDType[::Noteable], ::Types::GlobalIDType[::Noteable],
required: true, 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, argument :body,
GraphQL::STRING_TYPE, GraphQL::STRING_TYPE,
......
...@@ -9,7 +9,7 @@ module Mutations ...@@ -9,7 +9,7 @@ module Mutations
argument :discussion_id, argument :discussion_id,
::Types::GlobalIDType[::Discussion], ::Types::GlobalIDType[::Discussion],
required: false, 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 private
......
...@@ -10,7 +10,7 @@ module Mutations ...@@ -10,7 +10,7 @@ module Mutations
argument :id, argument :id,
::Types::GlobalIDType[::Note], ::Types::GlobalIDType[::Note],
required: true, required: true,
description: 'The global ID of the note to destroy' description: 'The global ID of the note to destroy.'
def resolve(id:) def resolve(id:)
note = authorized_find!(id: id) note = authorized_find!(id: id)
......
...@@ -16,7 +16,7 @@ module Mutations ...@@ -16,7 +16,7 @@ module Mutations
loads: Types::Notes::NoteType, loads: Types::Notes::NoteType,
as: :note, as: :note,
required: true, required: true,
description: 'The global ID of the DiffNote to update' description: 'The global ID of the DiffNote to update.'
argument :position, argument :position,
Types::Notes::UpdateDiffImagePositionInputType, Types::Notes::UpdateDiffImagePositionInputType,
......
...@@ -11,7 +11,7 @@ module Mutations ...@@ -11,7 +11,7 @@ module Mutations
argument :id, argument :id,
::Types::GlobalIDType[::Note], ::Types::GlobalIDType[::Note],
required: true, required: true,
description: 'The global ID of the note to update' description: 'The global ID of the note to update.'
def resolve(args) def resolve(args)
note = authorized_find!(id: args[:id]) note = authorized_find!(id: args[:id])
......
...@@ -7,7 +7,7 @@ module Mutations ...@@ -7,7 +7,7 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: true, 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 private
......
...@@ -8,23 +8,23 @@ module Mutations ...@@ -8,23 +8,23 @@ module Mutations
field :release, field :release,
Types::ReleaseType, Types::ReleaseType,
null: true, null: true,
description: 'The release after mutation' description: 'The release after mutation.'
argument :tag_name, GraphQL::STRING_TYPE, argument :tag_name, GraphQL::STRING_TYPE,
required: true, as: :tag, 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, argument :ref, GraphQL::STRING_TYPE,
required: false, 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, argument :name, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'Name of the release' description: 'Name of the release.'
argument :description, GraphQL::STRING_TYPE, argument :description, GraphQL::STRING_TYPE,
required: false, 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, argument :released_at, Types::TimeType,
required: false, required: false,
...@@ -36,7 +36,7 @@ module Mutations ...@@ -36,7 +36,7 @@ module Mutations
argument :assets, Types::ReleaseAssetsInputType, argument :assets, Types::ReleaseAssetsInputType,
required: false, required: false,
description: 'Assets associated to the release' description: 'Assets associated to the release.'
authorize :create_release authorize :create_release
......
...@@ -12,19 +12,19 @@ module Mutations ...@@ -12,19 +12,19 @@ module Mutations
argument :tag_name, GraphQL::STRING_TYPE, argument :tag_name, GraphQL::STRING_TYPE,
required: true, as: :tag, 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, argument :name, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'Name of the release' description: 'Name of the release.'
argument :description, GraphQL::STRING_TYPE, argument :description, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'Description (release notes) of the release' description: 'Description (release notes) of the release.'
argument :released_at, Types::TimeType, argument :released_at, Types::TimeType,
required: false, required: false,
description: 'The release date' description: 'The release date.'
argument :milestones, [GraphQL::STRING_TYPE], argument :milestones, [GraphQL::STRING_TYPE],
required: false, required: false,
......
...@@ -6,7 +6,7 @@ module Mutations ...@@ -6,7 +6,7 @@ module Mutations
field :snippet, field :snippet,
Types::SnippetType, Types::SnippetType,
null: true, null: true,
description: 'The snippet after mutation' description: 'The snippet after mutation.'
private private
......
...@@ -12,30 +12,30 @@ module Mutations ...@@ -12,30 +12,30 @@ module Mutations
field :snippet, field :snippet,
Types::SnippetType, Types::SnippetType,
null: true, null: true,
description: 'The snippet after mutation' description: 'The snippet after mutation.'
argument :title, GraphQL::STRING_TYPE, argument :title, GraphQL::STRING_TYPE,
required: true, required: true,
description: 'Title of the snippet' description: 'Title of the snippet.'
argument :description, GraphQL::STRING_TYPE, argument :description, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'Description of the snippet' description: 'Description of the snippet.'
argument :visibility_level, Types::VisibilityLevelsEnum, argument :visibility_level, Types::VisibilityLevelsEnum,
description: 'The visibility level of the snippet', description: 'The visibility level of the snippet.',
required: true required: true
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::ID_TYPE,
required: false, 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], argument :uploaded_files, [GraphQL::STRING_TYPE],
required: false, 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], 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 required: false
def resolve(project_path: nil, **args) def resolve(project_path: nil, **args)
......
...@@ -9,7 +9,7 @@ module Mutations ...@@ -9,7 +9,7 @@ module Mutations
argument :id, ::Types::GlobalIDType[::Snippet], argument :id, ::Types::GlobalIDType[::Snippet],
required: true, required: true,
description: 'The global ID of the snippet to destroy' description: 'The global ID of the snippet to destroy.'
def resolve(id:) def resolve(id:)
snippet = authorized_find!(id: id) snippet = authorized_find!(id: id)
......
...@@ -7,7 +7,7 @@ module Mutations ...@@ -7,7 +7,7 @@ module Mutations
argument :id, ::Types::GlobalIDType[::Snippet], argument :id, ::Types::GlobalIDType[::Snippet],
required: true, required: true,
description: 'The global ID of the snippet to update' description: 'The global ID of the snippet to update.'
def resolve(id:) def resolve(id:)
snippet = authorized_find!(id: id) snippet = authorized_find!(id: id)
......
...@@ -9,22 +9,22 @@ module Mutations ...@@ -9,22 +9,22 @@ module Mutations
argument :id, ::Types::GlobalIDType[::Snippet], argument :id, ::Types::GlobalIDType[::Snippet],
required: true, 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, argument :title, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'Title of the snippet' description: 'Title of the snippet.'
argument :description, GraphQL::STRING_TYPE, argument :description, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'Description of the snippet' description: 'Description of the snippet.'
argument :visibility_level, Types::VisibilityLevelsEnum, argument :visibility_level, Types::VisibilityLevelsEnum,
description: 'The visibility level of the snippet', description: 'The visibility level of the snippet.',
required: false required: false
argument :blob_actions, [Types::Snippets::BlobActionInputType], 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 required: false
def resolve(id:, **args) def resolve(id:, **args)
......
...@@ -9,7 +9,7 @@ module Mutations ...@@ -9,7 +9,7 @@ module Mutations
argument :id, argument :id,
Types::GlobalIDType[::Terraform::State], Types::GlobalIDType[::Terraform::State],
required: true, required: true,
description: 'Global ID of the Terraform state' description: 'Global ID of the Terraform state.'
private private
......
...@@ -10,11 +10,11 @@ module Mutations ...@@ -10,11 +10,11 @@ module Mutations
argument :target_id, argument :target_id,
Types::GlobalIDType[Todoable], Types::GlobalIDType[Todoable],
required: true, 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, field :todo, Types::TodoType,
null: true, null: true,
description: 'The to-do created' description: 'The to-do created.'
def resolve(target_id:) def resolve(target_id:)
id = ::Types::GlobalIDType[Todoable].coerce_isolated_input(target_id) id = ::Types::GlobalIDType[Todoable].coerce_isolated_input(target_id)
......
...@@ -11,11 +11,11 @@ module Mutations ...@@ -11,11 +11,11 @@ module Mutations
[::Types::GlobalIDType[::Todo]], [::Types::GlobalIDType[::Todo]],
null: false, null: false,
deprecated: { reason: 'Use todos', milestone: '13.2' }, deprecated: { reason: 'Use todos', milestone: '13.2' },
description: 'Ids of the updated todos' description: 'Ids of the updated todos.'
field :todos, [::Types::TodoType], field :todos, [::Types::TodoType],
null: false, null: false,
description: 'Updated todos' description: 'Updated todos.'
def resolve def resolve
authorize!(current_user) authorize!(current_user)
......
...@@ -10,11 +10,11 @@ module Mutations ...@@ -10,11 +10,11 @@ module Mutations
argument :id, argument :id,
::Types::GlobalIDType[::Todo], ::Types::GlobalIDType[::Todo],
required: true, 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, field :todo, Types::TodoType,
null: false, null: false,
description: 'The requested todo' description: 'The requested todo.'
def resolve(id:) def resolve(id:)
todo = authorized_find!(id: id) todo = authorized_find!(id: id)
......
...@@ -10,11 +10,11 @@ module Mutations ...@@ -10,11 +10,11 @@ module Mutations
argument :id, argument :id,
::Types::GlobalIDType[::Todo], ::Types::GlobalIDType[::Todo],
required: true, required: true,
description: 'The global ID of the todo to restore' description: 'The global ID of the todo to restore.'
field :todo, Types::TodoType, field :todo, Types::TodoType,
null: false, null: false,
description: 'The requested todo' description: 'The requested todo.'
def resolve(id:) def resolve(id:)
todo = authorized_find!(id: id) todo = authorized_find!(id: id)
......
...@@ -10,16 +10,16 @@ module Mutations ...@@ -10,16 +10,16 @@ module Mutations
argument :ids, argument :ids,
[::Types::GlobalIDType[::Todo]], [::Types::GlobalIDType[::Todo]],
required: true, 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]], field :updated_ids, [::Types::GlobalIDType[Todo]],
null: false, 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' } deprecated: { reason: 'Use todos', milestone: '13.2' }
field :todos, [::Types::TodoType], field :todos, [::Types::TodoType],
null: false, null: false,
description: 'Updated todos' description: 'Updated todos.'
def resolve(ids:) def resolve(ids:)
check_update_amount_limit!(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