#+BEGIN_QUERY
{
:title ["Given a block UUID, return all blocks that reference this block and additionally have a page link to 'hello'. Also search through given block itself for references of 'hello' (implementation of proper path-refs for blocks)"]
:query [
:find (pull ?bout [*])
:in $ ?uuid %
:where
[?b :block/uuid ?uuid]
(or
[?bout :block/path-refs ?b]
(with-children-blocks ?b ?bout)
)
[?p :block/name "hello"]
[?bout :block/path-refs ?p]
]
:inputs [#uuid "<your uuid string>"]
:rules [
[(with-children-blocks ?bin ?bout)
[(identity ?bin) ?bout]]
[(with-children-blocks ?bin ?bout)
[?bchild :block/parent ?bin]
(with-children-blocks ?bchild ?bout)]
]
}
#+END_QUERY