OffsetLimit

data class OffsetLimit(val offset: Int, val limit: Int)(source)

Result of converting viaduct.api.types.ConnectionArguments to an offset/limit pair.

This is the bridge between GraphQL pagination arguments (first, after, last, before) and the offset-based slice that a backend query requires. Produced by viaduct.api.types.ConnectionArguments.toOffsetLimit and consumed by viaduct.api.internal.ConnectionBuilder internally.

Constructors

Link copied to clipboard
constructor(offset: Int, limit: Int)

Properties

Link copied to clipboard
val limit: Int

Maximum number of items to fetch.

Link copied to clipboard
val offset: Int

Index of the first item to fetch. A negative value signals viaduct.api.internal.ConnectionBuilder.fromList to resolve from the tail of the dataset (e.g. -1 is the last item, -10 means the 10th from the end).