Documentation ¶
Index ¶
- func EdgesToReturn[T any](ctx context.Context, before, after *string, first, last *int, ...) (edges []Edge[T], nodes []T, pageInfo *PageInfo, err error)
- type ApplyCursorsFunc
- type ApplyCursorsRequest
- type ApplyCursorsResponse
- type Edge
- type LazyEdge
- type OrderBy
- type PageInfo
- type PaginateRequest
- type PaginateResponse
- type Pagination
- type PaginationFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EdgesToReturn ¶
func EdgesToReturn[T any]( ctx context.Context, before, after *string, first, last *int, orderBys []OrderBy, nodesOnly bool, applyCursorsFunc ApplyCursorsFunc[T], ) (edges []Edge[T], nodes []T, pageInfo *PageInfo, err error)
https://relay.dev/graphql/connections.htm#sec-Pagination-algorithm https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo.Fields
Types ¶
type ApplyCursorsFunc ¶
type ApplyCursorsFunc[T any] func(ctx context.Context, req *ApplyCursorsRequest) (*ApplyCursorsResponse[T], error)
https://relay.dev/graphql/connections.htm#ApplyCursorsToEdges()
type ApplyCursorsRequest ¶
type ApplyCursorsResponse ¶
type PaginateRequest ¶
type PaginateResponse ¶
type Pagination ¶
type Pagination[T any] interface { Paginate(ctx context.Context, req *PaginateRequest[T]) (*PaginateResponse[T], error) }
func New ¶
func New[T any](nodesOnly bool, maxLimit int, limitIfNotSet int, orderBysIfNotSet []OrderBy, applyCursorsFunc ApplyCursorsFunc[T]) Pagination[T]
type PaginationFunc ¶
type PaginationFunc[T any] func(ctx context.Context, req *PaginateRequest[T]) (*PaginateResponse[T], error)
func (PaginationFunc[T]) Paginate ¶
func (f PaginationFunc[T]) Paginate(ctx context.Context, req *PaginateRequest[T]) (*PaginateResponse[T], error)
Click to show internal directories.
Click to hide internal directories.