ConnectionArguments

Typed access to the pagination inputs (first, after, last, before) of a connection field.

Codegen picks the right sub-interface based on which arguments the schema declares. viaduct.api.internal.ConnectionBuilder calls toOffsetLimit internally — call it directly only when you need the offset/limit to query a backend before using the builder.

See also

Inheritors

Functions

Link copied to clipboard

Returns true if toOffsetLimit requires knowing the total count of items to compute the correct offset.

Link copied to clipboard
abstract fun toOffsetLimit(defaultPageSize: Int = 20): OffsetLimit

Converts connection arguments to offset/limit for database queries.

open fun toOffsetLimit(totalCount: Int, defaultPageSize: Int = 20): OffsetLimit

Converts connection arguments to offset/limit when the total count of items is known.

Link copied to clipboard
abstract fun validate()

Validate connection arguments without converting.