Class: Twenty::GraphQL::Mutation::UpdateTask

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

Instance Method Summary collapse

Instance Method Details

#resolve(task_id:, input:) ⇒ Object



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

def resolve(task_id:, input:)
  task = Twenty::Task.find_by(id: task_id)
  task.update!(input.to_h)
  {"errors" => []}
rescue => ex
  {"errors" => [ex.message]}
end