Skip to content

Commit

Permalink
add custom namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
sbilello committed Nov 7, 2024
1 parent e546aac commit 626261f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions spec/Section 7 -- Response.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,43 @@ set, must have a map as its value. This entry is reserved for implementers to
extend the protocol however they see fit, and hence there are no additional
restrictions on its contents.

GraphQL Response for an extension with rate limit might look like this:

```json example
{
"data": {
"hero": {
"name": "R2-D2",
"heroFriends": [
{
"id": "1000",
"name": "Luke Skywalker"
},
{
"id": "1002",
"name": null
},
{
"id": "1003",
"name": "Leia Organa"
}
]
}
},
"extensions": {
{
"customNamespace" : {
"requestRate": 2,
"remaining": 98,
"retryAfterMs": 0,
"resetAfterMs": 1985
}
}
}
}
```
Please note replace `customNamespace` with your customization.

To ensure future changes to the protocol do not break existing services and
clients, the top level response map must not contain any entries other than the
three described above.
Expand Down

0 comments on commit 626261f

Please sign in to comment.