Logseq query to find all references to a block

There are plenty of examples of how to query all references to a page, but I found no examples how to do such a thing for blocks.

This is a method that I found that works, but there may be better ways:

#+BEGIN_QUERY
{
:title [:b "Links to block" ]
:query [:find (pull ?b [*])
:where
[?b :block/refs [:block/uuid #uuid "659ac433-b189-49b7-8601-d04338d2dd5e"]]]
}
#+END_QUERY

Replace the UUID with the UUID of your block (easily found when copying the reference to the block).

no responses for Logseq query to find all references to a block

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.