scalar type for id simplifies parsing longs.

This commit is contained in:
Bryce Covert
2018-11-12 08:26:47 -08:00
parent 2263a5f24a
commit 6eaff40608
12 changed files with 80 additions and 81 deletions

View File

@@ -27,6 +27,9 @@
(def integreat-schema
{
:scalars {:id {
:parse (schema/as-conformer #(Long/parseLong %))
:serialize (schema/as-conformer #(.toString %))}}
:objects
{
:company
@@ -37,20 +40,20 @@
:locations {:type '(list String)}
:bank_accounts {:type '(list :bank_account)}}}
:client
{:fields {:id {:type 'String}
{:fields {:id {:type :id}
:name {:type 'String}
:email {:type 'String}
:address {:type :address}
:locations {:type '(list String)}
:bank_accounts {:type '(list :bank_account)}}}
:contact
{:fields {:id {:type 'String}
{:fields {:id {:type :id}
:name {:type 'String}
:email {:type 'String}
:phone {:type 'String}}}
:bank_account
{:fields {:id {:type 'String}
{:fields {:id {:type :id }
:type {:type :bank_account_type}
:number {:type 'String}
:check_number {:type 'Int}
@@ -65,7 +68,7 @@
:state {:type 'String}
:zip {:type 'String}}}
:vendor
{:fields {:id {:type 'String}
{:fields {:id {:type :id}
:name {:type 'String}
:code {:type 'String}
@@ -89,7 +92,7 @@
:check {:fields {:id {:type 'Int}
:check {:fields {:id {:type :id}
:type {:type 'String}
:amount {:type 'String}
:vendor {:type :vendor}
@@ -103,7 +106,7 @@
:invoices {:type '(list :invoice_payment)}
}}
:payment {:fields {:id {:type 'String}
:payment {:fields {:id {:type :id}
:type {:type :payment_type}
:amount {:type 'String}
:vendor {:type :vendor}
@@ -117,7 +120,7 @@
:invoices {:type '(list :invoice_payment)}
}}
:transaction {:fields {:id {:type 'String}
:transaction {:fields {:id {:type :id}
:amount {:type 'String}
:description_original {:type 'String}
:description_simple {:type 'String}
@@ -128,7 +131,7 @@
:date {:type 'String}
:post_date {:type 'String}}}
:invoice_payment
{:fields {:id {:type 'Int}
{:fields {:id {:type :id}
:amount {:type 'String}
:invoice_id {:type 'String}
:payment_id {:type 'String}
@@ -136,19 +139,19 @@
:invoice {:type :invoice}}}
:user
{:fields {:id {:type 'String}
{:fields {:id {:type :id}
:name {:type 'String}
:role {:type 'String}
:clients {:type '(list :client)}}}
:expense_account {:fields {:id {:type 'Int}
:expense_account {:fields {:id {:type :id}
:location {:type 'String}
:name {:type 'String}
:parent {:type :expense_account
:resolve :get-expense-account-parent}}}
:invoices_expense_accounts
{:fields {:id {:type 'String}
{:fields {:id {:type :id}
:invoice_id {:type 'String}
:expense_account_id {:type 'Int}
:location {:type 'String}
@@ -158,7 +161,7 @@
:amount {:type 'String}}}
:invoice
{:fields {:id {:type 'String}
{:fields {:id {:type :id}
:total {:type 'String}
:outstanding_balance {:type 'String}
:invoice_number {:type 'String}
@@ -203,7 +206,7 @@
{:invoice_page {:type '(list :invoice_page)
:args {:imported {:type 'Boolean}
:status {:type 'String}
:client_id {:type 'String}
:client_id {:type :id}
:start {:type 'Int}
:sort_by {:type 'String}
:asc {:type 'Boolean}}
@@ -211,19 +214,19 @@
:resolve :get-invoice-page}
:all_invoices {:type '(list :invoice)
:args {:client_id {:type 'String}
:args {:client_id {:type :id}
:original_id {:type 'Int}
:statuses {:type '(list String)}}
:resolve :get-all-invoices}
:all_payments {:type '(list :payment)
:args {:client_id {:type 'String}
:args {:client_id {:type :id}
:original_id {:type 'Int}
:statuses {:type '(list String)}}
:resolve :get-all-payments}
:transaction_page {:type '(list :transaction_page)
:args {:client_id {:type 'String}
:args {:client_id {:type :id}
:start {:type 'Int}
:sort_by {:type 'String}
:asc {:type 'Boolean}}
@@ -231,7 +234,7 @@
:resolve :get-transaction-page}
:payment_page {:type '(list :payment_page)
:args {:client_id {:type 'String}
:args {:client_id {:type :id}
:start {:type 'Int}
:sort_by {:type 'String}
:asc {:type 'Boolean}}
@@ -249,17 +252,17 @@
:input-objects
{
:invoice_payment_amount {:fields {:invoice_id {:type 'String}
:invoice_payment_amount {:fields {:invoice_id {:type :id}
:amount {:type 'Float}}}
:edit_user
{:fields {:id {:type 'String}
{:fields {:id {:type :id}
:name {:type 'String}
:role {:type 'String}
:clients {:type '(list String)}}}
:add_contact
{:fields {:id {:type 'String}
{:fields {:id {:type :id}
:name {:type 'String}
:email {:type 'String}
:phone {:type 'String}}}
@@ -271,7 +274,7 @@
:zip {:type 'String}}}
:add_vendor
{:fields {:id {:type 'String}
{:fields {:id {:type :id}
:name {:type 'String}
:code {:type 'String}
@@ -284,23 +287,23 @@
:invoice_reminder_schedule {:type 'String}}}
:edit_expense_account
{:fields {:id {:type 'String}
{:fields {:id {:type :id}
:expense_account_id {:type 'Int}
:location {:type 'String}
:amount {:type 'String}}}
:add_invoice
{:fields {:id {:type 'String}
{:fields {:id {:type :id}
:invoice_number {:type 'String}
:location {:type 'String}
:date {:type 'String}
:client_id {:type 'String}
:vendor_id {:type 'String}
:client_id {:type :id}
:vendor_id {:type :id}
:vendor_name {:type 'String}
:total {:type 'Float}}}
:edit_invoice
{:fields {:id {:type 'String}
{:fields {:id {:type :id}
:invoice_number {:type 'String}
:date {:type 'String}
:total {:type 'Float}}}}
@@ -313,17 +316,17 @@
:mutations
{:print_checks {:type :check_result
:args {:invoice_payments {:type '(list :invoice_payment_amount)}
:bank_account_id {:type 'String}
:bank_account_id {:type :id}
:type {:type :payment_type}
:client_id {:type 'String}}
:client_id {:type :id}}
:resolve :mutation/print-checks}
:add_handwritten_check {:type :check_result
:args {:invoice_id {:type 'String}
:args {:invoice_id {:type :id}
:amount {:type 'Float}
:date {:type 'String}
:check_number {:type 'Int}
:bank_account_id {:type 'String}}
:bank_account_id {:type :id}}
:resolve :mutation/add-handwritten-check}
:edit_user {:type :user
:args {:edit_user {:type :edit_user}}
@@ -339,13 +342,13 @@
:args {:invoice {:type :edit_invoice}}
:resolve :mutation/edit-invoice}
:void_invoice {:type :invoice
:args {:invoice_id {:type 'String}}
:args {:invoice_id {:type :id}}
:resolve :mutation/void-invoice}
:void_payment {:type :payment
:args {:payment_id {:type 'String}}
:args {:payment_id {:type :id}}
:resolve :mutation/void-payment}
:edit_expense_accounts {:type :invoice
:args {:invoice_id {:type 'String}
:args {:invoice_id {:type :id}
:expense_accounts {:type '(list :edit_expense_account)}}
:resolve :mutation/edit-expense-accounts}}})