fix: github rate limiter with multiple PATs

This commit is contained in:
anuraghazra
2020-07-15 14:59:25 +05:30
parent 2efb399f33
commit 3d8dea90e2
6 changed files with 78 additions and 25 deletions
+11 -6
View File
@@ -5,8 +5,9 @@ async function fetchRepo(username, reponame) {
throw new Error("Invalid username or reponame");
}
const res = await request({
query: `
const res = await request(
{
query: `
fragment RepoInfo on Repository {
name
stargazers {
@@ -33,11 +34,15 @@ async function fetchRepo(username, reponame) {
}
}
`,
variables: {
login: username,
repo: reponame,
variables: {
login: username,
repo: reponame,
},
},
});
{
Authorization: `bearer ${process.env.PAT_1}`,
}
);
const data = res.data.data;