admin管理员组

文章数量:1122846

I'm trying to understand GitHub's GraphQL API, and I'm wondering if the response for a mutation request counts towards GitHub's rate limitations? According to the Secondary Rate Limitations, mutation requests count as 5 points and non-mutation requests (so query requests?) as 1 point. GraphQL requests are alotted 2000 points. I'd like to know if, for example, the following request would count as 5 points or 6 points.

mutation addIssue($input: CreateIssueInput!) {
  createIssue(input: $input) {
    issue {
      id
    }
  }
}

I'm new to GraphQL in general, and welcome any feedback.

I'm trying to understand GitHub's GraphQL API, and I'm wondering if the response for a mutation request counts towards GitHub's rate limitations? According to the Secondary Rate Limitations, mutation requests count as 5 points and non-mutation requests (so query requests?) as 1 point. GraphQL requests are alotted 2000 points. I'd like to know if, for example, the following request would count as 5 points or 6 points.

mutation addIssue($input: CreateIssueInput!) {
  createIssue(input: $input) {
    issue {
      id
    }
  }
}

I'm new to GraphQL in general, and welcome any feedback.

Share Improve this question edited Nov 22, 2024 at 15:58 BobDidley asked Nov 21, 2024 at 20:23 BobDidleyBobDidley 1691 silver badge10 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I think you're mixing the various rate limits, which are calculated separately.

From the docs (emphasis mine):

Some secondary rate limits are determined by the point values of requests. For GraphQL requests, these point values are separate from the point value calculations for the primary rate limit.

So then for this request:

mutation addIssue($input: CreateIssueInput!) {
  createIssue(input: $input) {
    issue {
      id
    }
  }
}
  1. Primary rate limit (5,000 points / hour): you're down to 4,999 points for this hour
  2. too many concurrent requests (100 concurrent): don't do more than 99 more of these at the same time
  3. too many requests to a single endpoint (2,000 points / minute): you're down to 1,995 points for this minute.
  4. ...etc

See Calculating points for the secondary rate limit

本文标签: Does Mutation Response Data Count As Query Points in GitHub GraphQL APIStack Overflow