debian-mirror-gitlab/app/graphql/mutations/merge_requests/reviewer_rereview.rb

28 lines
816 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# 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
The 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(merge_request.project, current_user).execute(merge_request, user)
{
merge_request: merge_request,
errors: Array(result[:message])
}
end
end
end
end