Skip to content

Pagination

The GraphQL API allows you to use pagination.

Limit and offset

You can optionally provide limit and offset to control pagination

graphql
query FirstHundredFloors {
  getFloors(paginationInput: { limit: 100, offset: 0 }) {
    floors {
      id
      area
    }
  }
}

Ordering

You can order by CREATED_AT, UPDATED_AT or NAME and set the order direction to ASC to DESC

graphql
query FirstHundredFloors {
  getFloors(paginationInput: { orderBy: CREATED_AT, orderByDirection: ASC }) {
    floors {
      id
      area
    }
  }
}

Pagination info

The getFloors query allows you to retrieve the current pagination info including currentPage, limit, offset, totalCount and totalPageCount.

graphql
query ThreeToFourHundredFloors {
  getFloors(paginationInput: { limit: 100, offset: 200 }) {
    floors {
      id
      area
    }
    paginationInfo {
      currentPage
      limit
      offset
      totalCount
      totalPageCount
    }
  }
}