65 lines
919 B
GraphQL
65 lines
919 B
GraphQL
query listAccounts @auth(level: USER) {
|
|
accounts {
|
|
id
|
|
bank
|
|
type
|
|
last4
|
|
isPrimary
|
|
ownerId
|
|
createdAt
|
|
updatedAt
|
|
createdBy
|
|
}
|
|
}
|
|
|
|
query getAccountById($id: UUID!) @auth(level: USER) {
|
|
account(id: $id) {
|
|
id
|
|
bank
|
|
type
|
|
last4
|
|
isPrimary
|
|
ownerId
|
|
createdAt
|
|
updatedAt
|
|
createdBy
|
|
}
|
|
}
|
|
|
|
query getAccountsByOwnerId($ownerId: UUID!) @auth(level: USER) {
|
|
accounts(where: { ownerId: { eq: $ownerId } }) {
|
|
id
|
|
bank
|
|
type
|
|
last4
|
|
isPrimary
|
|
ownerId
|
|
createdAt
|
|
updatedAt
|
|
createdBy
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|