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

Allow RESTClient and GQLClient to support automatic pagination #23

Open
samcoe opened this issue Jan 28, 2022 · 1 comment
Open

Allow RESTClient and GQLClient to support automatic pagination #23

samcoe opened this issue Jan 28, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@samcoe
Copy link
Contributor

samcoe commented Jan 28, 2022

Pagination is currently not possible using RESTClient and takes lots of manual work using GQLClient. We should support this feature for both. Initial implementation idea is to add a pagination options to ClientOptions which would enable this for both clients and be a noop for the HTTPClient.

@samcoe samcoe added the enhancement New feature or request label Jan 28, 2022
nicokosi added a commit to nicokosi/gh-collab-scanner that referenced this issue Mar 14, 2022
Current page can be set via a new '--page' flag (default: 1):

    $ gh collab-scanner --org softwarevidal --page 2
    $ gh collab-scanner --user nicokosi --page 2

Page size is hard-coded to 100.

PS:

- I could not retrieve pagination info (page x on y) because
of this limitation 😭:
cli/go-gh#23

- I tried to guess current page via Exec for
"gh repo list $user --json id --limit 1000" but response time
was very slow. 🐌
See https://github.com/cli/go-gh/blob/trunk/example_gh_test.go#L16
nicokosi added a commit to nicokosi/gh-collab-scanner that referenced this issue Mar 14, 2022
Current page can be set via a new '--page' flag (default: 1):

    $ gh collab-scanner --org softwarevidal --page 2
    $ gh collab-scanner --user nicokosi --page 2

Page size is hard-coded to 100.

PS:

- I could not retrieve pagination info (page x on y) because
of this limitation 😭:
cli/go-gh#23

- I tried to guess current page via Exec for
"gh repo list $user --json id --limit 1000" but response time
was very slow. 🐌
See https://github.com/cli/go-gh/blob/trunk/example_gh_test.go#L16
nicokosi added a commit to nicokosi/gh-collab-scanner that referenced this issue Mar 14, 2022
Current page can be set via a new '--page' flag (default: 1):

    $ gh collab-scanner --org softwarevidal --page 2
    $ gh collab-scanner --user nicokosi --page 2

Page size is hard-coded to 100.

PS:

- I could not retrieve pagination info (page x on y) because
of this limitation 😭:
cli/go-gh#23

- I tried to guess current page via Exec for
"gh repo list $user --json id --limit 1000" but response time
was very slow. 🐌
See https://github.com/cli/go-gh/blob/trunk/example_gh_test.go#L16
nicokosi added a commit to nicokosi/gh-collab-scanner that referenced this issue Mar 14, 2022
Current page can be set via a new '--page' flag (default: 1):

    $ gh collab-scanner --org softwarevidal --page 2
    $ gh collab-scanner --user nicokosi --page 2

Page size is hard-coded to 100.

PS:

- I could not retrieve pagination info (page x on y) because
of this limitation 😭:
cli/go-gh#23

- I tried to guess current page via Exec for
"gh repo list $user --json id --limit 1000" but response time
was very slow. 🐌
See https://github.com/cli/go-gh/blob/trunk/example_gh_test.go#L16
nicokosi added a commit to nicokosi/gh-collab-scanner that referenced this issue Mar 14, 2022
Current page can be set via a new '--page' flag (default: 1):

    $ gh collab-scanner --org softwarevidal --page 2
    $ gh collab-scanner --user nicokosi --page 2

Page size is hard-coded to 100.

PS:

- I could not retrieve pagination info (page x on y) because
of this limitation 😭:
cli/go-gh#23

- I tried to guess current page via Exec for
"gh repo list $user --json id --limit 1000" but response time
was very slow. 🐌
See https://github.com/cli/go-gh/blob/trunk/example_gh_test.go#L16
@heaths
Copy link
Contributor

heaths commented May 9, 2022

Similar to cli/cli#1268. Perhaps there's a common solution for both. What @mislav suggested is a good idea. I would think with REST an array could simply be amended with subsequent elements. GraphQL might be more tricky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants