Skip to main content

Ordering & Pagination

Ordering

The system allows for sorting data according to various criteria, such as score, price, departure date, and trip duration. This feature enables users to customize the way information is presented according to their preferences, making it easier to find relevant data.

You can sortting data by:

  • SCORE_DESC - score descending (default)
  • PRICE_ASC - price ascending
  • PRICE_DESC - price descending
  • DEPARTURE_DATE_ASC - departure date ascending
  • DEPARTURE_DATE_DESC - departure date descending
  • TRIP_DURATION_ASC - trip duration (based on field period) ascending
  • TRIP_DURATION_DESC - trip duration descending

Example of sorting data by SCORE_DESC

query {
search (
countryCode: PL,
languageCode: PL,
order: SCORE_DESC,
) {
count
offers {
id
name
}
}
}

Example of sorting data by PRICE_ASC


query {
search (
countryCode: PL,
languageCode: PL,
order: PRICE_ASC,
) {
count
offers {
id
name
}
}
}

Pagination

Pagination is a technique that divides data into smaller chunks (pages), allowing only a portion of the data to be loaded at a time, rather than fetching everything all at once. This approach enhances the user experience by making the browsing process more efficient and manageable, while also reducing the load on both the server and the client.

Example of using pagination on search results page

query {
search (
countryCode: PL,
languageCode: PL,
pagination: {
offset: 0,
limit: 5
},
) {
count
offers {
id
name
}
}
}
If you don't find example

You can explore the available filter options and other fields on our Demo Search Playground. Visit the Docs tab for detailed information on these options.