Add cursor-based paging - #3759
Conversation
…nitiate useBikeRentalAvailabilityInformation in REST API and LegacyGraphQL API.
8840579 to
b52a657
Compare
|
Need to add bidirectional paging, at least in the API layer, but it might return nulls for now. |
edf6e65 to
e6b326a
Compare
optionsome
left a comment
There was a problem hiding this comment.
Including nextPageCursor or previousPageCursor fields in the query at least in the legacy graphQL API leads to NPE if no public transportation modes are included. I think in that situation those fields should just return null.
Another note, at least arriveBy=true search can include same itinerary in the previous page as in the current page. I remember some known issue was discussed in a developer meeting but was it this?
Co-authored-by: Joel Lappalainen <lappalj8@gmail.com> Co-authored-by: Thomas Gran <t2gran@gmail.com>
…otp2_cusor_based_scrolling
This has now been fixed in all APIs |
optionsome
left a comment
There was a problem hiding this comment.
Seems to be ok now apart from the known problems with the itineraries being served in next/previous pages.
Summary
This PR adds cursor-based scrolling. It adds a new class,
PageCursor, which encapsulates and encodes the necessary metadata to allow for paging. Currently paging is only supported in one direction, forwards if arriveBy is false and backwards if arriveBy is true. It adds this information to all APIs, both as input and output. Also, a button for fetching the next page is added to the debug client,Unit tests
Added unit test for paging data.
Code style
Code style followed.
Documentation
No updates. The field documentation was updated for the GraphQL APIs.