Solved

Retrieve a list of metafields with "type" query parameter retrieves all the metafields

Srilekha_T
Tourist
8 0 2

With the recent changes (https://shopify.dev/changelog/online-store-2-0-new-metafields-type-system-and-dynamic-sources), the "value_type" field is deprecated and is replaced by the "type" field. "value_type" when used as a query parameter, returned only the records that matched certain value. 

ref doc: https://shopify.dev/api/admin/rest/reference/metafield 

For example, /metafields.json?value_type=integer - returns records with value_type as integer. 
But, /metafields.json?type=single_line_text_field - returns all the metafield records.

What is the expected behavior and can we use "type" as a query parameter? 

Accepted Solution (1)
Neethan
Shopify Staff (Retired)
5 2 13

This is an accepted solution.

Hello! Thank you for patience, you should now be able to use `type` as a query parameter going forward.

View solution in original post

Replies 3 (3)

Jesse_Vogt
Shopify Staff
14 2 10

Thanks for letting us know about this and I verified that this is an issue. The intention is that type can be used as a query parameter in a smilier fashion to how value_type was being used. I am writing up an issue to track this bug and can respond back here when it is resolved.

To learn more visit the Shopify Help Center or the Community Blog.

Srilekha_T
Tourist
8 0 2

Thank you for the quick update! Can you provide any tentative timeline for this fix?

Neethan
Shopify Staff (Retired)
5 2 13

This is an accepted solution.

Hello! Thank you for patience, you should now be able to use `type` as a query parameter going forward.