Fixed it by switching to looping through metaobject using the paginate tag, to increase the limit to over 50.
I feel like this is vastly more inefficient than getting the metaobject entries by their unique handle, so I hope the limit for this is increased in the future.
I also figured out, that the error message was misleading. While it contained a reference to the metaobject I was querying when the error appeared, it seems to be a global limit of 20 unique handle lookups. Doesn’t matter if those are for metaobjects or also metafields.
With New pagination limits for Liquid & Storefront GraphQL API - Shopify developer changelog the upper limit might be at 25k.
With `.values_count` the pagination limit can be dynamically set to the amount of metaobject entries.
Resources:
- Make Metaobjects available in paginate - #7 by teamdijon - Custom Data - Shopify Developer Community Forums
- Using Metaobjects. Cannot access more than 50 entries in theme.
- Unlimited Metaobject Output: Solving the Loop Limit in Shopify Liquid
- Using Metaobjects. Cannot access more than 50 entries in theme.