Class: Mutations::Issues::SetDueDate

Inherits:
Base
  • Object
show all
Defined in:
app/graphql/mutations/issues/set_due_date.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:, due_date:) ⇒ Object


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

def resolve(project_path:, iid:, due_date:)
  issue = authorized_find!(project_path: project_path, iid: iid)
  project = issue.project

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

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