Closed ozzyonfire closed 2 years ago
I'm fine with adding that info in the limits
object that is emitted as an argument of the 'callGraphqlLimits'
event. It should be very easy to do that. Feel free to open a PR.
@ozzyonfire i think https://github.com/MONEI/Shopify-api-node/issues/451 is related, as well as #490.
Is there any way to get the requested and actual query costs back?
When running a graphQL query natively we get back an "extensions" object, like so:
I understand that we get the throttle status back from the
shopify.on('callLimits', (limits) => console.log(limits));
but limits only contains restoreRate, current, remaining and max.I'd like to be able to create a throttling function that will wait for the required number of seconds. For example, if I know my query is going cost 502, and my available cost is 498, then with a restore rate of 50, I only have to wait for 1 second. However, without knowing what the cost of my query will be, I can't properly throttle my requests.
Thanks, keep up the great work on the library!