GraphQL API cost calculation

Tourist
5 0 2

I think it would be really helpful for developers to know how the GraphQL API calculates its cost. It's practically impossible to build clients that manage rate limiting without knowing the requestQueryCost before making the request. The GitHub GraphQL developer documentation provides this calculation so I think it's a reasonable expectation for developers to have this.

2 Likes
Shopify Staff
Shopify Staff
918 55 124

Hey @Anthonator ,

 

I completely understand what you mean, and I'm on board with this idea and will bring it up internally. I also want to mention though it's not quite as simple on Shopify as it is for GitHub, judging by their documentation it seems as though they assume that every resource has a cost of 1 when performing a query. 

 

Not every resource or mutation on Shopify has the same cost though, so there's an additional layer of complexity involved and it wouldn't just be a simple case of addition and multiplication to estimate a query's cost. 

0 Likes
Tourist
5 0 2

Thanks for bringing this up internally. This is going to be important for client developers to effectively manage rate limiting.

 

Keep us posted!

0 Likes