Batch historical balance queries
The LedgerAccount type now exposes balancesDuring
and balanceChangesDuring
fields for efficiently querying multiple historical balances. These can be used to display portfolio charts or generate trial balance reports.
query GetBalanceHistory(
$ledgerAccount: LedgerAccountMatchInput!
) {
ledgerAccount(ledgerAccount: $ledgerAccount) {
# Get monthly balances for a year
yearlyBalances: balancesDuring(
startTime: "2021"
duration: 12
granularity: monthly
) {
startTime
endTime
granularity
nodes {
at
amount {
currency {
code
}
amount
}
}
}
}
}
Learn more in the documentation.
Small Improvements