Skip to content

Limit parameter

The limit parameter restricts the maximum number of items returned in a single response.

It is commonly used to retrieve a subset of results, such as the first few items from a list.

limit=value: Integer
limit(value: Integer)

Usage

In this example, the response is limited to a single item. The actual item returned depends on the sort order. To ensure consistent results, combine limit with a sort clause.

GET https://api.play.funql.io/v1beta1/sets?limit=1
HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "name": "LEGO Star Wars Millennium Falcon",
    "setNumber": 75192,
    "price": 849.99,
    "launchTime": "2017-10-01T14:15:30.500Z"
  }
]

Try

POST https://api.play.funql.io/funql
Content-Type: text/plain

listSets(
  limit(1)
)
HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": [
    {
      "name": "LEGO Star Wars Millennium Falcon",
      "setNumber": 75192,
      "price": 849.99,
      "launchTime": "2017-10-01T14:15:30.500Z"
    }
  ]
}

Pagination

To paginate results, combine limit with the skip parameter. For example, to fetch the second page of a paginated list (items 11–20), use skip(10) and limit(10).

See the skip parameter for a full example.