"Subject can't be blank" error on menuUpdate mutation

Graphql Admin API version 2025-10. Using Shopify GraphiQL App to run the following GraphQL mutation with the described variables:

mutation UpdateMenu($id: ID!, $title: String!, $handle: String!, $items: [MenuItemUpdateInput!]!) {
  menuUpdate(id: $id, title: $title, handle: $handle, items: $items) {
    menu {
      id
      handle
      items {
        id
        title
        items {
          id
          title
        }
      }
    }
    userErrors {
      message
      code
      field
    }
  }
}
{
  "id": "gid://shopify/Menu/12345678",
  "title": "Main menu",
  "handle": "main-menu",
  "items": [
    {
      "id": "gid://shopify/MenuItem/12345678",
      "title": "Home",
      "type": "FRONTPAGE",
      "items": []
    },
    {
      "id": "gid://shopify/MenuItem/12345678",
      "title": "Catalog",
      "type": "CATALOG",
      "items": []
    },
    {
      "id": "gid://shopify/MenuItem/12345678",
      "title": "Sitemap",
      "type": "HTTP",
      "items": []
    }
  ]
}

Response:

{
  "data": {
    "menuUpdate": {
      "menu": null,
      "userErrors": [
        {
          "message": "Subject can't be blank",
          "code": null,
          "field": null
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 12,
      "actualQueryCost": 10,
      "throttleStatus": {
        "maximumAvailable": 2000,
        "currentlyAvailable": 1990,
        "restoreRate": 100
      }
    }
  }
}

According to the Shopify admin graphql api, there is no field called subject in menuUpdate mutation

Thanks in advance.

Hey @Md_Maruf_Ahmed! This is expected behavior, when you use type: "HTTP" for a menu item, the url field is required. The “Subject can’t be blank” error message is a bit misleading (it should really say something about the URL being required), but it’s the API’s way of telling you the HTTP-type item needs a URL.

Looking at your variables, your “Sitemap” item is missing the url field:

{
  "id": "gid://shopify/MenuItem/12345678",
  "title": "Sitemap",
  "type": "HTTP",
  "url": "/pages/sitemap",  // Add this (for example)
  "items": []
}

The other types like FRONTPAGE and CATALOG work without a URL because they reference internal Shopify pages. But HTTP type items need you to specify where they should link to.

Check out the menuUpdate mutation docs for more examples - you’ll see all the HTTP-type items in those examples include a url field.

Let me know if you have any other questions!

1 Like