From 3c0b2c5f01cd18291b4aa47ccb41ec551510be07 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Mon, 19 Jan 2026 15:29:37 +0800 Subject: [PATCH 1/2] :bug: Update rate limit error handling in GraphQL API --- githubkit/graphql/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/githubkit/graphql/__init__.py b/githubkit/graphql/__init__.py index 415ee5686..96ca0d3a1 100644 --- a/githubkit/graphql/__init__.py +++ b/githubkit/graphql/__init__.py @@ -57,7 +57,10 @@ def parse_graphql_response( # https://docs.github.com/en/graphql/overview/rate-limits-and-node-limits-for-the-graphql-api#exceeding-the-rate-limit # x-ratelimit-remaining may not be 0, ignore it # https://github.com/octokit/plugin-throttling.js/pull/636 - if any(error.type == "RATE_LIMITED" for error in response_data.errors): + # error.type may be RATE_LIMIT or RATE_LIMITED + # https://github.com/yanyongyu/githubkit/issues/271 + # https://github.com/octokit/plugin-throttling.js/issues/824 + if any(error.type in ("RATE_LIMIT", "RATE_LIMITED") for error in response_data.errors): raise PrimaryRateLimitExceeded( response, self._github._extract_retry_after(response) ) From 8b21f21ec734d9ec70f3722da7fc971d0c5e6dd5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 07:31:25 +0000 Subject: [PATCH 2/2] :rotating_light: auto fix by pre-commit hooks --- githubkit/graphql/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/githubkit/graphql/__init__.py b/githubkit/graphql/__init__.py index 96ca0d3a1..79d7740d6 100644 --- a/githubkit/graphql/__init__.py +++ b/githubkit/graphql/__init__.py @@ -60,7 +60,10 @@ def parse_graphql_response( # error.type may be RATE_LIMIT or RATE_LIMITED # https://github.com/yanyongyu/githubkit/issues/271 # https://github.com/octokit/plugin-throttling.js/issues/824 - if any(error.type in ("RATE_LIMIT", "RATE_LIMITED") for error in response_data.errors): + if any( + error.type in ("RATE_LIMIT", "RATE_LIMITED") + for error in response_data.errors + ): raise PrimaryRateLimitExceeded( response, self._github._extract_retry_after(response) )