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) 
}
