Skip to content

Commit 2aae014

Browse files
author
Sergio Bilello
committed
nit: add rate limit extension example
1 parent e546aac commit 2aae014

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

spec/Section 7 -- Response.md

+33
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,39 @@ set, must have a map as its value. This entry is reserved for implementers to
2727
extend the protocol however they see fit, and hence there are no additional
2828
restrictions on its contents.
2929

30+
GraphQL Response for an extension with rate limit might look like this:
31+
32+
```json example
33+
{
34+
"data": {
35+
"hero": {
36+
"name": "R2-D2",
37+
"heroFriends": [
38+
{
39+
"id": "1000",
40+
"name": "Luke Skywalker"
41+
},
42+
{
43+
"id": "1002",
44+
"name": null
45+
},
46+
{
47+
"id": "1003",
48+
"name": "Leia Organa"
49+
}
50+
]
51+
}
52+
},
53+
"extensions": {
54+
"rateLimit": {
55+
"requestRate": 2,
56+
"remaining": 98,
57+
"retryAfterMs": 0,
58+
"resetAfterMs": 1985
59+
}
60+
}
61+
}
62+
```
3063
To ensure future changes to the protocol do not break existing services and
3164
clients, the top level response map must not contain any entries other than the
3265
three described above.

0 commit comments

Comments
 (0)