Dynamic complexity cost for `metafieldsSet` mutation
- Announced
- Tags
- GraphQL-Admin-API
- Severity
- info, set by
reef/rss-rule-v1 - Source
- https://shopify.dev/changelog/dynamic-complexity-cost-for-metafieldsset-mutation
The metafieldsSet mutation now uses dynamic complexity costing. Instead of a flat cost for every call, a request's cost reflects how many distinct resources metafields were changed. Most apps need no changes, as updating a single resource remains cheap. Apps setting many metafields across many different owners may hit their rate limit faster. Apps are encouraged to batch metafield writes by distinct resource.
What changed
Previously, every metafieldsSet call cost a flat 10 api points, regardless of how many metafields or resources it touched.
Now the cost is calculated as follows:
Cost = base cost (10) + the sum of the costs for each distinct resource owner type in your mutation.
For each distinct resource owner type, the cost is (the number of distinct resources of that type * weight of that owner type)
| Owner type | Weight | |
The text above is the source's. reef added the severity, the dates it could read from the text, and the endpoints and scopes named in code.