MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
946 stars 278 forks source link

Shop metafield deprecated value_type, new field: type #505

Closed yongyi520 closed 3 years ago

yongyi520 commented 3 years ago

Issue: When creating new metafield with the new 'type' field,

shopify.metafield.create({
    namespace: 'exampleNameSpace',
    key: 'exampleKey',
    value: object,
    type: 'json'
  });

I get this error: Screen Shot 2021-08-21 at 7 58 41 PM

Solution: Update metafield type Shopify partners has given a notice to update to

  1. not use the deprecated field: value_type
  2. use type instead

https://shopify.dev/api/admin/rest/reference/metafield#index-2021-07 Screen Shot 2021-08-21 at 7 54 56 PM

https://shopify.dev/apps/metafields/definitions/types Screen Shot 2021-08-21 at 8 03 32 PM

lpinca commented 3 years ago

I will update the TypeScript type definitions but the error you are receiving has nothing to do with it. You already specified type so it can't be blank. TypeScript type definitions do not change what is sent and received.

lpinca commented 3 years ago

Make sure you are using the 2021-07 API version.