The UI this would most naturally support would involve hitting the limit, then showing a "Load More" button (or something like that), then fetching the next page of results.
For flexibility, I've also added a "page limit" query param so the client can fetch more than 10 levels in a single page.
Pagination is cursor-based (rather than offset) because that's what DynamDB supports out-of-the-box (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.Pagination.html).
The UI this would most naturally support would involve hitting the limit, then showing a "Load More" button (or something like that), then fetching the next page of results.
For flexibility, I've also added a "page limit" query param so the client can fetch more than 10 levels in a single page.