As a developer, I want to ensure all GitHub ProjectV2 items are fetched—even when there are more than 100—so that reminder tasks always include the full list of project items.
🧠 Context
GitHub's GraphQL API has a pagination limit of 100 items per request when querying projectV2Items. This is fine for now since our project has fewer than 100 items, but we will eventually exceed this limit. If we don’t handle pagination, some project items will be excluded from reminder logic.
Currently, we fire the query in
src/infrastructure/github/functions/fetchProjectItems.ts,
which uses the GraphQL document defined in
src/github/graphql/projectV2Items.ts.
The GraphQL response includes a pageInfo.hasNextPage field, which indicates whether more items are available.
To support pagination:
- If
hasNextPage is true, we should fire additional requests to fetch the remaining items.
- This should repeat until
hasNextPage is false.
To paginate properly, we need to update our GraphQL query to use the after parameter (and optionally before), in addition to the first parameter (currently defined on line 5):

There’s no need to introduce a new GraphQL client—existing examples of how to pass query variables can be found in
src/infrastructure/github/functions/updateProjectItemAssignee.ts.
🛠️ Implementation Plan
-
Update the GraphQL Query
- Modify
src/github/graphql/projectV2Items.ts to accept and use an after variable in the projectV2Items connection
-
Implement Pagination Logic
-
Follow Existing Variable Patterns
- Refer to
src/infrastructure/github/functions/updateProjectItemAssignee.ts for how to pass variables into GraphQL queries with our current setup
-
Write Tests
- Mock paginated GraphQL responses
- Verify that multiple pages are fetched and merged correctly
- Ensure all items are returned even when more than 100 exist
✅ Acceptance Criteria
As a developer, I want to ensure all GitHub ProjectV2 items are fetched—even when there are more than 100—so that reminder tasks always include the full list of project items.
🧠 Context
GitHub's GraphQL API has a pagination limit of 100 items per request when querying
projectV2Items. This is fine for now since our project has fewer than 100 items, but we will eventually exceed this limit. If we don’t handle pagination, some project items will be excluded from reminder logic.Currently, we fire the query in
src/infrastructure/github/functions/fetchProjectItems.ts,which uses the GraphQL document defined in
src/github/graphql/projectV2Items.ts.The GraphQL response includes a
pageInfo.hasNextPagefield, which indicates whether more items are available.To support pagination:
hasNextPageistrue, we should fire additional requests to fetch the remaining items.hasNextPageisfalse.To paginate properly, we need to update our GraphQL query to use the
afterparameter (and optionallybefore), in addition to thefirstparameter (currently defined on line 5):There’s no need to introduce a new GraphQL client—existing examples of how to pass query variables can be found in
src/infrastructure/github/functions/updateProjectItemAssignee.ts.🛠️ Implementation Plan
Update the GraphQL Query
src/github/graphql/projectV2Items.tsto accept and use anaftervariable in theprojectV2ItemsconnectionImplement Pagination Logic
In
src/infrastructure/github/functions/fetchProjectItems.ts, update the logic to:endCursorreturned from each pagehasNextPageto continue fetching pagesFollow Existing Variable Patterns
src/infrastructure/github/functions/updateProjectItemAssignee.tsfor how to pass variables into GraphQL queries with our current setupWrite Tests
✅ Acceptance Criteria
projectV2Itemsquery insrc/github/graphql/projectV2Items.tsuses theafterparameter to support paginationfetchProjectItems.tshandles pagination usinghasNextPageandendCursor