import batch next

This commit is contained in:
Bryce Covert
2021-12-22 21:47:37 -08:00
parent 7489426ccb
commit 58fd014082
6 changed files with 75 additions and 55 deletions

View File

@@ -1,11 +1,12 @@
(ns auto-ap.graphql.import-batch
(:require
[clojure.tools.logging :as log]
[datomic.api :as d]
[auto-ap.datomic
:refer [add-sorter-fields apply-pagination apply-sort-3 merge-query conn]]
[auto-ap.graphql.utils :refer [<-graphql assert-admin ident->enum-f result->page]]))
(:require [auto-ap.datomic
:refer
[add-sorter-fields apply-pagination apply-sort-3 conn merge-query]]
[auto-ap.graphql.utils
:refer
[<-graphql assert-admin ident->enum-f result->page]]
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
[datomic.api :as d]))
(def default-read '[:db/id
:import-batch/external-id
@@ -60,4 +61,38 @@
matching-count :data args)))
(defn attach [schema]
(->
(merge-with merge schema
{:objects {:import_batch {:fields {:user_name {:type 'String}
:id {:type :id}
:date {:type :iso_date_time}
:imported {:type 'Int}
:extant {:type 'Int}
:suppressed {:type 'Int}
:status {:type :import_batch_status}
:source {:type :import_batch_source}}}
:import_batch_page {:fields {:data {:type '(list :import_batch)}
:count {:type 'Int}
:total {:type 'Int}
:start {:type 'Int}
:end {:type 'Int}}}
}
:queries {:import_batch_page {:type :import_batch_page
:args {:filters {:type :import_batch_filters}}
:resolve :get-import-batch-page}}
:mutations {}
:input-objects {:import_batch_filters {:fields {:start {:type 'Int}
:per_page {:type 'Int}
:sort {:type '(list :sort_item)}}}}
:enums {:import_batch_status {:values [{:enum-value :started}
{:enum-value :completed}]}
:import_batch_source {:values [{:enum-value :intuit}
{:enum-value :yodlee}
{:enum-value :yodlee2}
{:enum-value :plaid}
{:enum-value :manual}]}}})
(attach-resolvers {:get-import-batch-page get-import-batch-page})))