I was reading through this article https://shopify.dev/apps/metafields/types#metafield-value_type-deprecation regarding the metafields that are now marked as depreciated. I was wondering what will happen with those in the future? Will they always be compatible? Will there be a force migration at some point?
Can someone give pointers on this issue?
Hi @JonasKniel ,
There’s a huge number of older Shopify stores that rely on those metafields heavily, so it’s unlikely that Shopify would forcibly remove them. However, you should keep in mind that those metafields are slightly different, compared to the OS 2.0 metafields. You can learn more here. API-wise, they are different too: if you try creating a metafiled with a deprecated type using a never version of the API, it would result in an error.
2 Likes
@MetafieldsGuru I had the same hunch. I guess there would have to be a notification if something would be updated anyway. Thank you for your assessment.
1 Like
Hi @JonasKniel !
API Version 2021-07 introduced the new metafield property type in addition to valueType, and started logging warnings about using type. In API Version 2021-10, the original property type was fully removed in favor of valueType. This was indicated (perhaps unclearly) in our changelog; you can see this particular entry here: https://shopify.dev/changelog/online-store-2-0-new-metafields-type-system-and-dynamic-sources.
Our API Versioning document (https://shopify.dev/api/usage/versioning) indicates that API versions are supported for 12 months from their release. That means that on July 1, 2022 we’ll deprecate 2021-07, so any usages of type will start causing warnings logs to appear. But since type wasn’t fully removed until 2021-10, you’ll have just before October 1, 2022 before you need to update to using valueType.
When API versions reach their end of life, that doesn’t mean your API calls to that version will automatically break; they’ll be “failed forward” to the next oldest version, So after July 1, 2022, requests to API Version 2021-07 will fail forward to 2021-10, and on October 1, 2022 requests to either 2021-07 or 2021-10 would fail forward to API Version 2022-01.
Note that even when valueType is removed in favor type, your metafields themselves will not be deleted. It means that new write requests reference valueType will start to fail; read requests should continue to work but will not return the valueType property.
I would recommend you update away from valueType to type and update which API Version you use before these dates. You can read more about migrating metafields for both REST and GraphQLhere: https://shopify.dev/apps/metafields/types#migrate-your-metafields-in-the-rest-api.
3 Likes
@Bradley-Staff thanks a lot for the lengthy explanation ?