Skip to content

Pagination using FrontQL

Introduction

In web applications, it is common to retrieve data in pages. FrontQL provides the ability to paginate data using the page query parameter.

In FrontQL, pagination is a crucial component of data retrieval and pagination functionality. Pagination is used to retrieve data in pages. The page query parameter is used to specify the page number and the number of items per page.

Implementing Pagination

  • The page query parameter is used to specify the page number and the number of items per page.
  • There are two parameters in the page parameter: page and limit.
  • page is the page number and limit is the number of items per page.
  • page and limit are separated by a comma.

Example

async function getUsers() {
const response = await Api.get("/users", {
page: "1,15", // here, page = 1, limit = 15
});
return response;
}

This example uses the page query parameter to specify the page number and the number of items per page.