diff --git a/packages/cli/snippets/paging-cursor.js b/packages/cli/snippets/paging-cursor.js index c01fbfab..2cb134b0 100644 --- a/packages/cli/snippets/paging-cursor.js +++ b/packages/cli/snippets/paging-cursor.js @@ -23,8 +23,8 @@ const perform = async (z, bundle) => { ); // after fetching a page, set the returned cursor for the next page, - // or empty/null if this was the last one. - await z.cursor.set(response.nextPage); + // or an empty string if the cursor is null + await z.cursor.set(response.nextPage ?? ''); return response.items; };