diff --git a/src/github/queries/PullRequestList.graphql b/src/github/queries/PullRequestList.graphql index 5544c7c..1f04a07 100644 --- a/src/github/queries/PullRequestList.graphql +++ b/src/github/queries/PullRequestList.graphql @@ -38,4 +38,10 @@ query PullRequests($cursor: String, $owner: String!, $repo: String!) { } } } + rateLimit { + limit + remaining + used + resetAt + } } diff --git a/src/github/repository.ts b/src/github/repository.ts index 2163791..c7810ba 100644 --- a/src/github/repository.ts +++ b/src/github/repository.ts @@ -6,6 +6,7 @@ import { IssueNode, PageInfoQuery, PullRequestNode, + RateLimitsQuery, } from "./types"; interface PullRequestList { @@ -16,6 +17,7 @@ interface PullRequestList { pageInfo: PageInfoQuery; }; }; + rateLimit: RateLimitsQuery } interface IssueList { diff --git a/src/github/types.ts b/src/github/types.ts index 23edde1..1b5c3d7 100644 --- a/src/github/types.ts +++ b/src/github/types.ts @@ -16,6 +16,13 @@ export interface PageInfoQuery { hasPreviousPage: boolean; } +export interface RateLimitsQuery { + limit: number, + remaining: number, + used: number, + resetAt: string +} + export interface PullRequestNode { title: string; number: number;