The type field only becomes optional when there’s an existing metafield definition that matches the given namespace, key, and owner resource type (derived from ownerId).
What you’ll need to do is verify that all the conditions are met for when type is not necessary. If these conditions are not met, the type field is still mandatory.
When we try to remove the type a second time (since this was already defined during our first creation). However, when we remove the type, it prompts “Type can’t be blank”.
You can check the two images below, this is our code for the first and second time.
thanks for your answer.
We are still using the same method.
According to your steps:
Our “query” is using the “type” on creating and updating
We are already using “2023-01”
It is working with this method, but the notice came up a few days ago…
According to the changes, we must “remove” the “type” when we are updating.
(I do not know why this is required at all. It is said that this is simplifying, but it is not at all. We need to check if it exists before we decide to add or remove the “type” from the “query”. That is a little bit complicated, instead of simplifying..)
This doesn’t solve anything, Simply switching api version to 2023-01 won’t work. I have updated my api version to 2023-01 since last week. But shopify is still reporting it.