GraphQL Admin API (2026-04): metaobjectUpdate fails with 128KB size limit error, but works via Shopify Admin UI

GraphQL Admin API (2026-04): metaobjectUpdate fails with 128KB size limit error, but works via Shopify Admin UI

Hi everyone,

I am encountering an issue when trying to update a metaobject field using the GraphQL Admin API (version 2026-04). The API call fails with a validation error regarding the value size, but I can update the exact same data successfully through the Shopify Admin UI.

The Problem

When I send a mutation to update a field in my metaobject, the API returns a userErrors message saying the value exceeds the maximum size of 131,072 bytes (128 KB). However, the system claims the current size is around 317,389 bytes, which is confusing because the actual payload I am sending in this request is extremely small.

Moreover, if I copy and paste the target data directly into the Shopify Admin UI backend manually, it saves perfectly without any errors.

My GraphQL Mutation

mutation UpdateMetaobject(\(id: ID!,\)metaobject: MetaobjectUpdateInput!) {
  metaobjectUpdate(id: \(id, metaobject:\)metaobject) {
    metaobject {
      id
      handle
    }
    userErrors {
      field
      message
      code
    }
  }
}

Variables Passed

{
  "id": "gid://shopify/Metaobject/93662478560",
  "metaobject": {
    "fields": [
      {
        "key": "spins",
        "value": "[{\"name\":\"v2__BBA0004__Asscher__YG\",\"timestamp\":1779435185730,\"count\":160}]"
      }
    ]
  }
}

API Response / Error

{
  "data": {
    "metaobjectUpdate": {
      "metaobject": null,
      "userErrors": [
        {
          "field": [
            "metaobject"
          ],
          "message": "Value exceeds the maximum size of 131072 bytes. Current size is 317389 bytes.",
          "code": "INVALID"
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 10,
      "actualQueryCost": 10,
      "throttleStatus": {
        "maximumAvailable": 4000,
        "currentlyAvailable": 3990,
        "restoreRate": 200
      }
    }
  }
}

Screenshots / Proof

Here are the relevant screenshots showing the contrast between the API error and the successful manual update in the Admin UI:


Questions

  1. Why does the API calculate the current size as 317,389 bytes when the value in my variable is just a tiny JSON string? Is it appending the data instead of replacing it, or is it validating the total size of the entire metaobject?
  2. Why does the Shopify Admin UI bypass or handle this limit differently than the GraphQL Admin API?
  3. How can I resolve this size validation issue via the API?

Any insights or workarounds would be greatly appreciated. Thank you!

Hello @baymax9603

I have done it with Shopify GraphiQL app.

See the screenshots.

And here is the fetched metaobject after update.

Can you share the code snippet with me? Can you share the code snippet with me so that i can check if code is somehow passing external string as the value.

Thanks

Hello @enumbin, thanks so much for looking into this.

I switched the GraphQL Admin API version from 2026-04 to an earlier version, such as 2026-01, and then I was able to update the metafield successfully.

I think this may be related to Shopify’s recent adjustment to JSON field size limits:

Apps using JSON fields before April 1, 2026 will be grandfathered at the current 2MB limit. New apps requiring >128KB JSON fields may request an exception via this form.

Reference: Shopify Metafield type size limits

## Mutation
mutation UpdateMetaobject($id: ID!, $metaobject: MetaobjectUpdateInput!) {
  metaobjectUpdate(id: $id, metaobject: $metaobject) {
    metaobject {
      id
      handle
    }
    userErrors {
      field
      message
      code
    }
  }
}
## Variables
{
  "id": "gid://shopify/Metaobject/93662478560",
  "metaobject": {
    "fields": [
      {
        "key": "spins",
        "value": "[{\"name\":\"v2__BBA0004__Asscher__YG\",\"timestamp\":1779435185730,\"count\":160}]"
      }
    ]
  }
}