This commit is contained in:
Bryce
2023-05-18 22:15:37 -07:00
32 changed files with 1461 additions and 606 deletions

View File

@@ -12,6 +12,8 @@
[clj-time.coerce :as c]
[datomic.api :as dc]))
(def default-read '[:db/id :report/client :report/created :report/url :report/name :report/creator])
(defn raw-graphql-ids [db args]
(let [query (cond-> {:query {:find []
:in ['$ ]
@@ -43,8 +45,7 @@
(apply-pagination args))))
(defn graphql-results [ids db args]
(let [results (->> (pull-many db '[:db/id :report/client :report/created :report/url :report/name :report/creator]
ids)
(let [results (->> (pull-many db default-read ids)
(map #(update % :report/created c/from-date))
(group-by :db/id))]
(->> ids
@@ -58,13 +59,9 @@
(map :db/id (:report/client r))))))))
(defn get-graphql [args]
(clojure.pprint/pprint args)
(let [db (dc/db conn)
{ids-to-retrieve :ids matching-count :count} (raw-graphql-ids db args)]
[(->> (graphql-results ids-to-retrieve db args))
matching-count]))