This commit is contained in:
Bryce Covert
2018-10-11 22:11:52 -07:00
28 changed files with 194 additions and 195 deletions

View File

@@ -11,6 +11,21 @@
(update-in [:query :where] conj where))]
(reduce #(update-in %1 [:query :where] conj %2) query rest)))
(defn get-by-id [id]
(let [query (-> {:query {:find ['(pull ?e [*
{:user/clients [*]}
{:user/role [:db/ident]}])]
:in ['$]
:where []}
:args [(d/db (d/connect uri))]}
(add-arg '?e (cond-> id (string? id) Long/parseLong) ['?e])
(doto println))]
(->> (d/query query)
(map first)
(map #(update % :user/role :db/ident))
first)))
(defn raw-graphql [args]
(let [query (cond-> {:query {:find ['(pull ?e [*
{:user/clients [*]}