-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nit: add rate limit extension example #1125
base: main
Are you sure you want to change the base?
Conversation
|
✅ Deploy Preview for graphql-spec-draft ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Generally it's good practice to namespace the top fields in extensions to avoid conflicts, since the meaning is effectively granted to them by the entire ecosystem as a whole with no real governing documents/registry. For example, this Out of interest, what motivated this addition in particular? |
@benjie I've revised the example to better demonstrate how developers can implement rate-limiting using the extensions. Could you take a look please? |
spec/Section 7 -- Response.md
Outdated
{ | ||
"customNamespace" : { | ||
"requestRate": 2, | ||
"remaining": 98, | ||
"retryAfterMs": 0, | ||
"resetAfterMs": 1985 | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't valid JSON since it had {{ ... }}
{ | |
"customNamespace" : { | |
"requestRate": 2, | |
"remaining": 98, | |
"retryAfterMs": 0, | |
"resetAfterMs": 1985 | |
} | |
} | |
"customNamespace": { | |
"requestRate": 2, | |
"remaining": 98, | |
"retryAfterMs": 0, | |
"resetAfterMs": 1985 | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
I'm not convinced that the GraphQL spec needs an example of using the |
Thanks, @benjie! I fixed the json validation. |
Add Rate Limit Extension Example