HI all,
Does any one using the AppOwnedMetafield
this was Shopify admin API grapql. 2022-04 ,
As per the old document { "created_at": "2012-03-13T16:09:54-04:00", "description": "The number of units at the warehouse.", "id": 915396206, "key": "warehouse", "namespace": "inventory", "owner_id": 548380009, "owner_resource": "product", "updated_at": "2012-08-24T14:02:15-04:00", "value": "25", "type": "single_line_text_field" }
but it for latest API version 2023-04. what was the way to create app own meta or app secure meta value.. !! @Shopify_77
To create an app-owned metafield in Shopify Admin API GraphQL, you need to use the metafieldSet mutation and set the ownerID to the ID of the AppInstallation object associated with the app. Here’s an example of how to create an app-owned metafield:
mutation CreateAppOwnedMetafield($metafieldsSetInput: [MetafieldsSetInput!]!) {
metafieldsSet(metafields: $metafieldsSetInput) {
metafields {
id
namespace
key
}
userErrors {
field
message
}
}
}
Remember to replace the ownerId value with the correct AppInstallation ID for your app. For more information, you can refer to the Shopify documentation on app-owned metafields.
@Shayne Thanks I was using the same code as now my app side.
Issue i am facing.
We are updating Shopify admin API latest version 2023-04. I was looking into the document i was not found any reference for the same.
We can see the API notice. We are updating same app meta value it was in an app feature.
this case what was the solution do not passing the type time of meta creation ?
As of 2023-01, metafieldsSet no longer requires type when a corresponding metafield definition exists. View change
facing issue into accessing those meta value in the theme app extension checking those meta field value into when those value is not started liquid code stop ruining
` this working when value is stored.
{% if app.metafields.myapps.appmeta1.value %}
app liquid code
{% endif %}
`
` This code block run all
{% if app.metafields.myapps.appmeta1 %}
app liquid code