Skip to content

[v0.4.1.experimental.1] Offset pagination

feat: experimental offset-pagination

Pre-release
Pre-release
Compare
Choose a tag to compare
@mak626 mak626 released this 21 Dec 17:26

Introduced
AsyncMongoenginePaginationObjectType
AsyncMongoenginePaginationField

Usages

Sample

query UsersQuery($offset: Int, $limit: Int) {
  usersQuery(offset: $offset, limit: $limit) {
    edges {
      node {
        id
      }
    }
    pageCount # new field
  }
}

Recommended Usage

query UsersQuery($offset: Int, $limit: Int, $requires_page_count: Boolean!) {
  usersQuery(offset: $offset, limit: $limit) {
    edges {
      node {
        id
      }
    }
    pageCount @include(if: $requires_page_count)
  }
}

@include directive can be used to auto include the field dynamically

or you can achieve the same using the @skip directive