diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-18 12:09:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-18 12:09:24 +0300 |
commit | 4720b569f0fcbb47e9f1a60e95172ae63b6f065a (patch) | |
tree | 5c6bcecbca227e608753a57a9aad19ccfe0567b6 /app/graphql | |
parent | cefe554b7ce2d0b52f9de855be832a47c2bc24ab (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/graphql')
-rw-r--r-- | app/graphql/mutations/issues/update.rb | 25 | ||||
-rw-r--r-- | app/graphql/types/mutation_type.rb | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/app/graphql/mutations/issues/update.rb b/app/graphql/mutations/issues/update.rb new file mode 100644 index 00000000000..119bc51e4a4 --- /dev/null +++ b/app/graphql/mutations/issues/update.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Mutations + module Issues + class Update < Base + graphql_name 'UpdateIssue' + + # Add arguments here instead of creating separate mutations + + def resolve(project_path:, iid:, **args) + issue = authorized_find!(project_path: project_path, iid: iid) + project = issue.project + + ::Issues::UpdateService.new(project, current_user, args).execute(issue) + + { + issue: issue, + errors: issue.errors.full_messages + } + end + end + end +end + +Mutations::Issues::Update.prepend_if_ee('::EE::Mutations::Issues::Update') diff --git a/app/graphql/types/mutation_type.rb b/app/graphql/types/mutation_type.rb index ee0f4dbb05f..90e9e1ec0b9 100644 --- a/app/graphql/types/mutation_type.rb +++ b/app/graphql/types/mutation_type.rb @@ -11,6 +11,7 @@ module Types mount_mutation Mutations::AwardEmojis::Toggle mount_mutation Mutations::Issues::SetConfidential mount_mutation Mutations::Issues::SetDueDate + mount_mutation Mutations::Issues::Update mount_mutation Mutations::MergeRequests::SetLabels mount_mutation Mutations::MergeRequests::SetLocked mount_mutation Mutations::MergeRequests::SetMilestone |