Fix https://github.com/logseq/db-test/issues/237 This commit also updates custom queries to only fetch :db/id to improve performance.
@@ -732,10 +732,7 @@ Some bindings in this fn:
(def db-block-attrs
"Block attributes for db graph queries"
- ;; '*' needed as we need to pull user properties and don't know their names in advance
- '[*
- {:block/page [:db/id :block/name :block/title :block/journal-day]}
- {:block/_parent ...}])
+ '[:db/id])
(defn query
"Runs a dsl query with query as a string. Primary use is from '/query' or '{{query }}'"
@@ -198,7 +198,8 @@
(when (or query query-fn)
(try
(let [f #(execute-query! repo-url db (vec (cons repo-url k)) cache)]
- (when-not custom?
+ (if custom?
+ (async/put! (state/get-reactive-custom-queries-chan) [f query])
(f)))
(catch :default e
(js/console.error e)