Skip to content

Sort using FrontQL

Introduction

In web applications, it is common to sort data in ascending or descending order. FrontQL provides the ability to sort data using the sort query parameter.

Implementing Sort

  • The sort query parameter is used to specify the sort order.

Example

Here’s a simple example of implementing sort using FrontQL:

async function getUsers() {
const response = await Api.get("/users", {
sort: "-created_at",
});
return response;
}

This example uses the sort query parameter to sort the data in descending order based on the created_at field.