Skip to content

fix(pagination): allow operation input to specify pagination token #1500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 9, 2025

Conversation

icholy
Copy link
Contributor

@icholy icholy commented Jan 9, 2025

Description of changes:

The existing value at inputTokenName should not be overwritten if startingToken was not provided.

Use-Case:

I was surprised when the following DynamoDB scan didn't respect the ExclusiveStartKey property, but did respect the Limit property.

const paginator = paginateScan(
	{ client: documentClient },
	{
		TableName: 'my-table',
		ExclusiveStartKey: key,
		Limit: 1000,
	},
);

@icholy icholy requested a review from a team as a code owner January 9, 2025 13:59
@icholy icholy force-pushed the empty-pagination-token branch 2 times, most recently from 4235107 to 76f115a Compare January 9, 2025 14:01
@kuhe kuhe force-pushed the empty-pagination-token branch from 0cd5012 to 54bbb74 Compare January 9, 2025 17:08
@kuhe kuhe changed the title fix(pagination): only use startingToken if it exists fix(pagination): allow operation input to specify pagination token Jan 9, 2025
@kuhe kuhe merged commit 000b2ae into smithy-lang:main Jan 9, 2025
6 of 10 checks passed
@kuhe
Copy link
Contributor

kuhe commented Jan 9, 2025

released in https://www.npmjs.com/package/@smithy/core/v/3.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants