Unable to comply with new `metafieldsSet.type` requirement

Solved

Unable to comply with new `metafieldsSet.type` requirement

dylanpierce
Shopify Partner
277 13 120

Hello,

Starting October 1st (Monday), all Shopify Apps will need to comply with this new rule to omit the `type` field if a corresponding Metafield Definition exists: 

 

https://shopify.dev/changelog/updated-metafieldssetinput-type-to-be-nullable-for-metafieldsset-mutat...

However, when trying to create a metafield definition via the Admin GraphQL API, you'll receive an error message:

 

[
{
field: [ 'definition' ],
message: 'Namespace and key is already in use for a set of your metafields.',
__typename: 'MetafieldDefinitionCreateUserError'
}
]


This is problematic because this means as an app developer you cannot comply with this latest API change, because you cannot create a metafield definition on behalf of merchants.

Yes, I tried `metafieldDefinitionUpdate` instead of creating a new one, which also lead to another error that's just as confusing:


[
{
field: [ 'definition' ],
message: 'Definition not found.',
__typename: 'MetafieldDefinitionUpdateUserError'
}
]

 

So simultaneously, the metafield definition does not exist and the metafield does exist and can't be created.

Founder of Real ID - Verify your customer's real IDs easily & securely with modern A.I.

Want to see it in action? Check out our demo store.

Accepted Solution (1)

SBD_
Shopify Staff
1831 273 418

This is an accepted solution.

Hey @dylanpierce,

Shared your post with the metafields folks and they said:


Let me know if this clears things up or you have any questions!

Scott | Developer Advocate @ Shopify 

View solution in original post

Replies 6 (6)

SBD_
Shopify Staff
1831 273 418

This is an accepted solution.

Hey @dylanpierce,

Shared your post with the metafields folks and they said:


Let me know if this clears things up or you have any questions!

Scott | Developer Advocate @ Shopify 

dylanpierce
Shopify Partner
277 13 120

Thanks @SBD_ 

That's very helpful. I understand now that the error message in the Shopify Partner dashboard is the fact that the deprecated API Version (`2022-10` in my case) has been detected, and the items beneath are the changes that might break.

Updating my app to use a newer API Version (`2023-01`) fixed the Last detected incident.

The way the API Health dashboard was laid out, I initially thought my `metafieldUpdate` query that was including the `type` field was the _cause_ of the Last detected incident. But in fact it was just that my API call was using a soon to be deprecated version.

And after looking through out logs I can confirm that metafield updates are working. Thanks!

Founder of Real ID - Verify your customer's real IDs easily & securely with modern A.I.

Want to see it in action? Check out our demo store.

AvocadosLab
Shopify Partner
51 4 45

Appreciate your insights. We get error when we don't pass type but get dashboard warning when we pass it on version 2023-01. We would very much appreciate if app delisting is paused until Shopify implements solution for this.

mattdenoronha
Shopify Partner
35 1 15

Passing type does still work.

However, the Oct 1st deadline has passed, apps are being flagged as calling unsupported APIs, ours is threatened with delisting and new installs being be blocked. Customers have flagged the app is saying it's 'unsupported'. 

Metafield Definitions can't be created (on App Installation) and updating metafields require a Definition being created. 

Can this be fixed asap?

@SBD_ 

SBD_
Shopify Staff
1831 273 418

Hey @mattdenoronha 

 

Passing type is still allowed. You simply don’t have to when there’s a corresponding definition (docs).

Could you clarify whether you mean metafield definitions cannot be created during the app installation process, or, you can't create metafield definitions on the AppInstallation owner type? If the second one - definitions are not supported for the AppInstallation.

Hey @AvocadosLab 


It seems the error you're referring to is related to hitting an older api version - not your specific usage of metafieldsSet. From our logs it looks like you're hitting 2022-10. Switching to 2023-01 should resolve the warning.

Scott | Developer Advocate @ Shopify 

AvocadosLab
Shopify Partner
51 4 45

Hey @SBD_ 

 

Thanks for looking into this. We will investigate.