web-ridge / sqlboiler-graphql-schema

MOVED TO https://github.com/web-ridge/gqlgen-sqlboiler
7 stars 2 forks source link

adding support for pagination #3

Closed alichherawalla closed 4 years ago

RichardLindhout commented 4 years ago

Very nice! I always dit it the same way like this but are you open for cursor-based pagination this is much stronger as it works when someone is adding items to the list and you want the other batch and it misses some items.

But I will merge this if this option is optional we could later do cursor based pagination like this:

--pagination=offset (your PR) --pagination=cursor --pagination=relay

https://engineering.dubsmash.com/bi-directional-pagination-using-graphql-relay-b523c919c96

alichherawalla commented 4 years ago

I haven't tried relay as yet so not sure of that implementation but happy to explore that in the future as well

RichardLindhout commented 4 years ago

Yeah if you make the pagination a choice I will accept it you don't have to implement the other options yet

alichherawalla commented 4 years ago

I don't follow completely, currently, in the PR the pagination is optional.

Is there something else that i'm missing?

RichardLindhout commented 4 years ago

Can you make it as a command option and only generate if that option is provided so we can be backward compatible later when we add other pagination options.

Like this: --pagination=offset (your PR) --pagination=cursor --pagination=relay

Docs are here: https://github.com/urfave/cli/blob/master/docs/v2/manual.md

alichherawalla commented 4 years ago

I see what you mean, updated with CLI support. Thanks!