Graphql
mutation UpdateMetafieldsForPage ($id: ID!,$page: PageUpdateInput!) {
pageUpdate(id: $id, page: $page) {
page {
id
title
body
handle
metafields(first: 250) {
edges {
node {
... MetafieldFields
}
}
}
}
userErrors {
field
message
}
}
}
fragment MetafieldFields on Metafield {
id
key
value
legacyResourceId
namespace
type
description
createdAt
updatedAt
}
Bug Description:
When using the pageUpdate mutation to update page attributes without specifying the body field, the body field is unexpectedly set to an empty string, even though the original page body (e.g., for the page gid://shopify/Page/111432794252) is not empty.
Observed Behavior:
- If the body field is omitted in the PageUpdateInput, the API overwrites it with an empty string instead of leaving it unchanged.
- This occurs regardless of the Shopify Admin API version used
Expected Behavior:
According to GraphQL best practices, omitting a non-required field in an update input should not alter its existing value. The body should retain its original content unless explicitly modified in the mutation.

