I created cart metafield using,
fetch('/api/unstable/graphql.json', {
method: 'post',
headers: {
'conent-type': 'application/json',
'x-shopify-storefront-access-token': 'hidden'
},
body: JSON.stringify({
query: `
mutation cartMetafieldsSet {
cartMetafieldsSet(metafields: [
{
ownerId: "gid://shopify/Cart/cart-token-with-key",
key: "your-key",
value: "your-value",
type: "single_line_text_field"
}
]) {
metafields {
id
namespace
}
userErrors {
field
message
}
}
}
`
})
})
metafield declaration in shopify.extension.toml
[[extensions.metafields]]
namespace = "$app"
key = "your-key"
my Checkout.tsx
const metafields = useAppMetafields({
namespace: '$app',
key: 'your-key',
type: 'cart'
})
And this returning empty array. I am using 2025-07 checkout ui version. Anything am I doing wrong? or cart metafield is just not available?