Class: Mutations::Issues::SetLocked

Inherits:
Base
  • Object
show all
Defined in:
app/graphql/mutations/issues/set_locked.rb

Constant Summary

Constants inherited from BaseMutation

BaseMutation::ERROR_MESSAGE

Instance Method Summary collapse

Methods included from ResolvesIssuable

#resolve_issuable

Methods inherited from BaseMutation

#api_user?, #current_user, #errors_on_object, #ready?

Instance Method Details

#resolve(project_path:, iid:, locked:) ⇒ Object


13
14
15
16
17
18
19
20
21
22
23
# File 'app/graphql/mutations/issues/set_locked.rb', line 13

def resolve(project_path:, iid:, locked:)
  issue = authorized_find!(project_path: project_path, iid: iid)

  ::Issues::UpdateService.new(issue.project, current_user, discussion_locked: locked)
    .execute(issue)

  {
    issue: issue,
    errors: errors_on_object(issue)
  }
end