Skip to content

Commit 92a2287

Browse files
🐛 Fix: add GraphQL rate limit error type RATE_LIMIT (#272)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent daec39c commit 92a2287

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

githubkit/graphql/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ def parse_graphql_response(
5757
# https://docs.github.com/en/graphql/overview/rate-limits-and-node-limits-for-the-graphql-api#exceeding-the-rate-limit
5858
# x-ratelimit-remaining may not be 0, ignore it
5959
# https://github.com/octokit/plugin-throttling.js/pull/636
60-
if any(error.type == "RATE_LIMITED" for error in response_data.errors):
60+
# error.type may be RATE_LIMIT or RATE_LIMITED
61+
# https://github.com/yanyongyu/githubkit/issues/271
62+
# https://github.com/octokit/plugin-throttling.js/issues/824
63+
if any(
64+
error.type in ("RATE_LIMIT", "RATE_LIMITED")
65+
for error in response_data.errors
66+
):
6167
raise PrimaryRateLimitExceeded(
6268
response, self._github._extract_retry_after(response)
6369
)

0 commit comments

Comments
 (0)