Add ability to format lists with paginated results including totalCount#80
Add ability to format lists with paginated results including totalCount#80DaKaZ wants to merge 3 commits intoVincit:masterfrom
Conversation
Add tests for pagination; Update readme with info about pagination;
|
@nasushkov any chance to get a review/comments on this PR? |
|
@DaKaZ This looks nice except that I wouldn't do it with a naked boolean to build(). I'd add |
|
@lookfirst sorry for the incredibly slow turn around! I just revisited this and had an AH HA moment. What do you think? I did not add the ability to change the collection or totalCount fields, but that could be subsequent PR if someone really wanted/needed that. |
|
@DaKaZ 🤷♂ ... I'm super sorry but I moved onto using type-graphql and mikro... pretty much the ideal combination. |
|
@koskimas or @nasushkov - any chance on of you could take a quick look at this and perhaps some of the other PRs that are outstanding? |
In our use of
objection-graphqlwe were having a hard time doing pagination correctly. The main reason is that we did not receive atotalCountof records available which made layout of the results difficult.With this PR, you can build your schema passing
trueinto the build function like this:and once that is constructed, you can query like this:
and the
totalCountis returned along with a list of the users.