Class: Mutations::Notes::Destroy

Inherits:
Base
  • Object
show all
Defined in:
app/graphql/mutations/notes/destroy.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


15
16
17
18
19
20
21
22
23
24
25
# File 'app/graphql/mutations/notes/destroy.rb', line 15

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

  check_object_is_note!(note)

  ::Notes::DestroyService.new(note.project, current_user).execute(note)

  {
    errors: []
  }
end