From a7b3560714b4d9cc4ab32dffcd1f74a284b93580 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 18 Feb 2022 09:45:46 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-8-stable-ee --- app/graphql/mutations/issues/create.rb | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'app/graphql/mutations/issues/create.rb') diff --git a/app/graphql/mutations/issues/create.rb b/app/graphql/mutations/issues/create.rb index 72b03cc27c2..6bf8caf82d7 100644 --- a/app/graphql/mutations/issues/create.rb +++ b/app/graphql/mutations/issues/create.rb @@ -3,12 +3,12 @@ module Mutations module Issues class Create < BaseMutation + graphql_name 'CreateIssue' + include Mutations::SpamProtection include FindsProject include CommonMutationArguments - graphql_name 'CreateIssue' - authorize :create_issue argument :project_path, GraphQL::Types::ID, @@ -51,6 +51,14 @@ module Mutations required: false, description: 'Array of user IDs to assign to the issue.' + argument :move_before_id, ::Types::GlobalIDType[::Issue], + required: false, + description: 'Global ID of issue that should be placed before the current issue.' + + argument :move_after_id, ::Types::GlobalIDType[::Issue], + required: false, + description: 'Global ID of issue that should be placed after the current issue.' + field :issue, Types::IssueType, null: true, @@ -93,6 +101,13 @@ module Mutations params[:assignee_ids] &&= params[:assignee_ids].map { |assignee_id| assignee_id&.model_id } params[:label_ids] &&= params[:label_ids].map { |label_id| label_id&.model_id } + if params[:move_before_id].present? || params[:move_after_id].present? + params[:move_between_ids] = [ + params.delete(:move_before_id)&.model_id, + params.delete(:move_after_id)&.model_id + ] + end + params end -- cgit v1.2.3