2019-11-15 01:06:13 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
module MergeRequests
|
|
|
|
class SetLocked < Base
|
|
|
|
graphql_name 'MergeRequestSetLocked'
|
|
|
|
|
|
|
|
argument :locked,
|
|
|
|
GraphQL::BOOLEAN_TYPE,
|
|
|
|
required: true,
|
|
|
|
description: <<~DESC
|
|
|
|
Whether or not to lock the merge request.
|
|
|
|
DESC
|
|
|
|
|
|
|
|
def resolve(project_path:, iid:, locked:)
|
|
|
|
merge_request = authorized_find!(project_path: project_path, iid: iid)
|
|
|
|
project = merge_request.project
|
|
|
|
|
|
|
|
::MergeRequests::UpdateService.new(project, current_user, discussion_locked: locked)
|
|
|
|
.execute(merge_request)
|
|
|
|
|
|
|
|
{
|
|
|
|
merge_request: merge_request,
|
2020-05-20 08:07:52 -04:00
|
|
|
errors: errors_on_object(merge_request)
|
2019-11-15 01:06:13 -05:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|