Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add pagination support to GraphQL-based tools#683

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mattdholloway wants to merge28 commits intomain
base:main
Choose a base branch
Loading
fromadd-pagination-graphql

Conversation

mattdholloway
Copy link

@mattdhollowaymattdholloway commentedJul 15, 2025
edited
Loading

This PR idiomatically implements pagination for GraphQL based tools using the spec described inhttps://docs.github.com/en/graphql/reference/objects#connection and based on the standard inhttps://graphql.org/learn/pagination/

Closes:https://github.com/github/copilot-agent-services/issues/296

@mattdhollowaymattdholloway self-assigned thisJul 15, 2025
@mattdhollowaymattdholloway changed the titleinitial pagination forListDiscussionsAdd pagination support to GraphQL-based toolsJul 15, 2025
@mattdholloway
Copy link
Author

Pagination works for listing discussions but does not currently provide the caller with the details of which page it is on:

Screenshot 2025-07-15 at 16 45 33

@mattdhollowaymattdholloway marked this pull request as ready for reviewJuly 16, 2025 09:29
@CopilotCopilotAI review requested due to automatic review settingsJuly 16, 2025 09:29
@mattdhollowaymattdholloway requested a review froma team as acode ownerJuly 16, 2025 09:29
Copilot

This comment was marked as outdated.

Copilot

This comment was marked as outdated.

@mattdholloway
Copy link
Author

A downside of using cursor-based pagination in GraphQL is that there is no way of 'skipping' pages as the ID of the final entry of the previously - I am investigating falling back to the REST api if the user needs this functionality.

Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements pagination support for GraphQL-based tools to provide consistent pagination capabilities across both REST and GraphQL APIs. The changes introduce a unified pagination approach that accepts traditional page/perPage parameters while providing GraphQL cursor-based pagination support through theafter parameter.

Key changes include:

  • Introduction ofWithUnifiedPagination() function that adds page, perPage, and after parameters to GraphQL tools
  • Conversion of private pagination struct fields to public fields (Page, PerPage, After)
  • Addition ofToGraphQLParams() method to convert REST-style pagination to GraphQL parameters
  • Update of GraphQL discussion tools to return structured responses with pagination metadata

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
pkg/github/server.goAdds unified pagination support and GraphQL parameter conversion
pkg/github/discussions.goImplements pagination for all discussion-related GraphQL tools
pkg/github/discussions_test.goUpdates tests to handle new pagination response structure
pkg/github/server_test.goUpdates pagination tests for public struct fields
Multiple REST API filesUpdates field references from private to public pagination fields
README.mdDocuments new pagination parameters for discussion tools

mattdhollowayand others added5 commitsJuly 17, 2025 15:43
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@LuluBeatsonLuluBeatsonAwaiting requested review from LuluBeatson

@omgitsadsomgitsadsAwaiting requested review from omgitsads

At least 1 approving review is required to merge this pull request.

Assignees

@mattdhollowaymattdholloway

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@mattdholloway

[8]ページ先頭

©2009-2025 Movatter.jp