Supported reference types
The schema supports the following reference types with full data normalization:Normalized reference shapes
Each reference type is normalized into a small, consistent object. Transport-only fields like__typename are always removed. The shape you receive depends on the type of referenced resource.
Metaobject references are resolved into a structure with the metaobject’s core identifiers and a key-value map of its fields:
Media image references (including
file_reference metafields that point to images) are normalized to:
Taxonomy value references are normalized to:
Video references are normalized to:
Structured metaobject field leaves
When a metaobject field uses one of Shopify’s structured types (money, weight, volume, dimension, or rating), Layers exposes the field’s scalar leaves as attribute paths instead of the raw object. Numeric leaves are indexed with numeric semantics, so filters and sort orders on them compare values as numbers.
The same leaves are available whether the metaobject field is a single value (money, weight, volume, dimension, rating) or a list (list.money, list.weight, list.volume, list.dimension, list.rating). The leaf path is identical in both cases.
Example: a
custom.badge metaobject reference with a price money field on the metaobject exposes:
metafields.custom.badge.fields.price.amount: filterable and sortable as a number.
List-valued leaves
Forlist.* structured fields, a single metaobject holds an array of values on that field. Filters match when any value in the list satisfies the condition. Facet counts include every value across the list. Sort orders collapse a product’s list to its minimum value in both asc and desc directions; use single-valued structured fields when you need a strict descending order.
Nested metaobject resolution
When a metaobject field references another metaobject (viametaobject_reference or list.metaobject_reference), Layers automatically resolves the nested reference from its local cache. This happens recursively up to 5 levels deep, with circular reference protection to prevent infinite loops.
This is useful for data models where metaobjects reference other metaobjects. For example, a “Product Spec” metaobject that references a “Material” metaobject, which in turn references a “Certification” metaobject.
Non-reference fields are returned as their plain values (strings, numbers, etc.). If a referenced metaobject is not found in the cache, the reference data from Shopify is still normalized into the standard shape.
Example: metaobject reference response
Example: list metaobject reference response
Example: media image reference response
Example: nested metaobject reference response
In this example, a product has a “material” metafield that references a Material metaobject, which itself has a “certification” field referencing a Certification metaobject:Metaobject data is resolved from a local cache that is kept in sync with Shopify via webhooks. If a referenced metaobject is not found in the cache, Layers normalizes the original reference data from Shopify’s GraphQL response into the standard shape, or falls back to the numeric ID if no reference data is available.