Can I add field definitions for our metafields to remove 'valueType' deprecation warning?

Got message on our store “A developer needs to update your custom apps and/or admin webhooks” We don’t have any apps, just a theme that dates from 2015, so to discover the problem, I used curl to call admin/api/2022-04/deprecated_api_calls.json and got “api_type”:“REST”,“description”:“Metafield.valueType has been removed. See Metafield.type for type information.” We do have two product metafields, so presumably, I need to change “valueType” to “type” for our two metafields?

One way I think I could do this is to use GraphQL and mutation with metafieldsSet. An easier way seems to be using the GUI in the store’s admin: Settings → Custom Data ->Products → Metafields without a definition. There I see our two metafields global.Subtitle1 and global.Subtitle2.

For each field I need to provide a Name, Description and Type. I think I can provide the name and description easily and the Type would be Single line text. My question is will this update the definition behind the scenes for our existing products from valueType to Type and remove the deprecation warning? Thanks!

Hi Merecat,

Adding a type should update the definition to use type instead of valueType. Before you do use via the settings > custom data panel, how are you currently using the product metafields? If you’re using the type field of these metafields for something in particular (like a third-party integration) there could be some disruption - however it does sound like this property is currently blank?

Hope this helps,

1 Like

Thanks for your response, that gives me confidence! I’m not using the type for anything, but it’s not exactly blank either. I’m setting it to “string” because I thought a type was required. An actual example: I’m populating two metafields for each product via a json file uploaded with curl. The fields I’m using are: namespace (“global”), key (“Subtitle1”), value (“The Lost Recitals”), value_type (“string”). In the store these metafields provide additional descriptive information about the product; not every product needs or has metafields. The Liquid is {{ product.metafields.global.Subtitle1 }} In the future I will change the “value_type” to “type” in my json file, although setting the type may not even be necessary. Thanks! --Tony