đPagination
Learn how to use cursor pagination in the Airstack SDK using special and powerful pagination functions and variables offered by the Airstack SDK out of the box.
With the Airstack SDKs, you will not need to manually manage the cursor of each page yourself as they provide special pagination functions and variables that can help you simplify the process:
React/Node | Python | Description |
---|---|---|
|
| Boolean indicating if the next page exists |
|
| Boolean indicating if the previous page exists |
|
| Get response data and error on the next page |
|
| Get response data and error on the previous page |
If you are using the SDK for paginating response data, pageInfo.nextCursor
and pageInfo.prevCursor
will not be necessarily added to your query as it will be added automatically by the SDK.
Thus, you can just provide a query without any of the cursor field in your schema.
Pre-requisites
Install Airstack SDK
If you are using JavaScript/TypeScript or Python, Install the Airstack SDK:
React
Node
Example
Here is sample implementation of using the special functions and variables mentioned above for paginating through all the data returned by the API:
Developer Support
If you have any questions or need help regarding how to use cursor pagination with Airstack SDK, please join our Airstack's Telegram group.
More Resources
Last updated
Was this helpful?