Cloudflare 中文文档
Analytics
Analytics
编辑这个页面
跳转官方原文档
Set theme to dark (⇧+D)

Pagination

Pagination – breaking up your query results into smaller parts – can be done using limit, orderBy, and filtering parameters. The GraphQL Analytics API does not support cursors for pagination.

  • limit (integer) defines how many records to return.
  • orderBy (string) defines the sort order for the data.

​​ Query pages without cursors

Our examples assume that the date and clientCountryName relationships are unique.

​​ Get the first n results of a query

To limit results, add the limit parameter as an integer. For example, query the first two records:

Response

​​ Query for the next page using filters

To get the next n results, specify a filter to exclude the last result from the previous query. Taking the previous example, you can do this by appending the greater-than operator (_gt) to the clientCountryName field and the greater-or-equal operator (_geq) to the datetime field. This is where being specific about sort order comes into play. You are less likely to miss results using a more granular sort order.

Response

​​ Query the previous page

To get the previous n results, reverse the filters and sort order.

Response