Added test for client graphql
This commit is contained in:
@@ -96,7 +96,6 @@
|
||||
(first))))
|
||||
|
||||
(defn raw-graphql-ids [db args]
|
||||
(println args)
|
||||
(let [query (cond-> {:query {:find []
|
||||
:in ['$]
|
||||
:where []}
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
||||
[datomic.api :as d]
|
||||
[unilog.context :as lc]
|
||||
[auto-ap.graphql.utils :refer [attach-tracing-resolvers]])
|
||||
[auto-ap.graphql.utils :refer [attach-tracing-resolvers]]
|
||||
[com.brunobonacci.mulog :as mu])
|
||||
(:import
|
||||
(java.util UUID)
|
||||
(org.apache.commons.codec.binary Base64)))
|
||||
|
||||
@@ -21,10 +21,53 @@
|
||||
[mount.core :as mount]
|
||||
[nrepl.middleware.print]
|
||||
[unilog.context :as lc]
|
||||
[com.brunobonacci.mulog :as mu])
|
||||
[com.brunobonacci.mulog :as mu]
|
||||
[com.brunobonacci.mulog.buffer :as rb])
|
||||
(:import
|
||||
(org.apache.commons.io.input BOMInputStream)))
|
||||
|
||||
(defn println-event [item]
|
||||
(printf "%s - %s: %s\n" (:mulog/namespace item) (:mulog/event-name item)
|
||||
(pr-str (reduce
|
||||
(fn [acc [k v]]
|
||||
(if (= "mulog" (namespace k))
|
||||
acc
|
||||
(assoc acc k v)))
|
||||
{}
|
||||
item))))
|
||||
|
||||
|
||||
(deftype DevPublisher [config buffer transform]
|
||||
|
||||
com.brunobonacci.mulog.publisher.PPublisher
|
||||
(agent-buffer [_]
|
||||
buffer)
|
||||
|
||||
|
||||
(publish-delay [_]
|
||||
200)
|
||||
|
||||
|
||||
(publish [_ buffer]
|
||||
;; items are pairs [offset <item>]
|
||||
(doseq [item (transform (map second (rb/items buffer)))]
|
||||
(println-event item)
|
||||
)
|
||||
(flush)
|
||||
(rb/clear buffer)))
|
||||
|
||||
|
||||
|
||||
(defn dev-publisher
|
||||
[{:keys [transform pretty?] :as config}]
|
||||
(DevPublisher. config (rb/agent-buffer 10000) (or transform identity)))
|
||||
|
||||
(defmethod com.brunobonacci.mulog.publisher/publisher-factory :dev
|
||||
[config]
|
||||
(dev-publisher config))
|
||||
|
||||
|
||||
|
||||
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
|
||||
(defn mark-until-date [client end]
|
||||
(let [conn (d/connect uri)]
|
||||
@@ -398,7 +441,7 @@
|
||||
|
||||
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
|
||||
(defn start-db []
|
||||
(mu/start-publisher! {:type :console-json})
|
||||
(mu/start-publisher! {:type :dev})
|
||||
(mount.core/start (mount.core/only #{#'auto-ap.datomic/conn})))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user