metafieldsSet Mutation Issue

metafieldsSet Mutation Issue

ailema
Shopify Partner
2 0 0

It is the expected behavior that if I send two metafields with the same namespace, key and owner type but different types, one of type integer (deprecated types) and one of type number_integer, only the one of type number_integer is created, when the response of the mutation metafieldsSet tells me that both have been created?

Mutation:

{
    "metafields": [
        {
            "namespace" : "testing",
            "key" : "type_integer",
            "value" : "23",
            "type" : "integer",
            "ownerId": "gid://shopify/Product/ID"
        },
        {
            "namespace" : "testing",
            "key" : "type_integer",
            "value" : "13",
            "type" : "number_integer",
            "ownerId": "gid://shopify/Product/ID"
        }
    ]
  
}

Response:

{
    "data": {
        "metafieldsSet": {
            "userErrors": [],
            "metafields": [
                {
                    "id": "gid://shopify/Metafield/21359648276678",
                    "type": "integer",
                    "namespace": "testing",
                    "key": "type_integer",
                    "value": "23"
                },
                {
                    "id": "gid://shopify/Metafield/21359648276678",
                    "type": "number_integer",
                    "namespace": "testing",
                    "key": "type_integer",
                    "value": "13"
                }
            ]
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 10,
            "actualQueryCost": 10,
            "throttleStatus": {
                "maximumAvailable": 1000,
                "currentlyAvailable": 990,
                "restoreRate": 50
            }
        }
    }
}

 

Replies 0 (0)