Skip to content
New issue

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

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

Already on GitHub? # to your account

Request additional GitHub "projectV2Items" via pagination #1

Open
MathyouMB opened this issue Jun 17, 2024 · 0 comments
Open

Request additional GitHub "projectV2Items" via pagination #1

MathyouMB opened this issue Jun 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@MathyouMB
Copy link
Member

MathyouMB commented Jun 17, 2024

GitHub has a pagination limit of 100 projectV2Items per request. This is ok for how because we have less than 100 items in our GitHub project, however we'll eventually have more than that and need to have them included in reminders.

On src/github/index.ts in fetchData we fire this GraphQL query src/github/graphql/projectV2Items.ts. In the response, we get back the data pageinfo.hasNextPage.

If pageinfo.hasNextPage is true, than we should fire a additional request to get the remaining item data. We should continue to do this until hasNextPage is false.

To make sure different pages of data are requested each request, we'll need to update this GraphQL query to utilize the "after & before" parameters instead of the "first" parameter (see line 5):

Screenshot 2024-06-16 at 11 58 17 PM

I think we'll need a proper GraphQL client to manage variables: https://www.npmjs.com/package/graphql-client

@ryangchung ryangchung added the enhancement New feature or request label Jun 17, 2024
@l004p l004p self-assigned this Jun 30, 2024
@l004p l004p moved this from Unassigned - Todo to Assigned - In Progress in Summer 2024 Open Source Contributions Jun 30, 2024
@l004p l004p removed their assignment Aug 15, 2024
@l004p l004p moved this from Assigned - In Progress to Unassigned - Todo in Summer 2024 Open Source Contributions Aug 15, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
Status: Unassigned - Todo
Development

No branches or pull requests

3 participants