Fork me on GitHub

Did someone experiment with pantom3 and datahike? I have seen a datomic pantom3 library. What I realized after building my firat datahike app is that there are many situations where that might make sense. An area where I sort of struggle with the datahike api are situations when I add calculated properties to queries. I didn't find a good way to code that. Also I believe pantom3 comes in handy when coding resolvers. And of course it would be huge if we could query graphql apis and datahike from the same queries.

Björn Ebbinghaus14:02:25

I use pathom2 with datahike and will migrate to pathom3 as soon as I have time for it. The datomic-pathom libraries are a neat experiment, but there are many drawbacks… Mostly around access control. Back to your initial problem: What exactly are your problems with calculated properties? Here is an example of function calls in a datahike query used for searching users by substring:

(defn search-for-user [db search-term]
  (d/q '[:find [(pull ?e [::user/id ::user/display-name]) ...]
         :in $ ?search-term
         [?e ::user/display-name ?dn]
         [(clojure.string/lower-case ?dn) ?lc-dn]
         [(clojure.string/lower-case ?search-term) ?lc-?search-term]
         [(clojure.string/includes? ?lc-dn ?lc-?search-term)]]
    db (str search-term))) 

; and because you asked for pathom: here the resolver where the function above is used.
(defresolver autocomplete-user [{:keys [db] :as env} _]
  {::pc/params [:term :limit]
   ::pc/output [{:autocomplete/users [::user/id ::user/display-name]}]}
  (let [{:keys [term limit] :or {limit 3}} (-> env :ast :params)
        limit (min limit 5)]
      (take limit (search-for-user db term))}))

Björn Ebbinghaus14:02:12

Looking at the code right now... I should query the entity ids first, then limit them, then pull the data...

Björn Ebbinghaus14:02:34

@UCSJVFV35 Another thing about calculated properties… Have you looked at They are a great way to have reusable logic in your queries.


Thanks for the rules pointer. A great idea !


I did develop webly, and it can deal with oauth2 tokens, and it has a authentication and authorization layer.


The app I developed I use with datahike.


And of course full access control.