Skip to content

Shopify Dude Fix

Shopify Automated Collection Integer Rules Fail on 2027-01? Use metafieldInt

Shopify removes metafieldInteger collection conditions in 2027-01. Switch to metafieldInt, pass string values, and verify collection membership.

Quick answer: When an Admin GraphQL collection integration moves to 2027-01, replace metafieldInteger conditions with metafieldInt. The integer comparison value must now be a string, such as "2000", not the number 2000. Update both mutation inputs and read-side inline fragments.
On this page

Why the old rule fails

Shopify announced this breaking change on October 1, 2026. It removes CollectionSourceInclusionConditionInput.metafieldInteger, the corresponding update input and the CollectionSourceInclusionConditionMetafieldInteger read types in 2027-01. The replacement aligns collection condition values with metafield values exposed as strings in the Storefront API. The comparison relations EQUALS, GREATER_THAN and LESS_THAN are unchanged.

Change the input and the output

# Old condition
conditionsToCreate: [{
  metafieldInteger: {
    definitionId: "gid://shopify/MetafieldDefinition/1"
    relation: GREATER_THAN
    value: 2000
  }
}]

# New condition
conditionsToCreate: [{
  metafieldInt: {
    definitionId: "gid://shopify/MetafieldDefinition/1"
    relation: GREATER_THAN
    value: "2000"
  }
}]

# Updated read-side fragment
... on CollectionSourceInclusionConditionMetafieldInt {
  relation
  value
}

These are condition fragments, not complete mutations. Use the documented collection operation and its enclosing input structure. Update generated types, serializers and any comparison-value validation. A metafield definition must still be appropriate for collection conditions; changing a field name does not create or configure the definition. Shopify says the new input can be tested on 2026-10 before upgrading, which is useful for a staged rollout.

Common misunderstanding: A string-valued condition does not mean Shopify changed the underlying integer metafield into text or that comparisons become alphabetical. This is an API input shape change; verify the actual membership behavior with boundary values.

How to test this

  1. Identify every collection rule using an integer metafield and record current product membership.
  2. Change inputs to metafieldInt and stringify the threshold, while keeping the same metafield definition ID and relation.
  3. Run the mutation on a development shop using 2026-10, then read the condition back through the new fragment.
  4. Check products below, equal to and above the threshold, including products missing the metafield.
  5. Run schema validation against 2027-01 and confirm no legacy input or fragment types remain.