Where is valueType in MetafieldInput?

Keita_W
Tourist
4 0 4

Hello

"valueType" in MetafieldInput was lost?
https://shopify.dev/api/admin/graphql/reference/metafields/metafieldinput
now.png

I can see "valueType" in Google cache of the same page.
https://webcache.googleusercontent.com/search?q=cache:m3CXWtM7DncJ:https://shopify.dev/docs/admin-ap...
cache-image.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

What's happen??

Thank you.

iozyigit
Tourist
9 1 1

Says will depricate in new version of api but I am using 2021-04 and disappeared. I can't see "type' either.

"deprecationReason": "`valueType` is deprecated and replaced by `type` in API version 2021-07."
Screen Shot 2021-07-03 at 2.00.29 PM.png

0 Likes
jake___
Shopify Partner
2 0 0

Yep, can confirm. valueType has disappeared on MetafieldInput and Metafield objects. REST API docs are being displayed fine with a deprecation of 2021-07. In addition, these deprecation notices are not listed on https://shopify.dev/api/release-notes/2021-07, and they are also not causing warnings in App's API Health.

Moreover, changelog here states the deprecation will only happen in 2021-10: https://shopify.dev/changelog/online-store-2-0-new-metafields-type-system-and-dynamic-sources, but here it states the deprecation is 2021-07: https://shopify.dev/apps/metafields/manage#using-type-vs-value_type

Also, when querying the new type parameter on metafields, it is returning json_string instead of just json (json_string does not exist according to https://shopify.dev/apps/metafields/definitions/types -- it has been replaced by json)

I'm incredibly confused here... these inconsistencies are preventing me from upgrading our app to the 2021-07 API. Shopify, can you please clarify?

0 Likes
Dave_Pelletier
Shopify Staff
Shopify Staff
17 2 0

Sorry for the confusion! We'll be updating each of those pages that Jake linked to make the situation more clear. Here's what you need to know about this transition:

  • The `type: String` field is replacing the old `value_type: MetafieldValueType` field
  • You can see the new list of type values in our dev docs here. Some of those types map directly to the old MetafieldValueType enum, but we had to make an exception for json_string (the old value_type) and json (the new type). The deprecated "json_string" type will continue to exist because it behaves differently than the new "json" type when referenced in Liquid.
  • In 2021-07 we added type and deprecated value_type
  • In 2021-10 we will be removing value_type entirely
  • This transition is phased over two API releases so that you can upgrade to 2021-07 and start switching to the new type field without breaking any of your existing API calls that rely on value_type
0 Likes
Keita_W
Tourist
4 0 4

Thank you for your response.

However, it is not my issue.
My issue is that valueType is removed in older version API references.
https://shopify.dev/api/admin/graphql/reference/metafields/metafieldinput?api%5Bversion%5D=2021-04

Version 2021-04 should have valueType, but I cannot see.

Please check and modify the API references.

Thank you.

jake___
Shopify Partner
2 0 0

Hi Dave,

Thanks for the clarification!

So we can upgrade to 2021-07 without the need of updating value_type to type? Then only when upgrading to 2021-10, we will need to ensure we fully migrated to type? Finally, this change will follow the usual deprecation lifeycle (i.e. that is, we will have 9 months to update our apps to 2021-10 on October 1st 2021)?

What's the difference between json_string and json? Can we use the JSON Liquid filter still on the new  json type (e.g. {{product.metafields.foo.bar | json}})?

Thanks!

0 Likes