feat: Integrate Data Connect and Implement Staff List View Directory
This commit is contained in:
51
backend/dataconnect/example/account/mutations.gql
Normal file
51
backend/dataconnect/example/account/mutations.gql
Normal file
@@ -0,0 +1,51 @@
|
||||
mutation createAccount(
|
||||
$bank: String!
|
||||
$type: AccountType!
|
||||
$last4: String!
|
||||
$isPrimary: Boolean
|
||||
$ownerId: UUID!
|
||||
$accountNumber: String
|
||||
$routeNumber: String
|
||||
$expiryTime: Timestamp
|
||||
) @auth(level: USER) {
|
||||
account_insert(
|
||||
data: {
|
||||
bank: $bank
|
||||
type: $type
|
||||
last4: $last4
|
||||
isPrimary: $isPrimary
|
||||
ownerId: $ownerId
|
||||
accountNumber: $accountNumber
|
||||
routeNumber: $routeNumber
|
||||
expiryTime: $expiryTime
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation updateAccount(
|
||||
$id: UUID!
|
||||
$bank: String
|
||||
$type: AccountType
|
||||
$last4: String
|
||||
$isPrimary: Boolean
|
||||
$accountNumber: String
|
||||
$routeNumber: String
|
||||
$expiryTime: Timestamp
|
||||
) @auth(level: USER) {
|
||||
account_update(
|
||||
id: $id
|
||||
data: {
|
||||
bank: $bank
|
||||
type: $type
|
||||
last4: $last4
|
||||
isPrimary: $isPrimary
|
||||
accountNumber: $accountNumber
|
||||
routeNumber: $routeNumber
|
||||
expiryTime: $expiryTime
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation deleteAccount($id: UUID!) @auth(level: USER) {
|
||||
account_delete(id: $id)
|
||||
}
|
||||
70
backend/dataconnect/example/account/queries.gql
Normal file
70
backend/dataconnect/example/account/queries.gql
Normal file
@@ -0,0 +1,70 @@
|
||||
query listAccounts @auth(level: USER) {
|
||||
accounts {
|
||||
id
|
||||
bank
|
||||
type
|
||||
last4
|
||||
isPrimary
|
||||
ownerId
|
||||
accountNumber
|
||||
routeNumber
|
||||
expiryTime
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
|
||||
query getAccountById($id: UUID!) @auth(level: USER) {
|
||||
account(id: $id) {
|
||||
id
|
||||
bank
|
||||
type
|
||||
last4
|
||||
isPrimary
|
||||
ownerId
|
||||
accountNumber
|
||||
routeNumber
|
||||
expiryTime
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
|
||||
query getAccountsByOwnerId($ownerId: UUID!) @auth(level: USER) {
|
||||
accounts(where: { ownerId: { eq: $ownerId } }) {
|
||||
id
|
||||
bank
|
||||
type
|
||||
last4
|
||||
isPrimary
|
||||
ownerId
|
||||
accountNumber
|
||||
routeNumber
|
||||
expiryTime
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
|
||||
query filterAccounts(
|
||||
$bank: String
|
||||
$type: AccountType
|
||||
$isPrimary: Boolean
|
||||
$ownerId: UUID
|
||||
) @auth(level: USER) {
|
||||
accounts(
|
||||
where: {
|
||||
bank: { eq: $bank }
|
||||
type: { eq: $type }
|
||||
isPrimary: { eq: $isPrimary }
|
||||
ownerId: { eq: $ownerId }
|
||||
}
|
||||
) {
|
||||
id
|
||||
bank
|
||||
type
|
||||
last4
|
||||
isPrimary
|
||||
ownerId
|
||||
accountNumber
|
||||
expiryTime
|
||||
routeNumber
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user