feat(pagination): add cursor-based pagination to all list commands#53
Merged
feat(pagination): add cursor-based pagination to all list commands#53
Conversation
Add $after variable and pageInfo { hasNextPage endCursor } selection
to all 10 list queries for cursor-based pagination support.
Add PageInfo, PaginatedResult<T>, and PaginationOptions types to
src/common/types.ts.
Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
Accept PaginationOptions with optional after cursor. Return
{ nodes, pageInfo } instead of flat arrays.
Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
…nt services Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
Wire all list commands to updated service signatures that accept PaginationOptions and return PaginatedResult. Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
Local filtering makes server pageInfo misleading. Set hasNextPage to false since cursor pagination is incompatible with --window. Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
…ases Fix existing tests for new PaginationOptions signatures and PaginatedResult return types. Add cursor passthrough and pageInfo assertions. Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
…ct --window with --after
Ensure documents list --issue returns { nodes, pageInfo } like all
other list commands. Prevent --after with --window in cycles since
local filtering is incompatible with cursor pagination.
Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
Ties PageInfo to the GraphQL schema instead of maintaining a separate interface that could drift from the generated types. Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
…dation Replace 9 unvalidated parseInt calls across 7 command files with a shared parseLimit() that rejects NaN and non-positive values. Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
…stone services Cover all public functions with happy path and error cases. Include pagination-specific assertions for all list functions. Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
Cover createComment with success and failure cases. Cover FileService download and upload with happy paths and error conditions. Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
--after <cursor>) on all list commands{ nodes, pageInfo }for all list commands (breaking change)--limitoption added to teams, users, labels, cycles (previously hardcoded)parseLimit()helper with consistent NaN/negative validationPageInfotype derived from codegen (no drift)Why
Details
GraphQL layer
$after: Stringvariable andpageInfo { hasNextPage endCursor }to all 10 list queriesService layer
PaginationOptionsand returnPaginatedResult<T>Command layer
--after <cursor>on all 8 list commands--limitadded where missing (teams, users, labels, cycles)--window+--afterrejected in cycles (incompatible)documents list --issuewrapped in PaginatedResult for consistencyparseLimit()replaces 9 bare parseInt callsTesting
Breaking Change
All list commands now output
{ "nodes": [...], "pageInfo": { "hasNextPage": bool, "endCursor": string|null } }instead of flat arrays.Checklist
Resolves iamfj#11