bug of shop.metaobjects with pagination API

Topic summary

A developer encountered an issue displaying product variant colors using metaobjects in a Shopify collection. The colors render correctly on the first page, but when loading a second page via AJAX, some colors fail to load or display incorrectly.

Root Cause Identified:
The issue stems from a Shopify API limitation—metaobjects are capped at 50 entries per page when using pagination.

Code Context:
The implementation uses shop.metaobjects to fetch color values and assigns them to product variants through a custom metafield (product.metafields.sp_custom.alternative_collection).

Status:
Resolved as a known platform limitation rather than a code bug. The developer confirmed this constraint through Shopify community documentation.

Summarized with AI on November 18. AI used: claude-sonnet-4-5-20250929.

Hi,

In collection I display colors of variants. To display different color I use metaobjects. Works fine till ajax load second page. Then some colors doesn’t load or show wrong color. How it is possible? Limitation, bug or something else?

{% assign alternative_products = collections[product.metafields.sp_custom.alternative_collection].products %} 
      

        {% for p in alternative_products %}
          
            {% assign parse_color = p.options_by_name['Color'].values[0] | handle %}
            {% assign stand_color = shop.metaobjects['product_color_swatch_options'][parse_color].color.value | image_url %}

            

          
        {% endfor %}
      

It is a limitation. Max 50 per page. https://community.shopify.com/c/shopify-design/using-metaobjects-cannot-access-more-than-50-entries-in-theme/m-p/1963918