Socket
Socket
Sign inDemoInstall

@octokit/plugin-paginate-graphql

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/plugin-paginate-graphql

Octokit plugin to paginate GraphQL API endpoint responses


Version published
Weekly downloads
504K
increased by5.91%
Maintainers
4
Weekly downloads
 
Created

What is @octokit/plugin-paginate-graphql?

@octokit/plugin-paginate-graphql is a plugin for the Octokit library that simplifies the process of paginating through GitHub's GraphQL API responses. It allows developers to easily handle large sets of data that are returned in multiple pages by automatically fetching all pages of results.

What are @octokit/plugin-paginate-graphql's main functionalities?

Automatic Pagination

This feature allows you to automatically paginate through all pages of a GraphQL query. The code sample demonstrates how to fetch all issues from a GitHub repository using the paginateGraphql method.

const { Octokit } = require('@octokit/core');
const { paginateGraphql } = require('@octokit/plugin-paginate-graphql');

const MyOctokit = Octokit.plugin(paginateGraphql);
const octokit = new MyOctokit({ auth: 'your-token' });

async function fetchAllIssues() {
  const query = `
    query($cursor: String) {
      repository(owner: "owner", name: "repo") {
        issues(first: 100, after: $cursor) {
          nodes {
            title
            number
          }
          pageInfo {
            endCursor
            hasNextPage
          }
        }
      }
    }
  `;

  const issues = await octokit.paginateGraphql(query);
  console.log(issues);
}

fetchAllIssues();

Other packages similar to @octokit/plugin-paginate-graphql

Keywords

FAQs

Package last updated on 04 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc