{"id":22181556,"url":"https://github.com/gfarb/gh-graphql-paginator","last_synced_at":"2026-04-16T11:36:08.996Z","repository":{"id":40383949,"uuid":"487346535","full_name":"gfarb/gh-graphql-paginator","owner":"gfarb","description":"Cursor-based pagination of a GitHub GraphQL query Connection for a single object.","archived":false,"fork":false,"pushed_at":"2022-05-12T17:03:46.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-22T02:56:26.711Z","etag":null,"topics":["github","github-actions","graphql","pagination"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gfarb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-30T17:59:09.000Z","updated_at":"2023-06-29T14:51:24.000Z","dependencies_parsed_at":"2022-08-09T19:00:16.780Z","dependency_job_id":null,"html_url":"https://github.com/gfarb/gh-graphql-paginator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gfarb/gh-graphql-paginator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarb%2Fgh-graphql-paginator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarb%2Fgh-graphql-paginator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarb%2Fgh-graphql-paginator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarb%2Fgh-graphql-paginator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gfarb","download_url":"https://codeload.github.com/gfarb/gh-graphql-paginator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfarb%2Fgh-graphql-paginator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31884268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","github-actions","graphql","pagination"],"created_at":"2024-12-02T09:40:38.222Z","updated_at":"2026-04-16T11:36:08.969Z","avatar_url":"https://github.com/gfarb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple GitHub GraphQL Paginator\nSimple GitHub GraphQL Paginator is a Node.js project that uses cursor-based pagination to paginate a GitHub GraphQL query Connection for a single object.\n  \n## Installation\nUse the Node package manager [npm](https://www.npmjs.com/package/gh-graphql-paginator) to install Simple GitHub GraphQL Paginator.\n\n```bash\nnpm install gh-graphql-paginator\n```\n\n## Usage\n#### Required:\n- Set an environment variable called `GITHUB_TOKEN` that stores a valid GitHub PAT that will be used for GitHub GraphQL API authentication.\n- The GraphQL query must include a variable called `endCursor` that is passed as the `after` argument value for the object which requires pagination. See the examples below.\n- Use Connections for the object you need to paginate, do not use Edges. See the examples below.\n- The Connection that requires pagination must also include `pageInfo` with `hasNextPage` and `endCursor` as well as `totalCount`. See the examples below.\n- The Connection that requires pagination must be a child of a single object. For example, this project cannot paginate issues and subsequently paginate comments for every issue. This project can paginate all issues pertaining to a repository or all issue comments for an issue.\n\n#### Examples:\n_This query is fetching public repositories from the `GitHub` organization. The query will be paginated and all public repositories from the `GitHub` organization will be returned_.\n```javascript\nimport { paginate } from 'gh-graphql-paginator'\nconst query = `\n  query ($endCursor: String) {\n    organization(login: \"github\") {\n      repositories(first: 100, after: $endCursor, privacy: PUBLIC) {\n        nodes {\n          id\n          name\n        }\n        totalCount\n        pageInfo {\n          hasNextPage\n          endCursor\n        }\n      }\n    }\n  }\n`;\n\nasync function paginateQuery() {\n  const results = await paginate(query);\n  console.log(JSON.stringify(results));\n}\n```\n\n_This query is fetching issue comments from Issue #3 in the `github/github` repo. The query will be paginated and all issue comments for the issue will be returned_.\n```javascript\nimport { paginate } from 'gh-graphql-paginator'\nconst query = `\n  query ($endCursor: String) {\n    repository(name: \"github\", owner: \"github\") {\n      issue(number: 3) {\n        id\n        comments(first: 1, after: $endCursor) {\n          nodes {\n            id\n            body\n          }\n          totalCount\n          pageInfo {\n            hasNextPage\n            endCursor\n          }\n        }\n      }\n    }\n  }\n`;\n\nasync function paginateQuery() {\n  const results = await paginate(query);\n  console.log(JSON.stringify(results));\n}\n```\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n\n## Supporting Docs\n- [GraphQL Pagination](https://graphql.org/learn/pagination/)\n- [GitHub GraphQL API](https://docs.github.com/en/graphql)\n- [GitHub GraphQL Variables](https://docs.github.com/en/graphql/guides/forming-calls-with-graphql#working-with-variables)\n- [GitHub GraphQL Connections](https://docs.github.com/en/graphql/guides/introduction-to-graphql#connection)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfarb%2Fgh-graphql-paginator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgfarb%2Fgh-graphql-paginator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfarb%2Fgh-graphql-paginator/lists"}