Magidoc

Pagination

When working with the Rasayel API, you may need to fetch a list of resources and go through them in manageable chunks. This is where pagination comes in handy.

Rasayel uses a conventional cursor-based pagination system for its GraphQL API. With each query, you can request PageInfo , which provides information about the current page and how to retrieve the next one.

Examples

#

Let's say you want to retrieve a list of AppUsers from the Rasayel API, along with information about the page. Here's an example query:

    
  

This query returns an object containing information about the AppUsers and the page:

    
  

Notice that the pageInfo in the response includes an endCursor key. This is our pagination cursor. To retrieve the next page of AppUsers , simply include that cursor in your query:

    
  

The next response will contain the next page of users:

    
  

Wrapping Up Pagination

#

Congratulations! You've now learned how to use cursor-based pagination with the Rasayel API. By incorporating PageInfo in your query, you've gained the ability to retrieve valuable information about the current page and effortlessly navigate to the next one. This technique allows you to browse through resource lists in a manageable and efficient manner, without overloading your application or the API.

As you continue exploring the Rasayel API, always remember to utilize the provided pagination system for an enjoyable and responsive experience. Happy querying, and don't hesitate to reach out if you have any questions or need assistance!