making queries really traceable and queryable
This commit is contained in:
2808
package-lock.json
generated
2808
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -23,8 +23,8 @@
|
|||||||
"recharts": "^1.4.2"
|
"recharts": "^1.4.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"webpack": "^5.11.0",
|
"webpack": "^5.75.0",
|
||||||
"webpack-cli": "^4.2.0"
|
"webpack-cli": "^5.0.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
[postgresql/postgresql "9.3-1102.jdbc41"]
|
[postgresql/postgresql "9.3-1102.jdbc41"]
|
||||||
[org.clojure/java.jdbc "0.7.11"]
|
[org.clojure/java.jdbc "0.7.11"]
|
||||||
[etaoin "0.4.1"]
|
[etaoin "0.4.1"]
|
||||||
[com.bhauman/figwheel-main "0.2.12" :exclusions [org.clojure/clojurescript
|
[com.bhauman/figwheel-main "0.2.18" :exclusions [org.clojure/clojurescript
|
||||||
ring
|
ring
|
||||||
ring/ring-core
|
ring/ring-core
|
||||||
ring/ring-codec
|
ring/ring-codec
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
|
|
||||||
:uberjar
|
:uberjar
|
||||||
{:prep-tasks ["fig:min" ]
|
{:prep-tasks ["fig:min" ]
|
||||||
:dependencies [[com.bhauman/figwheel-main "0.2.12" :exclusions [org.clojure/clojurescript
|
:dependencies [[com.bhauman/figwheel-main "0.2.18" :exclusions [org.clojure/clojurescript
|
||||||
ring
|
ring
|
||||||
ring/ring-core
|
ring/ring-core
|
||||||
ring/ring-codec
|
ring/ring-codec
|
||||||
|
|||||||
@@ -18,26 +18,25 @@
|
|||||||
[auto-ap.graphql.transaction-rules :as gq-transaction-rules]
|
[auto-ap.graphql.transaction-rules :as gq-transaction-rules]
|
||||||
[auto-ap.graphql.transactions :as gq-transactions]
|
[auto-ap.graphql.transactions :as gq-transactions]
|
||||||
[auto-ap.graphql.users :as gq-users]
|
[auto-ap.graphql.users :as gq-users]
|
||||||
[auto-ap.graphql.utils :refer [assert-admin]]
|
[auto-ap.graphql.utils :refer [assert-admin attach-tracing-resolvers]]
|
||||||
[auto-ap.graphql.vendors :as gq-vendors]
|
[auto-ap.graphql.vendors :as gq-vendors]
|
||||||
[auto-ap.graphql.yodlee-merchants :as ym]
|
[auto-ap.graphql.yodlee-merchants :as ym]
|
||||||
[auto-ap.graphql.yodlee2 :as gq-yodlee2]
|
[auto-ap.graphql.yodlee2 :as gq-yodlee2]
|
||||||
[auto-ap.logging :refer [error-event info-event warn-event] :as alog]
|
[auto-ap.logging :as alog :refer [error-event info-event warn-event]]
|
||||||
[auto-ap.time :as time]
|
[auto-ap.time :as time]
|
||||||
[clj-time.coerce :as coerce]
|
[clj-time.coerce :as coerce]
|
||||||
[clj-time.core :as t]
|
[clj-time.core :as t]
|
||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[clojure.tools.logging :as log]
|
[clojure.tools.logging :as log]
|
||||||
[clojure.walk :as walk]
|
[clojure.walk :as walk]
|
||||||
|
[com.brunobonacci.mulog :as mu]
|
||||||
[com.unbounce.dogstatsd.core :as statsd]
|
[com.unbounce.dogstatsd.core :as statsd]
|
||||||
[com.walmartlabs.lacinia :refer [execute]]
|
[com.walmartlabs.lacinia :refer [execute]]
|
||||||
[com.walmartlabs.lacinia.parser :as p]
|
[com.walmartlabs.lacinia.parser :as p]
|
||||||
[com.walmartlabs.lacinia.schema :as schema]
|
[com.walmartlabs.lacinia.schema :as schema]
|
||||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
|
||||||
[datomic.api :as d]
|
[datomic.api :as d]
|
||||||
[unilog.context :as lc]
|
[unilog.context :as lc]
|
||||||
[yang.time :refer [time-it]]
|
[yang.time :refer [time-it]])
|
||||||
[com.brunobonacci.mulog :as mu])
|
|
||||||
(:import
|
(:import
|
||||||
(clojure.lang IPersistentMap)))
|
(clojure.lang IPersistentMap)))
|
||||||
|
|
||||||
@@ -762,31 +761,32 @@
|
|||||||
|
|
||||||
(def schema
|
(def schema
|
||||||
(-> integreat-schema
|
(-> integreat-schema
|
||||||
(attach-resolvers {
|
(attach-tracing-resolvers
|
||||||
:get-yodlee-provider-account-page gq-yodlee2/get-yodlee-provider-account-page
|
{
|
||||||
:get-accounts gq-accounts/get-graphql
|
:get-yodlee-provider-account-page gq-yodlee2/get-yodlee-provider-account-page
|
||||||
:get-all-accounts gq-accounts/get-all-graphql
|
:get-accounts gq-accounts/get-graphql
|
||||||
:get-transaction-rule-page gq-transaction-rules/get-transaction-rule-page
|
:get-all-accounts gq-accounts/get-all-graphql
|
||||||
:get-transaction-rule-matches gq-transaction-rules/get-transaction-rule-matches
|
:get-transaction-rule-page gq-transaction-rules/get-transaction-rule-page
|
||||||
:get-expense-account-stats get-expense-account-stats
|
:get-transaction-rule-matches gq-transaction-rules/get-transaction-rule-matches
|
||||||
:get-invoice-stats get-invoice-stats
|
:get-expense-account-stats get-expense-account-stats
|
||||||
:get-cash-flow get-cash-flow
|
:get-invoice-stats get-invoice-stats
|
||||||
:get-yodlee-merchants ym/get-yodlee-merchants
|
:get-cash-flow get-cash-flow
|
||||||
:get-intuit-bank-accounts gq-intuit-bank-accounts/get-intuit-bank-accounts
|
:get-yodlee-merchants ym/get-yodlee-merchants
|
||||||
:vendor-by-id gq-vendors/get-by-id
|
:get-intuit-bank-accounts gq-intuit-bank-accounts/get-intuit-bank-accounts
|
||||||
:account-for-vendor gq-accounts/default-for-vendor
|
:vendor-by-id gq-vendors/get-by-id
|
||||||
:get-user get-user
|
:account-for-vendor gq-accounts/default-for-vendor
|
||||||
:mutation/delete-transaction-rule gq-transaction-rules/delete-transaction-rule
|
:get-user get-user
|
||||||
:mutation/edit-user gq-users/edit-user
|
:mutation/delete-transaction-rule gq-transaction-rules/delete-transaction-rule
|
||||||
:mutation/upsert-transaction-rule gq-transaction-rules/upsert-transaction-rule
|
:mutation/edit-user gq-users/edit-user
|
||||||
:test-transaction-rule gq-transaction-rules/test-transaction-rule
|
:mutation/upsert-transaction-rule gq-transaction-rules/upsert-transaction-rule
|
||||||
:run-transaction-rule gq-transaction-rules/run-transaction-rule
|
:test-transaction-rule gq-transaction-rules/test-transaction-rule
|
||||||
:mutation/upsert-vendor gq-vendors/upsert-vendor
|
:run-transaction-rule gq-transaction-rules/run-transaction-rule
|
||||||
:mutation/upsert-account gq-accounts/upsert-account
|
:mutation/upsert-vendor gq-vendors/upsert-vendor
|
||||||
:mutation/merge-vendors gq-vendors/merge-vendors
|
:mutation/upsert-account gq-accounts/upsert-account
|
||||||
:get-vendor gq-vendors/get-graphql
|
:mutation/merge-vendors gq-vendors/merge-vendors
|
||||||
:search-vendor gq-vendors/search
|
:get-vendor gq-vendors/get-graphql
|
||||||
:search-account gq-accounts/search})
|
:search-vendor gq-vendors/search
|
||||||
|
:search-account gq-accounts/search})
|
||||||
gq-checks/attach
|
gq-checks/attach
|
||||||
gq-ledger/attach
|
gq-ledger/attach
|
||||||
gq-reports/attach
|
gq-reports/attach
|
||||||
@@ -835,7 +835,7 @@
|
|||||||
([id q v]
|
([id q v]
|
||||||
(statsd/increment "query.graphql.count" {:tags #{(str "query:" (query-name q))}})
|
(statsd/increment "query.graphql.count" {:tags #{(str "query:" (query-name q))}})
|
||||||
(statsd/time! [(str "query.graphql.time" ) {:tags #{(str "query:" (query-name q))}}]
|
(statsd/time! [(str "query.graphql.time" ) {:tags #{(str "query:" (query-name q))}}]
|
||||||
(mu/with-context {:query q}
|
(mu/with-context {:query q :user id}
|
||||||
(mu/trace
|
(mu/trace
|
||||||
::user-query
|
::user-query
|
||||||
[]
|
[]
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
[auto-ap.graphql.utils
|
[auto-ap.graphql.utils
|
||||||
:refer [->graphql
|
:refer [->graphql
|
||||||
<-graphql
|
<-graphql
|
||||||
|
attach-tracing-resolvers
|
||||||
assert-admin
|
assert-admin
|
||||||
assert-can-see-client
|
assert-can-see-client
|
||||||
assert-failure
|
assert-failure
|
||||||
@@ -767,4 +768,4 @@
|
|||||||
:mutations mutations
|
:mutations mutations
|
||||||
:input-objects input-objects
|
:input-objects input-objects
|
||||||
:enums enums})
|
:enums enums})
|
||||||
(attach-resolvers resolvers)))
|
(attach-tracing-resolvers resolvers)))
|
||||||
|
|||||||
@@ -14,7 +14,8 @@
|
|||||||
[clojure.tools.logging :as log]
|
[clojure.tools.logging :as log]
|
||||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
||||||
[datomic.api :as d]
|
[datomic.api :as d]
|
||||||
[unilog.context :as lc])
|
[unilog.context :as lc]
|
||||||
|
[auto-ap.graphql.utils :refer [attach-tracing-resolvers]])
|
||||||
(:import
|
(:import
|
||||||
(java.util UUID)
|
(java.util UUID)
|
||||||
(org.apache.commons.codec.binary Base64)))
|
(org.apache.commons.codec.binary Base64)))
|
||||||
@@ -618,4 +619,4 @@
|
|||||||
:mutations mutations
|
:mutations mutations
|
||||||
:input-objects input-objects
|
:input-objects input-objects
|
||||||
:enums enums})
|
:enums enums})
|
||||||
(attach-resolvers resolvers)))
|
(attach-tracing-resolvers resolvers)))
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
[auto-ap.datomic.expected-deposit :as d-expected-deposit]
|
[auto-ap.datomic.expected-deposit :as d-expected-deposit]
|
||||||
[auto-ap.graphql.utils
|
[auto-ap.graphql.utils
|
||||||
:refer [->graphql <-graphql assert-admin ident->enum-f result->page]]
|
:refer [->graphql <-graphql assert-admin ident->enum-f result->page]]
|
||||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]))
|
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
||||||
|
[auto-ap.graphql.utils :refer [attach-tracing-resolvers]]))
|
||||||
|
|
||||||
(def status->graphql (ident->enum-f :expected-deposit/status))
|
(def status->graphql (ident->enum-f :expected-deposit/status))
|
||||||
|
|
||||||
@@ -72,4 +73,4 @@
|
|||||||
{:objects objects
|
{:objects objects
|
||||||
:queries queries
|
:queries queries
|
||||||
:enums enums})
|
:enums enums})
|
||||||
(attach-resolvers resolvers)))
|
(attach-tracing-resolvers resolvers)))
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
[auto-ap.graphql.utils :refer [assert-admin cleanse-query]]
|
[auto-ap.graphql.utils :refer [assert-admin cleanse-query]]
|
||||||
[auto-ap.graphql.vendors :refer [partial-match-first]]
|
[auto-ap.graphql.vendors :refer [partial-match-first]]
|
||||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
||||||
[datomic.api :as d]))
|
[datomic.api :as d]
|
||||||
|
[auto-ap.graphql.utils :refer [attach-tracing-resolvers]]))
|
||||||
|
|
||||||
(defn search [context args _]
|
(defn search [context args _]
|
||||||
(assert-admin (:id context))
|
(assert-admin (:id context))
|
||||||
@@ -43,4 +44,4 @@
|
|||||||
{:objects objects
|
{:objects objects
|
||||||
:queries queries
|
:queries queries
|
||||||
:enums enums})
|
:enums enums})
|
||||||
(attach-resolvers resolvers)))
|
(attach-tracing-resolvers resolvers)))
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
(ns auto-ap.graphql.import-batch
|
(ns auto-ap.graphql.import-batch
|
||||||
(:require
|
(:require
|
||||||
[auto-ap.datomic
|
[auto-ap.datomic
|
||||||
:refer
|
:refer
|
||||||
[add-sorter-fields apply-pagination apply-sort-3 conn merge-query]]
|
[add-sorter-fields apply-pagination apply-sort-3 conn merge-query]]
|
||||||
[auto-ap.graphql.utils
|
[auto-ap.graphql.utils
|
||||||
:refer
|
:refer
|
||||||
[<-graphql assert-admin ident->enum-f result->page]]
|
[<-graphql assert-admin ident->enum-f result->page]]
|
||||||
[clj-time.coerce :as coerce]
|
[clj-time.coerce :as coerce]
|
||||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
||||||
[datomic.api :as d]))
|
[datomic.api :as d]
|
||||||
|
[auto-ap.graphql.utils :refer [attach-tracing-resolvers]]))
|
||||||
|
|
||||||
(def default-read '[:db/id
|
(def default-read '[:db/id
|
||||||
:import-batch/external-id
|
:import-batch/external-id
|
||||||
@@ -97,4 +98,4 @@
|
|||||||
{:enum-value :yodlee2}
|
{:enum-value :yodlee2}
|
||||||
{:enum-value :plaid}
|
{:enum-value :plaid}
|
||||||
{:enum-value :manual}]}}})
|
{:enum-value :manual}]}}})
|
||||||
(attach-resolvers {:get-import-batch-page get-import-batch-page})))
|
(attach-tracing-resolvers {:get-import-batch-page get-import-batch-page})))
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
(ns auto-ap.graphql.invoices
|
(ns auto-ap.graphql.invoices
|
||||||
(:require
|
(:require
|
||||||
[auto-ap.datomic
|
[auto-ap.datomic :refer [conn remove-nils uri]]
|
||||||
:refer [conn remove-nils uri]]
|
|
||||||
[auto-ap.ledger :refer [transact-with-ledger transact-batch-with-ledger]]
|
|
||||||
[auto-ap.datomic.clients :as d-clients]
|
[auto-ap.datomic.clients :as d-clients]
|
||||||
[auto-ap.datomic.invoices :as d-invoices]
|
[auto-ap.datomic.invoices :as d-invoices]
|
||||||
[auto-ap.datomic.vendors :as d-vendors]
|
[auto-ap.datomic.vendors :as d-vendors]
|
||||||
[auto-ap.rule-matching :as rm]
|
|
||||||
[auto-ap.graphql.checks :as gq-checks]
|
[auto-ap.graphql.checks :as gq-checks]
|
||||||
[auto-ap.graphql.utils
|
[auto-ap.graphql.utils
|
||||||
:as u
|
:as u
|
||||||
:refer [<-graphql
|
:refer [<-graphql
|
||||||
assert-admin
|
assert-admin
|
||||||
assert-not-locked
|
|
||||||
assert-can-see-client
|
assert-can-see-client
|
||||||
assert-power-user
|
|
||||||
assert-failure
|
assert-failure
|
||||||
|
assert-not-locked
|
||||||
|
assert-power-user
|
||||||
|
attach-tracing-resolvers
|
||||||
enum->keyword]]
|
enum->keyword]]
|
||||||
|
[auto-ap.ledger
|
||||||
|
:refer [transact-batch-with-ledger transact-with-ledger]]
|
||||||
|
[auto-ap.rule-matching :as rm]
|
||||||
[auto-ap.utils :refer [dollars=]]
|
[auto-ap.utils :refer [dollars=]]
|
||||||
[clj-time.coerce :as coerce]
|
[clj-time.coerce :as coerce]
|
||||||
[clj-time.core :as time]
|
[clj-time.core :as time]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[clojure.tools.logging :as log]
|
[clojure.tools.logging :as log]
|
||||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
|
||||||
[datomic.api :as d]))
|
[datomic.api :as d]))
|
||||||
|
|
||||||
(defn ->graphql [invoice user ]
|
(defn ->graphql [invoice user ]
|
||||||
@@ -609,4 +609,4 @@
|
|||||||
:mutations mutations
|
:mutations mutations
|
||||||
:input-objects input-objects
|
:input-objects input-objects
|
||||||
:enums enums})
|
:enums enums})
|
||||||
(attach-resolvers resolvers)))
|
(attach-tracing-resolvers resolvers)))
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
[config.core :refer [env]]
|
[config.core :refer [env]]
|
||||||
[clojure.tools.logging :as log]
|
[clojure.tools.logging :as log]
|
||||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
||||||
[clojure.edn :as edn])
|
[clojure.edn :as edn]
|
||||||
|
[auto-ap.graphql.utils :refer [attach-tracing-resolvers]])
|
||||||
(:import
|
(:import
|
||||||
(com.amazonaws.services.ecs.model AssignPublicIp)))
|
(com.amazonaws.services.ecs.model AssignPublicIp)))
|
||||||
|
|
||||||
@@ -156,5 +157,5 @@
|
|||||||
:queries queries
|
:queries queries
|
||||||
:enums enums
|
:enums enums
|
||||||
:mutations mutations})
|
:mutations mutations})
|
||||||
(attach-resolvers resolvers)))
|
(attach-tracing-resolvers resolvers)))
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,8 @@
|
|||||||
[datomic.api :as d]
|
[datomic.api :as d]
|
||||||
[mount.core :as mount]
|
[mount.core :as mount]
|
||||||
[unilog.context :as lc]
|
[unilog.context :as lc]
|
||||||
[yang.scheduler :as scheduler])
|
[yang.scheduler :as scheduler]
|
||||||
|
[auto-ap.graphql.utils :refer [attach-tracing-resolvers]])
|
||||||
(:import [org.apache.commons.codec.binary Base64]))
|
(:import [org.apache.commons.codec.binary Base64]))
|
||||||
|
|
||||||
(mount/defstate running-balance-cache
|
(mount/defstate running-balance-cache
|
||||||
@@ -874,4 +875,4 @@
|
|||||||
:mutations mutations
|
:mutations mutations
|
||||||
:input-objects input-objects
|
:input-objects input-objects
|
||||||
:enums enums})
|
:enums enums})
|
||||||
(attach-resolvers resolvers)))
|
(attach-tracing-resolvers resolvers)))
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
assert-admin
|
assert-admin
|
||||||
assert-can-see-client
|
assert-can-see-client
|
||||||
assert-present
|
assert-present
|
||||||
|
attach-tracing-resolvers
|
||||||
limited-clients]]
|
limited-clients]]
|
||||||
[auto-ap.plaid.core :as p]
|
[auto-ap.plaid.core :as p]
|
||||||
[clj-time.coerce :as coerce]
|
[clj-time.coerce :as coerce]
|
||||||
[clj-time.core :as time]
|
[clj-time.core :as time]
|
||||||
[clojure.tools.logging :as log]
|
[clojure.tools.logging :as log]
|
||||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
|
||||||
[datomic.api :as d]))
|
[datomic.api :as d]))
|
||||||
|
|
||||||
(defn plaid-link-token [context value _]
|
(defn plaid-link-token [context value _]
|
||||||
@@ -166,8 +166,8 @@
|
|||||||
:delete_plaid_item {:type :message
|
:delete_plaid_item {:type :message
|
||||||
:args {:id {:type :id}}
|
:args {:id {:type :id}}
|
||||||
:resolve :mutation/delete-plaid-item}}})
|
:resolve :mutation/delete-plaid-item}}})
|
||||||
(attach-resolvers {:plaid-link-token plaid-link-token
|
(attach-tracing-resolvers {:plaid-link-token plaid-link-token
|
||||||
:get-plaid-item-page get-plaid-item-page
|
:get-plaid-item-page get-plaid-item-page
|
||||||
:mutation/link-plaid link-plaid
|
:mutation/link-plaid link-plaid
|
||||||
:mutation/delete-plaid-item delete-plaid-item})))
|
:mutation/delete-plaid-item delete-plaid-item})))
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
[amazonica.aws.s3 :as s3]
|
[amazonica.aws.s3 :as s3]
|
||||||
[auto-ap.datomic :refer [conn]]
|
[auto-ap.datomic :refer [conn]]
|
||||||
[auto-ap.datomic.reports :as r]
|
[auto-ap.datomic.reports :as r]
|
||||||
[auto-ap.graphql.utils :refer [<-graphql assert-admin result->page]]
|
[auto-ap.graphql.utils
|
||||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
:refer [<-graphql assert-admin attach-tracing-resolvers result->page]]
|
||||||
[config.core :refer [env]]
|
[config.core :refer [env]]
|
||||||
[datomic.api :as d]))
|
[datomic.api :as d]))
|
||||||
|
|
||||||
@@ -79,4 +79,4 @@
|
|||||||
:mutations mutations
|
:mutations mutations
|
||||||
:input-objects input-objects
|
:input-objects input-objects
|
||||||
:enums enums})
|
:enums enums})
|
||||||
(attach-resolvers resolvers)))
|
(attach-tracing-resolvers resolvers)))
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
(ns auto-ap.graphql.sales-orders
|
(ns auto-ap.graphql.sales-orders
|
||||||
(:require [auto-ap.datomic.sales-orders :as d-sales-orders2]
|
(:require [auto-ap.datomic.sales-orders :as d-sales-orders2]
|
||||||
[auto-ap.graphql.utils :refer [->graphql <-graphql result->page assert-admin] ]
|
[auto-ap.graphql.utils :refer [->graphql <-graphql result->page assert-admin] ]
|
||||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]))
|
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
||||||
|
[auto-ap.graphql.utils :refer [attach-tracing-resolvers]]))
|
||||||
|
|
||||||
(defn get-sales-orders-page [context args _]
|
(defn get-sales-orders-page [context args _]
|
||||||
(let [args (assoc args :id (:id context))
|
(let [args (assoc args :id (:id context))
|
||||||
@@ -102,4 +103,4 @@
|
|||||||
:mutations mutations
|
:mutations mutations
|
||||||
:input-objects input-objects
|
:input-objects input-objects
|
||||||
:enums enums})
|
:enums enums})
|
||||||
(attach-resolvers resolvers)))
|
(attach-tracing-resolvers resolvers)))
|
||||||
|
|||||||
@@ -27,7 +27,8 @@
|
|||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[clojure.tools.logging :as log]
|
[clojure.tools.logging :as log]
|
||||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
||||||
[datomic.api :as d]))
|
[datomic.api :as d]
|
||||||
|
[auto-ap.graphql.utils :refer [attach-tracing-resolvers]]))
|
||||||
|
|
||||||
(def approval-status->graphql (ident->enum-f :transaction/approval-status))
|
(def approval-status->graphql (ident->enum-f :transaction/approval-status))
|
||||||
|
|
||||||
@@ -705,4 +706,4 @@
|
|||||||
:mutations mutations
|
:mutations mutations
|
||||||
:input-objects input-objects
|
:input-objects input-objects
|
||||||
:enums enums})
|
:enums enums})
|
||||||
(attach-resolvers resolvers)))
|
(attach-tracing-resolvers resolvers)))
|
||||||
|
|||||||
@@ -6,7 +6,9 @@
|
|||||||
[buddy.auth :refer [throw-unauthorized]]
|
[buddy.auth :refer [throw-unauthorized]]
|
||||||
[datomic.api :as d]
|
[datomic.api :as d]
|
||||||
[clojure.walk :as walk]
|
[clojure.walk :as walk]
|
||||||
[clojure.tools.logging :as log]))
|
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
||||||
|
[clojure.tools.logging :as log]
|
||||||
|
[com.brunobonacci.mulog :as mu]))
|
||||||
|
|
||||||
|
|
||||||
(defn snake->kebab [s]
|
(defn snake->kebab [s]
|
||||||
@@ -140,3 +142,24 @@
|
|||||||
(conj e partial)
|
(conj e partial)
|
||||||
(str/join " " e))]
|
(str/join " " e))]
|
||||||
(not-empty query))))
|
(not-empty query))))
|
||||||
|
|
||||||
|
(defn trace-query [key f]
|
||||||
|
(fn trace [a b c]
|
||||||
|
(mu/with-context {:query key
|
||||||
|
:mutation (boolean (= "mutation"
|
||||||
|
(namespace key)))}
|
||||||
|
(mu/trace (keyword "graphql" (name key))
|
||||||
|
[]
|
||||||
|
(f a b c)))))
|
||||||
|
|
||||||
|
(defn attach-tracing-resolvers [schema m]
|
||||||
|
(attach-resolvers schema
|
||||||
|
(reduce
|
||||||
|
(fn [resolvers [resolver-key resolver-fn]]
|
||||||
|
(assoc resolvers
|
||||||
|
resolver-key (trace-query resolver-key resolver-fn))
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
m))
|
||||||
|
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user