Skip to content

Commit

Permalink
added rate limit to the PR query
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich committed Apr 15, 2024
1 parent 7084c14 commit 8787c53
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/github/queries/PullRequestList.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@ query PullRequests($cursor: String, $owner: String!, $repo: String!) {
}
}
}
rateLimit {
limit
remaining
used
resetAt
}
}
2 changes: 2 additions & 0 deletions src/github/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
IssueNode,
PageInfoQuery,
PullRequestNode,
RateLimitsQuery,
} from "./types";

interface PullRequestList {
Expand All @@ -16,6 +17,7 @@ interface PullRequestList {
pageInfo: PageInfoQuery;
};
};
rateLimit: RateLimitsQuery
}

interface IssueList {
Expand Down
7 changes: 7 additions & 0 deletions src/github/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8787c53

Please sign in to comment.