Skip to content

Commit 626261f

Browse files
committed
add custom namespace
1 parent e546aac commit 626261f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

spec/Section 7 -- Response.md

+37
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,43 @@ 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+
{
55+
"customNamespace" : {
56+
"requestRate": 2,
57+
"remaining": 98,
58+
"retryAfterMs": 0,
59+
"resetAfterMs": 1985
60+
}
61+
}
62+
}
63+
}
64+
```
65+
Please note replace `customNamespace` with your customization.
66+
3067
To ensure future changes to the protocol do not break existing services and
3168
clients, the top level response map must not contain any entries other than the
3269
three described above.

0 commit comments

Comments
 (0)