Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hey,
I always get this error when I try to request a image, even though it is defined:
https://shopify.dev/api/admin-graphql/2022-04/objects/Image#field-image-url
"Field 'url' doesn't exist on type 'Image'"
Seems to be a bug to me, the image resource should always have a url.
{
files(first: 5) {
edges {
cursor
node {
createdAt
alt
__typename
... on MediaImage {
id
alt
image {
id
width
url
height
__typename
}
__typename
}
fileErrors {
code
details
message
__typename
}
}
__typename
}
pageInfo {
hasNextPage
hasPreviousPage
__typename
}
__typename
}
}
This query will fail with the mentioned error. When I remove the url it works flawlessly.
This is basically the same query that is done in the admin interface when you open the files list. Funnily, there url works without issues.
Does someone know how to solve this and get the url for the images?
I'm facing the same issue with shopify-api-node package, but the query works on Postman
I was using the wrong API version, the url property was added to the Image object on version 2022/01
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024