Core Issue:
Shopify Functions have a 10,000-byte limit for metafield values in input queries, causing metafields to return null when exceeding this threshold. This differs from online stores, where the same metafields display correctly and support up to 2 million characters for JSON types.
Key Findings:
The limitation is documented in Shopify Functions input-output specifications
One user cannot reproduce the issue on development stores, where large metafield values work fine
Functions handle metafields differently than the online store frontend
Proposed Workaround:
Split large JSON data across multiple metafields to stay under the 10KB limit per field
Caution: Each metafield read consumes 3 points toward the input query complexity limit of 30
Open Question:
How certain apps manage different inputs across multiple functions for various merchants, given these constraints.
Summarized with AI on October 25.
AI used: claude-sonnet-4-5-20250929.
When the metafield length reaches 10,000 characters, the metafield will not output any information (null will be displayed) as shown in the figure below.
But as far as I know, the json type metafield is limited to two million characters.
We edited the theme and used the same metafield in the online store and found that it can be displayed correctly.
We checked the documentation and did not find that the shopify function has any restrictions on metafields.
Currently having this same exact issue. I am not able to reproduce the same behaviour on a development store, where everything seems to work fine with large metafield values.
If you’re pulling in a big json blob from an external api into a metafield in order to do discounts based on that, and if the blob is bigger than 10k, can you just split it into multiple metafields to get around that?