Class: Mutations::Todos::MarkDone

Inherits:
Base
  • Object
show all
Defined in:
app/graphql/mutations/todos/mark_done.rb

Constant Summary

Constants inherited from BaseMutation

BaseMutation::ERROR_MESSAGE

Instance Method Summary collapse

Methods inherited from BaseMutation

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

Instance Method Details

#resolve(id:) ⇒ Object


19
20
21
22
23
24
25
26
27
28
# File 'app/graphql/mutations/todos/mark_done.rb', line 19

def resolve(id:)
  todo = authorized_find!(id: id)

  mark_done(todo)

  {
    todo: todo.reset,
    errors: errors_on_object(todo)
  }
end