Liquid connection to MetaObject not retrieve any info

Topic summary

A developer is unable to retrieve MetaObject data using Liquid in a Shopify theme, despite the MetaObjects (gemstone and nested birthstones) being accessible via hardcoded HTML in pages.

Key Issue:

  • All Liquid queries return 0 results: shop.metaobjects.gemstone.values, .nodes, and .all all show size of 0
  • The code attempts to loop through gemstone MetaObjects and display fields like name, primary_colour, source, and nested birthstone data
  • Debug output confirms MetaObjects aren’t being detected through Liquid

Suspected Cause:
The developer believes this may be a shop configuration issue—possibly related to permissions or MetaObject settings—rather than a code problem, since the same data displays when hardcoded in HTML.

Current Status:
The question remains unanswered. The developer is seeking advice from others who may have encountered similar MetaObject connection issues in Shopify Liquid templates.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

Tried so many ways to connect to the gemstone MetaObject & nested birthstones MetaObject - yet it states they both do not exist
After a lot of debugging, I focused on simple code to make the connection
The MetaObject reads from HTML hardcoded in pages, yet will not connect from liquid, leading me to believe there was a setting issue in the shop. Permissions or something…
I cannot upload screenshots to prove the setup.

Has anyone come across this problem before?
Please advise

<div style="background: #f1f1f1; padding: 20px;">
  <h3>Available Metaobjects:</h3>
    {% assign gemstone_metaobjects = shop.metaobjects.gemstone.all %}
    <ul>
       {% for gemstone in gemstone_metaobjects %}
          <li>{{ gemstone.fields.name.value }}
    </li>
    {% endfor %}
</ul>
</div>

{% comment %}Debug info - always give 0 as answer{% endcomment %}
<div style="background:#f8f8f8;padding:10px;margin:10px 0;border:1px solid #ddd;">
Values: {{ shop.metaobjects.gemstone.values | size }}
Nodes: {{ shop.metaobjects.gemstone.nodes | size }}
All: {{ shop.metaobjects.gemstone.all | size }}
</div>

{% assign gemstones = shop.metaobjects.gemstone.values %}

{% if gemstones.size < 0 %}
<h2>Available Gemstones</h2>
<ul>
{% for gemstone in gemstones %}
<li>
<strong>{{ gemstone.full_name.value }}</strong>
{% if gemstone.image.value != blank %}
<img src="{{ gemstone.image.value }}" alt="{{ gemstone.full_name.value }}" width="100">
{% endif %}
<p>Color: {{ gemstone.primary_colour.value }}</p>
<p>Source: {{ gemstone.source.value }}</p>
{% if gemstone.birthstone.value != blank %}
<p>Birthstone Month: {{ gemstone.birthstone.value.month.value }}</p>
<p>Tradition: {{ gemstone.birthstone.value.tradition.value }}</p>
{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
<p>No gemstones found. Check your metaobject configuration.</p>
{% endif %}

{% comment %}
Debug information
{% endcomment %}
<div style="background: #f1f1f1; padding: 10px; margin-top: 20px;">
<h3>Debug Info</h3>
<p>Metaobjects gemstone count: {{ shop.metaobjects.gemstone.values.size }}</p>
<p>First metaobject handle: {% if shop.metaobjects.gemstone.values.first %}{{ shop.metaobjects.gemstone.values.first.handle }}{% else %}None found{% endif %}</p>

<!-- Additional debug info -->
<h4>Metaobject Namespaces Available:</h4>
<ul>
{% for namespace in shop.metaobjects %}
<li>{{ namespace[0] }}</li>
{% endfor %}
</ul>
</div>