crud icon indicating copy to clipboard operation
crud copied to clipboard

Pagination info on select/pairs

Open no1seman opened this issue 3 years ago • 0 comments

crud has 2 methods: select and pairs which returns a list of tuples, also it has after option that used for pagination. Thats great but in different interfaces: rest/graphql/language connectors with reactive resotories it wiil be great to have smth like pageInfo in GraphQL:

pageInfo { startCursor - first tuple in the returned list endCursor - last tuple in the returned list hasNextPage - boolean, true if any tuples exists after last tuple in the list hasPreviousPage - boolean, true if any tuples exists before first tuple in the list }

Since this info is optional and needed only in pagination it will be returned only if opts.pageinfo option if true (false by default)

Suggested API: res = { rows = {...}, metadata={...}, pageinfo={ startCursor = ..., endCursor = ..., hasNextPage = ..., hasPreviousPage = ...}, }

no1seman avatar Oct 14 '21 19:10 no1seman