Skip to content
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

[cli] Add client.fetchPaginated() async iterator #10054

Merged
merged 4 commits into from
Jun 5, 2023

Conversation

TooTallNate
Copy link
Member

Adds async iterator helper function for interacting with endpoints that have pagination.

Implemented for use with vc bisect (fetching deployments) and vc link --repo (fetching projects).

Adds async iterator helper function for interacting with endpoints that
have pagination.

Implemented for use with `vc bisect` (fetching deployments) and `vc link --repo` (fetching projects).
@changeset-bot
Copy link

changeset-bot bot commented Jun 1, 2023

🦋 Changeset detected

Latest commit: 323f21e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

EndangeredMassa
EndangeredMassa previously approved these changes Jun 2, 2023
@@ -383,7 +383,7 @@ export interface ProjectLink {
export interface PaginationOptions {
prev: number;
count: number;
next?: number;
next?: number | null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (non-blocking): ‏Is there some type shuffling we can do to make this not both null and undefined?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I've seen so far I think the API will always return null. Will double check on that though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could wrap it to get rid of one of the types. It's not a huge deal, but I do like simplifying these when they come up. I don't want to read the type later and wonder what the difference between undefined and null means for this property.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use the same type as defined in API repo

cb1kenobi
cb1kenobi previously approved these changes Jun 2, 2023
@TooTallNate TooTallNate added the pr: automerge Automatically merge the PR when checks pass label Jun 2, 2023
@kodiakhq kodiakhq bot merged commit a5e32ec into main Jun 5, 2023
102 checks passed
@kodiakhq kodiakhq bot deleted the update/cli-fetchPaginated branch June 5, 2023 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: automerge Automatically merge the PR when checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants