Rate Limiting GraphQL APIs by Calculating Query Complexity - Shopify
Jun 22, 2021

Summary
This post introduces a calculated query cost method for rate limiting Shopify's GraphQL Admin API. It details how query costs are defined for different GraphQL types (objects, scalars, enums, connections, interfaces, unions, mutations) based on the data requested and potential server load. It also explains how query cost information is returned in API responses and the difference between requested and actual query costs, with a focus on measuring the effectiveness of this model through the correlation between query complexity and execution time.