Skip to content

Commit 4235107

Browse files
committed
fix(pagination): only use startingToken if it exists
1 parent 7b03def commit 4235107

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/core/src/pagination/createPaginator.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ export function createPaginator<
3333
input: InputType,
3434
...additionalArguments: any[]
3535
): Paginator<OutputType> {
36-
let token: any = config.startingToken || undefined;
36+
let token = config.startingToken;
3737
let hasNext = true;
3838
let page: OutputType;
3939

4040
while (hasNext) {
41-
(input as any)[inputTokenName] = token;
41+
if (token) {
42+
(input as any)[inputTokenName] = token;
43+
}
4244
if (pageSizeTokenName) {
4345
(input as any)[pageSizeTokenName] = (input as any)[pageSizeTokenName] ?? config.pageSize;
4446
}

0 commit comments

Comments
 (0)