Try this:
#+BEGIN_QUERY
{
:title "Todos grouped by customer"
:query [:find (pull ?b [*])
:where
[?b :block/marker ?m]
[(= ?m "TODO")]]
:group-by-page? false
:result-transform
(fn [result]
(let [by-tag (group-by
(fn [b]
(let [tags (:block/tags b)]
(if (seq tags)
(clojure.string/join ", " tags)
"No Tag")))
result)]
(for [[tag blocks] by-tag]
[:div
[:h3 tag]
(for [b blocks]
[:div (first (:block/content b))])])))
}
#+END_QUERY