githubgraphql

Does Mutation Response Data Count As Query Points in GitHub GraphQL API?


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.


Solution

  • 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