Octokit plugin to paginate GraphQL Query responses
Browsers |
Load <script type="module">
import { Octokit } from "https://cdn.pika.dev/@octokit/core";
import { paginateGraphql } from "https://cdn.pika.dev/@octokit/plugin-paginate-graphql";
</script> |
---|---|
Node |
Install with const { Octokit } = require("@octokit/core");
const { paginateGraphql } = require("@octokit/plugin-paginate-graphql"); |
const MyOctokit = Octokit.plugin(paginateGraphql);
const octokit = new MyOctokit({ auth: "secret123" });
const query = `query repositoryIssues($owner:String!,$repo:String!,$since:DateTime!) {
repository(owner:$owner,name:$repo) {
issues(first:100, filterBy:{since:$since}) {
nodes {
number
title
}
}
}
}`;
const {
repository: {
issues: { nodes: issues }
}
} = await octokit.paginate(query, {
owner: "octocat",
repo: "hello-world",
since: "2019-10-01T00:00:00.000Z"
});
See CONTRIBUTING.md