started making graphql do the right thing.
This commit is contained in:
15
src/clj/auto_ap/datomic/clients.clj
Normal file
15
src/clj/auto_ap/datomic/clients.clj
Normal file
@@ -0,0 +1,15 @@
|
||||
(ns auto-ap.datomic.clients
|
||||
(:require [datomic.api :as d]
|
||||
[auto-ap.datomic :refer [uri]]))
|
||||
|
||||
(defn get-all []
|
||||
(->> (d/q '[:find (pull ?e [*])
|
||||
:where [?e :client/name]]
|
||||
(d/db (d/connect uri)))
|
||||
(map first)
|
||||
(map (fn [c]
|
||||
(update c :client/bank-accounts
|
||||
(fn [bas]
|
||||
(map (fn [ba]
|
||||
(update ba :bank-account/type :db/ident ))
|
||||
bas)))))))
|
||||
Reference in New Issue
Block a user