-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgraphql-schema.edn
93 lines (93 loc) · 4.85 KB
/
graphql-schema.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{:enums
{:dtype
{:description "whether the money was added or removed"
:values [:DEBIT :CREDIT]}}
:objects
{:Transaction
{:description "The result of money successfully being transferred"
:fields {
:id {:type (non-null Int)}
:iban {:type String :description "The iban of the account that was changed."}
:new_balance {:type String :description "The amount in euros after the transaction."}
:changed_by {:type String :description "The amount in euros of the change, a negative number means debit, positive is credit."}
:from_to {:type String :description "The iban or name of the counter party."}
:descr {:type String :description "The description of why the money was transferred."}
:direction {:type :dtype :description "Whether it's a DEBIT or CREDIT change."}
}}
:AccountResult
{:description "The information needed to make transactions"
:fields {
:iban {:type String :description "The iban of the account."}
:token {:type String :description "The token needed to access the account."}
:reason {:type String :description "In case of error this will be filled."}
}}
:MoneyTransferResult
{:description "The feedback from a money transfer request"
:fields {
:uuid {:type String :description "Uuid used for the request"}
:success {:type Boolean :description "Whether the transfer succeeded"}
:reason {:type String :description "The reason the transfer failed."}
}}}
:queries
{
:transaction_by_id
{:type :Transaction
:description "Select a transaction by its unique id, if it exists."
:args {:id {:type (non-null Int)}}
:resolve :query/transaction-by-id}
:transactions_by_iban
{:type (list Transaction)
:description "Get all the transactions of a iban."
:args {:iban {:type (non-null String)}
:max_items {:type (non-null Int)}}
:resolve :query/transactions-by-iban}
:all_last_transactions
{:type (list Transaction)
:description "Get last transaction of all active iban."
:resolve :query/all-last-transactions}
}
:mutations
{
:get_account
{:type :AccountResult
:description "Get the result of account creation, account may be just created or already exist"
:args {:username {:type (non-null String)
:description "The username used to log in some other time"}
:password {:type (non-null String)
:description "Password needed to log in some other time"}}
:resolve :mutation/get-account}
:money_transfer
{:type :MoneyTransferResult
:description "Try to make a money transfer"
:args {:uuid {:type (non-null String)
:description "This will be used to prevent duplication, and to allow to retrieve the status later on"}
:username {:type (non-null String)
:description "The username linked to the account"}
:token {:type (non-null String)
:description "The token needed to authenticate the transaction"}
:amount {:type (non-null Int)
:description "The amount in euro cents to transfer"}
:from {:type (non-null String)
:description "The iban of the account the money is debited"}
:to {:type (non-null String)
:description "The iban of the account the money is credited"}
:descr {:type (non-null String)
:description "The description of the money transfer"}}
:resolve :mutation/money-transfer}
}
:subscriptions
{
:stream_transactions
{:type :Transaction
:description "Get transactions as they happen, with optional filtering"
:args {:iban {:type String
:description "optional filter on matching iban"}
:min_amount {:type Int
:description "optional filter based on transferred amount"}
:max_amount {:type Int
:description "optional filter based on transferred amount"}
:direction {:type :dtype
:description "optional filter on DEBIT or CREDIT"}
:descr_includes {:type String
:description "optional filter on containing in description"}}
:stream :stream-transactions}}}