       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
 

  query do
    field :tasks, list_of(:task) do
      resolve fn _, _ ->
        {:ok, @tasks}
      end
    end
  end

      output do
        field :task, :task
      end
      resolve fn _parent, attributes, _info ->
        IO.inspect attributes
        changeset = Task.changeset(%Task{type: "root"}, attributes)
        case Repo.insert(changeset) do
          {:ok, task} -> {:ok, %{task: task}}
          {:error, changeset} -> {:error, changeset.errors}
        end
      end
    end

    payload field :update_task do
      input do
        field :id, non_null(:id)
        field :estimated_size, :integer
        field :description, :string
        field :root_flg, :boolean
