vendor querying step 1.

This commit is contained in:
2022-04-10 20:28:02 -07:00
parent cbc3c00b8e
commit e897443f7d
9 changed files with 308 additions and 67 deletions

View File

@@ -85,6 +85,18 @@
(map #(trim-usage % (limited-clients (:id args))))
#_(map #(assoc % :usage (get usages (:db/id %))))))
(defn get-graphql-by-id [args id]
(->> (cond-> {:query {:find [(list 'pull '?e default-read)]
:in ['$ '?e]
:where ['[?e :vendor/name]]}
:args [(d/db (d/connect uri)) id]})
(d/query)
(map first)
(map #(cleanse (:id args) %))
(map <-datomic)
(map #(trim-usage % (limited-clients (:id args))))
first))
(defn get-by-id [id]
(->> (d/q '[:find (pull ?e [*