When using the productUpdate or productVariantsBulkUpdate mutation to update metafields, it would be amazing if we could set the value to null or empty string to remove the metafield. Right now it won’t allow you to do that, which doesn’t make sense because we can use these mutations to create metafields, but then we can’t remove them without using a different mutation.
I want to be able to edit these fields along with other fields while doing a bulk operation, so using the metafieldsDelete mutation doesn’t work for me.
Thanks for highlighting this feature request - I’ll flag this to the relevant team. In the meantime, can you describe in more detail the use-case this would unlock for you?
Thanks, this would allow my bulk edit app to easily support removing metafields. Currently the way it works it’s not possible since to remove them I would have to run a separate mutation. Since I use bulk operations for editing the metafields along with other fields, via productUpdate for example, it’s not possible to remove the metafields when reverting the task, for example without running multiple bulk operations. It’s strange that we can create metafields with this mutation but not remove them.
Here’s a use case we’ve run into and would also like to see this added. We use date metafields for ‘Next Shipment Arriving’ or ‘Expected Availability’ with out of stock products. The dates are always changing based on factories, tarrifs or shipping timelines. We have a date for most products, but sometimes things go wrong and we would rather null the field and display nothing than an incorrect date.
Use case:
We manage 5 metafields for different ‘Steps’. They are only populated when that Step is in use / set based on the users configuration.
We can set the metafield values and other variant values using productVariantsBulkUpdate.
When a user configures their product to use 2 steps, after the product was configured to use 5 steps, this leaves us with 3 metafields whose values need to be cleared.
It would be ideal to simply pass a null or empty string to clear those metafield values in the same mutation call as the 2 that need updating (productVariantsBulkUpdate).
Instead, we need to run productVariantsBulkUpdate and then an additional metafieldsDelete call to remove the 3 metafields that are not currently needed.