debian-mirror-gitlab/app/graphql/mutations/merge_requests/reviewer_rereview.rb
2021-10-27 15:23:28 +05:30

27 lines
835 B
Ruby

# frozen_string_literal: true
module Mutations
module MergeRequests
class ReviewerRereview < Base
graphql_name 'MergeRequestReviewerRereview'
argument :user_id, ::Types::GlobalIDType[::User],
loads: Types::UserType,
required: true,
description: <<~DESC
User ID for the user that has been requested for a new review.
DESC
def resolve(project_path:, iid:, user:)
merge_request = authorized_find!(project_path: project_path, iid: iid)
result = ::MergeRequests::RequestReviewService.new(project: merge_request.project, current_user: current_user).execute(merge_request, user)
{
merge_request: merge_request,
errors: Array(result[:message])
}
end
end
end
end