---
keyword: [Extend, Workday Graph API, Graph API, GraphQL]
nav: wcp_docs
parent_url: /wcp_docs/
title: Pagination of Graph API Query Results
layout: subsection
---

When you first execute a Graph API query, it runs and builds a cache that contains the query results. After the query executes, it returns a data collection containing rows from the cache. The `limit` and `offset` query arguments determine the response page size and the starting row.

<table><thead><tr><th>Query argument</th><th>Description</th></tr></thead><tbody><tr><td><code>limit</code></td><td>The number of rows in the response. The default is 20, and maximum is 100.</td></tr><tr><td><code>offset</code></td><td>The starting position of the row in the query results. The default is 0, which is the first row in the query results.</td></tr></tbody></table><br/>

<b>Note:</b> If a nested multi-instance field provides the `limit` and `offset` parameters, the same default values apply.

In the initial request that returns the first page, the `offset` value must be 0 (the default value).

To get the next page of query results, submit the same query with the `limit` and `offset` arguments. Set the `limit` value to the same page size, and increment the `offset` value by the page size. The query returns the next set of rows from the cache.

<b>Note:</b> During subsequent requests for paginated data of the same query, the query filter arguments must remain the same. If the query filter changes in subsequent requests, the query returns an error because it expects you to reset the offset.

## <a id="section_c3m_hkf_44b"></a>Examples

This sample query returns the first 20 rows:

```
query getActiveWorkers3($limit: BigInt, $offset: BigInt) {
worker(
 dataSource: {indexedAllWorkers: {filter: {indexedAllWorkersFilter: {isActive: true}}}}
 limit: $limit
 offset: $offset
) {
 data {
   descriptor
   workdayID {
     id
   }
 }
 total
}
}
```

The `limit` and `offset` variables:

```
{
"limit": 20,
"offset": 0
}
```

Assume the returned `total` is 32. To get the next page of rows, call the same query with the same `limit` value. Increment the `offset` value by 20:

```
{
"limit": 20,
"offset": 20
}
```

Now let's assume the returned `total` is 120. This table displays the sample `limit` and `offset` values in a series of paginated requests. In this example, the page size is 50.

<b>Note:</b> For grid pagination in an Extend app, the recommended `limit` value is at least 50.

<table><thead><tr><th>limit</th><th>offset</th><th>Response</th></tr></thead><tbody><tr><td>50</td><td>0</td><td>Rows 1-50</td></tr><tr><td>50</td><td>50</td><td>Rows 51-100</td></tr><tr><td>50</td><td>100</td><td>Rows 101-120</td></tr></tbody></table><br/>

### Related Information

[Graph API Queries](/wcp_docs/qxq1671067079349.html)

[Sample Queries](/wcp_docs/rwv1654130107088.html)

