> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fluz.app/llms.txt
> Use this file to discover all available pages before exploring further.

# 分頁

> 偏移分頁、頁面大小上限，以及 connection 回應結構。

整個 API 的清單操作使用偏移量輸入進行分頁，並回傳 connection 風格的物件。根據介面不同，存在兩種頁面大小規則。

## 請求結構

在操作的 `paginate` 參數傳入偏移量輸入：

| Input                                                               | Used by                                           | `limit` max      | Fields            |
| ------------------------------------------------------------------- | ------------------------------------------------- | ---------------- | ----------------- |
| [`OffsetInput`](/api-reference/types/offset-input)                  | 標準清單（`getTransactions`, `getUserCashBalances`, …） | **20**           | `limit`, `offset` |
| [`BulkPaginationInput`](/api-reference/types/bulk-pagination-input) | 批次 API 清單                                         | **100**（同時也是預設值） | `limit`, `offset` |

```graphql theme={null}
query {
  getTransactions(
    filter: { }
    paginate: { limit: 20, offset: 0 }
  ) {
    transactions { transactionId amount createdAt }
    totalCount
    hasNextPage
  }
}
```

## 回應結構

分頁查詢會回傳一個包含項目與分頁中繼資料的 connection 物件——例如 [`TransactionConnection`](/api-reference/types/transaction-connection)：

* 項目列表（例如 `transactions`）
* `totalCount` — 符合篩選條件的項目總數
* `hasNextPage` — 是否還有更多結果可用

其他 connection 類型遵循相同模式：[`UserCashBalanceConnection`](/api-reference/types/user-cash-balance-connection)、[`DeclinedTransactionConnection`](/api-reference/types/declined-transaction-connection)、以及 [`PlaidBankTransactionPage`](/api-reference/types/plaid-bank-transaction-page)。

## 走訪完整結果集

當 `hasNextPage` 為 `true` 時，每次將 `offset` 增加 `limit`：

1. 請求 `{ limit: 20, offset: 0 }`。
2. 若 `hasNextPage` 為 `true`，則請求 `{ limit: 20, offset: 20 }`，接著是 `40`，以此類推。
3. 當 `hasNextPage` 為 `false` 時停止。

<Note>
  如果在分頁過程中建立了新紀錄，結果可能會在頁面之間移動——交易清單以最新在前排序。針對大型匯出，請以固定的日期範圍進行篩選，以確保在走訪期間基礎集合保持穩定。
</Note>
