(ns auto-ap.graphql.intuit-bank-accounts
  (:require
   [auto-ap.datomic :refer [conn]]
   [auto-ap.graphql.utils :refer [->graphql assert-admin]]
   [datomic.api :as dc]))

(defn get-intuit-bank-accounts [context _ _]
  (assert-admin (:id context))
  (->graphql (map first (dc/q '[:find (pull ?e [*])
                               :in $
                               :where [?e :intuit-bank-account/external-id]]
                             (dc/db conn)))))
