       output do
         field :task, :task
       end
-      resolve fn _, _ ->
-        {:ok, %{task: List.first(@tasks)}}
+      resolve fn _parent, attributes, _info ->
+        IO.inspect attributes
+        changeset = Repo.get!(Task, attributes.id) |> Task.changeset(attributes)
+        case Repo.update(changeset) do
+          {:ok, task} -> {:ok, %{task: task}}
+          {:error, changeset} -> {:error, changeset.errors}
+        end
       end
     end
 


  use Absinthe.Schema
  use Absinthe.Relay.Schema

  @tasks [
    %{id: 1, description: "Todo 1", estimated_size: 1,

      output do
        field :id, :id
      end
      resolve fn _parent, attributes, _info ->
        IO.inspect attributes
        task = Repo.get!(Task, attributes.id)
        Repo.delete(task)
        {:ok, %{id: task.id}}
      end
    end

