Implement fetchAllPages(fetch, url)
Cursor-paginated APIs return one page at a time: { items, nextCursor }, where nextCursor is null once there's nothing left. Write fetchAllPages(fetch, url) that follows nextCursor, requesting url first, then url + "?cursor=" + nextCursor for each following page, concatenating every page's items until nextCursor is null, and returns the combined array.
await fetchAllPages(fetch, "/items");
// keeps requesting until a page comes back with nextCursor: null,
// returns every item from every page, concatenated in order