LakeQL
  • Overview
Server Setup
  • Create Server
  • Define Config
  • Yoga Configuration
  • createLakeQLApp
Authentication
  • Authorization Model
  • JWT Authentication
  • Permissions
  • Scope Authorization
  • Trino User Impersonation
  • Debugging Identity
Schema Builder
  • Builder Configuration
  • Scalar Types
  • Comparison Types
  • Pagination
  • Input Validation
Customization
  • Custom Queries & Mutations
  • Extending Core
  • CORS Configuration
  • Error Handling
  • API Reference
GitHub
LakeQL
  1. API
  2. Schema Builder
  3. Pagination

On this page

  1. Paging Input
  2. Page Info
  3. Total Count

Pagination

The Paging input and PageInfo type on generated queries.

Generated queries are paginated with a Paging input argument and return a PageInfo object alongside the rows.

Paging Input #

1
2
3
4
5
input Paging {
  page: Int = 1
  perPage: Int = 100
}
  • page — the 1-based page number, defaulting to 1 .
  • perPage — rows per page, defaulting to 100 . It is validated to be at least 1 and at most the configured maximum (see maxRecordsPerPage , default 2000 ).

Page Info #

Every paginated result includes a PageInfo:

1
2
3
4
5
6
7
8
9
type PageInfo {
  currentPage: Int
  hasNext: Boolean
  hasPrevious: Boolean
  maxPages: Int
  nextPage: Int
  previousPage: Int
}

Pass nextPage and previousPage back in paging to move between pages. They are null at the ends. The total used to compute maxPages comes from the query builder's count CTE, so pagination metadata is accurate in a single round trip. See sorting and paging.

Total Count #

Alongside nodes and pageInfo, the generated connection type exposes a totalCount. This is the total number of matching rows before paging. It comes from the same count CTE, so you get it without a second query.

Previous page

Comparison Types

Next page

Input Validation