lots of changes to make ledger actually visible.

This commit is contained in:
Bryce Covert
2019-04-11 19:41:41 -07:00
parent d335055de8
commit 9549afb3ef
15 changed files with 454 additions and 55 deletions

View File

@@ -1,17 +1,9 @@
(ns auto-ap.graphql.accounts
(:require [datomic.api :as d]
[auto-ap.graphql.utils :refer [->graphql]]
[auto-ap.datomic.accounts :as d-accounts]
[auto-ap.graphql.utils :refer [->graphql <-graphql] ]
[auto-ap.datomic :refer [uri merge-query]]))
(defn get-accounts [context args value]
(let [query (cond-> {:query {:find ['(pull ?e [* {:account/type [:db/ident :db/id]}])]
:in ['$]
:where [['?e :account/name]]}
:args [(d/db (d/connect uri))]}
(:account_set args) (merge-query {:query {:in ['?account-set]
:where [['?e :account/account-set '?account-set]]}
:args [(:account_set args)]}))]
(->>
(d/query query)
(map first)
(->graphql ))))
(->graphql (d-accounts/get-accounts (<-graphql args))))