Class: Twenty::GraphQL::Mutation::CompleteTask

Inherits:
GraphQL::Schema::Mutation
  • Object
show all
Defined in:
lib/twenty-backend/graphql/mutation/complete_task.rb

Instance Method Summary collapse

Instance Method Details

#resolve(task_id:) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/twenty-backend/graphql/mutation/complete_task.rb', line 7

def resolve(task_id:)
  task = Twenty::Task.find(task_id)
  task.update!(status: :complete)
  {ok: true, errors: []}
rescue => ex
  {ok: false, errors: [ex.message]}
end