nit: add rate limit extension example
Add Rate Limit Extension Example
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: sbilello / name: Sergio Bilello (3fba5918c7f4e89da73b9cbd481acf082d21ceec)
Deploy Preview for graphql-spec-draft ready!
| Name | Link |
|---|---|
| Latest commit | 3fba5918c7f4e89da73b9cbd481acf082d21ceec |
| Latest deploy log | https://app.netlify.com/sites/graphql-spec-draft/deploys/674909900080ff000850bb66 |
| Deploy Preview | https://deploy-preview-1125--graphql-spec-draft.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
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 rateLimit might be confused by some tooling with a different rateLimit format and result in errors. Instead: sb_rateLimit would be safer, or even extensions:{sb:{rateLimit:{...}}}.
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? Thanks
I'm not convinced that the GraphQL spec needs an example of using the extensions property. I'll leave this open in case others feel otherwise.
Thanks, @benjie! I fixed the json validation.
I wanted to add an example to make sure that developers are aware about the difference between extensions for errors and extensions for not errors