3 ms·
Kinda related to this discussion about pagination APIs: One year ago I had to design an API [0] for paginated nodes which also allows nested nodes. Overall the
by rwieruch 4y ago
Kinda related to this discussion about pagination APIs:
One year ago I had to design an API [0] for paginated nodes which also allows nested nodes. Overall there would be more than 100.000 nodes in the database.
On the UI side there would be a tree table to display the nodes. First you would fetch page 0 with 100 nodes and from there you could either perform a paginated fetch for the next page (page 1) or a nested fetch for page 0 for one of the initially fetched nodes. So essentially the API allows paginated and nested fetches where each nested fetch would be a paginated fetch too.
We used cursor based pagination, because there would be added and deleted nodes eventually in a collaborative environment. It was definitely a fun challenge!
[0] https://www.robinwieruch.de/react-tree-list/ https://www.robinwieruch.de/react-tree-list/