Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
We want to mange our metafields via a inventory management software. But when trying to upload a file_reference type, the connector gives back an error.
The Shopify server responded with status 422 and the following error: "value => must be a file reference string.
So i need somthing like this: gid://shopify/ MediaImage/123.
But where can i get the vaule to my image? I can only see the URL.
Thanks for Help
Up ?
Hello, i have same problem here : https://community.shopify.com/c/metafields-and-custom-data/add-media-on-metafield-product-get-error-...
You can use the following GraphQL query:
{
files(first: 5, query: "filename:'yourfilename'" ) {
edges {
node {
alt
id
}
}
}
}
But this query returns multiple files if they have similar names. Unfortunately there is no query parameter like a url or something.
https://shopify.dev/docs/api/admin-graphql/2024-01/queries/files
You can click on Show filters under the query argument to see the options.