Metafield gid keeps changing!

Hi guys I am using :

{
product(id: “gid://shopify/Product/6806329950293”) {
availablePublicationCount

metafields(first: 5) {
edges {
node {
id
key
value
description
}
}
}

}
}

And the gid for the metafield keeps changing!:

“metafields”: {
“edges”: [
{
“node”: {
“id”: “gid://shopify/Metafield/20662215409749”,

This is obviously making it impossible for me to perform Product Update mutations!

I am not sure what is causing this gid for the metafields to change randomly… its done it about 3 times now throughout the day.

Surely once that metafield is created the gid is set in stone!?

Hi,

To update a product metafield, here is normally what should be done:

  1. Get the products metafields filter it by namespace and/or key
  2. Once you get the correct metafield (filtered by key and namespace), then use the gid of that metafield to do the update

Lol wow.

OK.. Is there some good reason for having constantly random changing gid’s for metafields.? This has just made the process of updating a few thousand products with hundreds of metafields 10 times harder :disappointed_face:

Oh well,

I don’t know, shopify has designed it that way.