Skip to content

Commit 6c60617

Browse files
authored
Merge pull request #40052 from github/repo-sync
Repo sync
2 parents 420569e + d87dc33 commit 6c60617

File tree

5 files changed

+147
-122
lines changed

5 files changed

+147
-122
lines changed

content/admin/overview/setting-up-a-trial-of-github-enterprise-cloud.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ To set up a trial, you must be signed in to a personal account. If you don't hav
2929
The trial lasts for **{% data reusables.enterprise.ghec-trial-length %} days** and includes the following features.
3030

3131
* Access to **most** {% data variables.product.prodname_ghe_cloud %} features.
32-
* {% data variables.copilot.copilot_for_business %} ({% data variables.product.prodname_dotcom_the_website %} trials only)
32+
* {% data variables.copilot.copilot_for_business %}
3333
* {% data variables.product.prodname_GH_cs_and_sp %} ({% data variables.product.prodname_dotcom_the_website %} trials only)
3434
* Access to the **new billing platform**.{% ifversion enhanced-billing-platform %} See [AUTOTITLE](/billing/using-the-new-billing-platform/about-the-new-billing-platform-for-enterprises).{% endif %}
3535
* An **enterprise account**, which allows you to manage multiple organizations. See [AUTOTITLE](/enterprise-cloud@latest/get-started/learning-about-github/types-of-github-accounts).

content/graphql/guides/using-pagination-in-the-graphql-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ In this example, `pageInfo.startCursor` gives the cursor for the first item on t
4646

4747
## Changing the number of items per page
4848

49-
The `first` and `last` arguments control how many items are returned. The maximum number of items you can fetch using the `first` or `last` argument is 100. You may need to request fewer than 100 items if your query touches a lot of data in order to avoid hitting a rate or node limit. For more information, see [AUTOTITLE](/graphql/overview/rate-limits-and-node-limits-for-the-graphql-api).
49+
The `first` and `last` arguments control how many items are returned. The maximum number of items you can fetch using the `first` or `last` argument is 100. You may need to request fewer than 100 items if your query touches a lot of data in order to avoid hitting a rate or node limit. For more information, see [AUTOTITLE](/graphql/overview/rate-limits-and-query-limits-for-the-graphql-api).
5050

5151
## Traversing the data set using pagination
5252

content/graphql/overview/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ children:
1111
- /breaking-changes
1212
- /changelog
1313
- /explorer
14-
- /rate-limits-and-node-limits-for-the-graphql-api
14+
- /rate-limits-and-query-limits-for-the-graphql-api
1515
---
1616

content/graphql/overview/rate-limits-and-node-limits-for-the-graphql-api.md renamed to content/graphql/overview/rate-limits-and-query-limits-for-the-graphql-api.md

Lines changed: 143 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
2-
title: Rate limits and node limits for the GraphQL API
3-
shortTitle: Rate and node limits
2+
title: Rate limits and query limits for the GraphQL API
3+
shortTitle: Rate and query limits
44
intro: 'The {% data variables.product.prodname_dotcom %} GraphQL API has limitations in place to protect against excessive or abusive calls to {% data variables.product.prodname_dotcom %}''s servers.'
55
redirect_from:
66
- /v4/guides/resource-limitations
77
- /graphql/overview/resource-limitations
8+
- /graphql/overview/rate-limits-and-node-limits-for-the-graphql-api
89
versions:
910
fpt: '*'
1011
ghec: '*'
@@ -13,122 +14,6 @@ topics:
1314
- API
1415
---
1516

16-
## Node limit
17-
18-
To pass [schema](/graphql/guides/introduction-to-graphql#schema) validation, all GraphQL API [calls](/graphql/guides/forming-calls-with-graphql) must meet these standards:
19-
20-
* Clients must supply a `first` or `last` argument on any [connection](/graphql/guides/introduction-to-graphql#connection).
21-
* Values of `first` and `last` must be within 1-100.
22-
* Individual calls cannot request more than 500,000 total [nodes](/graphql/guides/introduction-to-graphql#node).
23-
24-
### Calculating nodes in a call
25-
26-
These two examples show how to calculate the total nodes in a call.
27-
28-
1. Simple query:
29-
30-
<pre>query {
31-
viewer {
32-
repositories(first: <span class="redbox">50</span>) {
33-
edges {
34-
repository:node {
35-
name
36-
37-
issues(first: <span class="greenbox">10</span>) {
38-
totalCount
39-
edges {
40-
node {
41-
title
42-
bodyHTML
43-
}
44-
}
45-
}
46-
}
47-
}
48-
}
49-
}
50-
}</pre>
51-
52-
Calculation:
53-
54-
<pre><span class="redbox">50</span> = 50 repositories
55-
+
56-
<span class="redbox">50</span> x <span class="greenbox">10</span> = 500 repository issues
57-
58-
= 550 total nodes</pre>
59-
60-
1. Complex query:
61-
62-
<pre>query {
63-
viewer {
64-
repositories(first: <span class="redbox">50</span>) {
65-
edges {
66-
repository:node {
67-
name
68-
69-
pullRequests(first: <span class="greenbox">20</span>) {
70-
edges {
71-
pullRequest:node {
72-
title
73-
74-
comments(first: <span class="bluebox">10</span>) {
75-
edges {
76-
comment:node {
77-
bodyHTML
78-
}
79-
}
80-
}
81-
}
82-
}
83-
}
84-
85-
issues(first: <span class="greenbox">20</span>) {
86-
totalCount
87-
edges {
88-
issue:node {
89-
title
90-
bodyHTML
91-
92-
comments(first: <span class="bluebox">10</span>) {
93-
edges {
94-
comment:node {
95-
bodyHTML
96-
}
97-
}
98-
}
99-
}
100-
}
101-
}
102-
}
103-
}
104-
}
105-
106-
followers(first: <span class="bluebox">10</span>) {
107-
edges {
108-
follower:node {
109-
login
110-
}
111-
}
112-
}
113-
}
114-
}</code></pre>
115-
116-
Calculation:
117-
118-
<pre><span class="redbox">50</span> = 50 repositories
119-
+
120-
<span class="redbox">50</span> x <span class="greenbox">20</span> = 1,000 pullRequests
121-
+
122-
<span class="redbox">50</span> x <span class="greenbox">20</span> x <span class="bluebox">10</span> = 10,000 pullRequest comments
123-
+
124-
<span class="redbox">50</span> x <span class="greenbox">20</span> = 1,000 issues
125-
+
126-
<span class="redbox">50</span> x <span class="greenbox">20</span> x <span class="bluebox">10</span> = 10,000 issue comments
127-
+
128-
<span class="bluebox">10</span> = 10 followers
129-
130-
= 22,060 total nodes</pre>
131-
13217
## Primary rate limit
13318

13419
{% ifversion ghes %}
@@ -278,6 +163,126 @@ You should also subscribe to webhook events instead of polling the API for data.
278163

279164
You can also stream the audit log in order to view API requests. This can help you troubleshoot integrations that are exceeding the rate limit. For more information, see [AUTOTITLE](/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise).
280165

166+
{% endif %}
167+
168+
## Node limit
169+
170+
To pass [schema](/graphql/guides/introduction-to-graphql#schema) validation, all GraphQL API [calls](/graphql/guides/forming-calls-with-graphql) must meet these standards:
171+
172+
* Clients must supply a `first` or `last` argument on any [connection](/graphql/guides/introduction-to-graphql#connection).
173+
* Values of `first` and `last` must be within 1-100.
174+
* Individual calls cannot request more than 500,000 total [nodes](/graphql/guides/introduction-to-graphql#node).
175+
176+
### Calculating nodes in a call
177+
178+
These two examples show how to calculate the total nodes in a call.
179+
180+
1. Simple query:
181+
182+
<pre>query {
183+
viewer {
184+
repositories(first: <span class="redbox">50</span>) {
185+
edges {
186+
repository:node {
187+
name
188+
189+
issues(first: <span class="greenbox">10</span>) {
190+
totalCount
191+
edges {
192+
node {
193+
title
194+
bodyHTML
195+
}
196+
}
197+
}
198+
}
199+
}
200+
}
201+
}
202+
}</pre>
203+
204+
Calculation:
205+
206+
<pre><span class="redbox">50</span> = 50 repositories
207+
+
208+
<span class="redbox">50</span> x <span class="greenbox">10</span> = 500 repository issues
209+
210+
= 550 total nodes</pre>
211+
212+
1. Complex query:
213+
214+
<pre>query {
215+
viewer {
216+
repositories(first: <span class="redbox">50</span>) {
217+
edges {
218+
repository:node {
219+
name
220+
221+
pullRequests(first: <span class="greenbox">20</span>) {
222+
edges {
223+
pullRequest:node {
224+
title
225+
226+
comments(first: <span class="bluebox">10</span>) {
227+
edges {
228+
comment:node {
229+
bodyHTML
230+
}
231+
}
232+
}
233+
}
234+
}
235+
}
236+
237+
issues(first: <span class="greenbox">20</span>) {
238+
totalCount
239+
edges {
240+
issue:node {
241+
title
242+
bodyHTML
243+
244+
comments(first: <span class="bluebox">10</span>) {
245+
edges {
246+
comment:node {
247+
bodyHTML
248+
}
249+
}
250+
}
251+
}
252+
}
253+
}
254+
}
255+
}
256+
}
257+
258+
followers(first: <span class="bluebox">10</span>) {
259+
edges {
260+
follower:node {
261+
login
262+
}
263+
}
264+
}
265+
}
266+
}</code></pre>
267+
268+
Calculation:
269+
270+
<pre><span class="redbox">50</span> = 50 repositories
271+
+
272+
<span class="redbox">50</span> x <span class="greenbox">20</span> = 1,000 pullRequests
273+
+
274+
<span class="redbox">50</span> x <span class="greenbox">20</span> x <span class="bluebox">10</span> = 10,000 pullRequest comments
275+
+
276+
<span class="redbox">50</span> x <span class="greenbox">20</span> = 1,000 issues
277+
+
278+
<span class="redbox">50</span> x <span class="greenbox">20</span> x <span class="bluebox">10</span> = 10,000 issue comments
279+
+
280+
<span class="bluebox">10</span> = 10 followers
281+
282+
= 22,060 total nodes</pre>
283+
284+
{% ifversion not ghes %}
285+
281286
## Timeouts
282287

283288
If {% data variables.product.github %} takes more than 10 seconds to process an API request, {% data variables.product.github %} will terminate the request and you will receive a timeout response and a message reporting that "We couldn't respond to your request in time".
@@ -288,4 +293,24 @@ You can check the status of the GraphQL API at [githubstatus.com](https://www.gi
288293

289294
If a timeout occurs for any of your API requests, additional points will be deducted from your primary rate limit for the next hour to protect the speed and reliability of the API.
290295

296+
## Other resource limits
297+
298+
To protect the speed and reliability of the API, {% data variables.product.github %} also enforces other resource limitations. If your GraphQL query consumes too many resources, {% data variables.product.github %} will terminate the request and return partial results along with an error indicating that resource limits were exceeded.
299+
300+
**Examples of queries that may exceed resource limits:**
301+
302+
* Requesting thousands of objects or deeply nested relationships in a single query.
303+
* Using large `first` or `last` arguments in multiple connections simultaneously.
304+
* Fetching extensive details for each object, such as all comments, reactions, and related issues for every repository.
305+
291306
{% endif %}
307+
308+
## Query optimization strategies
309+
310+
* **Limit the number of objects**: Use smaller values for `first` or `last` arguments and paginate through results.
311+
* **Reduce query depth**: Avoid requesting deeply nested objects unless necessary.
312+
* **Filter results**: Use arguments to filter data and return only what you need.
313+
* **Split large queries**: Break up complex queries into multiple simpler queries.
314+
* **Request only required fields**: Select only the fields you need, rather than requesting all available fields.
315+
316+
By following these strategies, you can reduce the likelihood of hitting resource limits and improve the performance and reliability of your API requests.

data/reusables/enterprise/emus-trial-content.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
If you choose an {% data variables.enterprise.prodname_emu_enterprise %}, you will also choose whether to create an enterprise on {% data variables.product.prodname_dotcom_the_website %} or in a specific data residency region on {% data variables.enterprise.data_residency_site %}.
44

55
* Trials on **{% data variables.product.prodname_dotcom_the_website %}** include free access to {% data variables.copilot.copilot_for_business %} and {% data variables.product.prodname_GHAS %} features. Your enterprise will be hosted in the US.
6-
* Trials on **{% data variables.enterprise.data_residency_site %}** allow you to meet specific regulatory requirements and choose a unique subdomain for your enterprise. However, the trial won't include free access to {% data variables.copilot.copilot_for_business %} and {% data variables.product.prodname_GHAS %} features, or access to the currently unavailable features listed in [AUTOTITLE](/enterprise-cloud@latest/admin/data-residency/feature-overview-for-github-enterprise-cloud-with-data-residency#currently-unavailable-features).
6+
* Trials on **{% data variables.enterprise.data_residency_site %}** allow you to meet specific regulatory requirements and choose a unique subdomain for your enterprise. However, there are some features that are not included in the trial. See [AUTOTITLE](/enterprise-cloud@latest/admin/data-residency/feature-overview-for-github-enterprise-cloud-with-data-residency#currently-unavailable-features).

0 commit comments

Comments
 (0)