4 ms·
In my experience one of the hardest parts of dealing with APIs is sticking within their rate limits. I would expect concurrent API requests made via GraphQL to
by simonw 8y ago
In my experience one of the hardest parts of dealing with APIs is sticking within their rate limits.
I would expect concurrent API requests made via GraphQL to make this worse - since it's very easy to accidentally construct a GraphQL query which results in a flurry of API requests under the hood.
How are you handling this? Are you doing your own internal rate-limiting, or are modern APIs more generous with their limits than they used to be?
- sgrove 8y agoLong story short, we give you a way to declare what rate-limiting strategy you want. - You can tell us to immediately fail the whole query right away, - Fail just that sub-part of the query - Back off for that API and try again (delaying your overall query but now you don't have to deal with the failure/rate limit case at all) - Potentially do this for all requests across your app, queuing up the api requests to the service that's rate-limited so that you don't have to worry about reasoning locally/globally about rate-limits. We've found this is the level that developer usually feel comfortable thinking about the trade-offs, rather than in the nitty-gritty implementation steps.
- simonw 8y agoThat's a great answer, thanks. You've clearly thought very hard about this problem.