Hello everyone,
I hope you’re doing well. I’m encountering an issue while sending a request with certain images to post on a platform. Here’s the problem: even though the images look good and the response indicates success (OK), none of these images are actually posted. Strangely, when I add a new image and post again, only the new image gets posted. All images are from the same source and have similar attributes.
I’ve checked the request format, image properties, and server logs, but I can’t seem to pinpoint why this behavior is happening. Has anyone encountered a similar issue before or can provide insights into what might be causing this discrepancy?
Here we have 2 examples queries:
{"URL": "https://modern-day-muffler.myshopify.com/admin/api/2023-07/graphql.json"},
{"METHOD": "POST"}
{"Headers":["X-Shopify-Access-Token: ******","Accept: application/json","Content-Type: application/json"] }
Query:
{
"query": "mutation($input: ProductInput!, $imageCount: Int!) {
productUpdate(input: $input) {
product {
id
publishedAt
handle
images(first: $imageCount) {
edges {
node {
originalSrc
id
}
}
}
}
userErrors {
field
message
}
}
}","variables": {
"input": {
"id": "gid://shopify/Product/8269882589397",
"images": [
{
"src": "http://assets.mysuredone.com/688598/media-photos/11821-bgpl-4025e5a07e644430823606546727ddb47c542c0a.jpg"
},
{
"src": "http://assets.mysuredone.com/688598/media-photos/11821-bgpl-4025e5a07e644430823606546727ddb47c542c0a-2.jpg"
},
{
"src": "https://assets.mysuredone.com/688598/media-photos/11821-bgpl-4025e5a07e644430823606546727ddb47c542c0a-3.jpg"
}
],
"variants": [
{
"sku": "11821-BGPL",
"price": "639.95",
"title": "Fuel Pump, Universal, Phantom, Diesel, 300, 6-20\" Depth 11821",
"weight": 5.68,
"id": "gid://shopify/ProductVariant/45770120888533",
"inventoryManagement": "SHOPIFY",
"inventoryPolicy": "DENY",
"barcode": "684980015133"
}
]
},
"imageCount": 3
}
}
Response
{
"data": {
"productUpdate": {
"product": {
"id": "gid://shopify/Product/8269882589397",
"publishedAt": "2024-02-02T22:28:00Z",
"handle": "fuel-pump-universal-phantom-diesel-300-6-20-depth-11821",
"images": {
"edges": []
}
},
"userErrors": []
}
},
"extensions": {
"cost": {
"requestedQueryCost": 14,
"actualQueryCost": 12,
"throttleStatus": {
"maximumAvailable": 2000.0,
"currentlyAvailable": 1988,
"restoreRate": 100.0
}
}
}
}
As you can see the images are on the query but the response has no imgs, also doesn’t show on the store.
Following the query after adding a new image from the same source:
{"URL": "https://modern-day-muffler.myshopify.com/admin/api/2023-07/graphql.json"}
{"METHOD": "POST"}
{"Headers": ["X-Shopify-Access-Token: ***","Accept: application/json","Content-Type: application/json"]}
Query
"{"query":"mutation($input: ProductInput!, $imageCount: Int!) {
productUpdate(input: $input) {
product {
id
publishedAt
handle
images(first: $imageCount) {
edges {
node {
originalSrc
id
}
}
}
}
userErrors {
field
message
}
}
}",{
"variables": {
"input": {
"id": "gid: //shopify/Product/8269882589397",
"images": [
{
"src": "http://assets.mysuredone.com/688598/media-photos/11821-bgpl-4025e5a07e644430823606546727ddb47c542c0a.jpg"
},
{
"src": "http://assets.mysuredone.com/688598/media-photos/11821-bgpl-4025e5a07e644430823606546727ddb47c542c0a-2.jpg"
},
{
"src": "https://assets.mysuredone.com/688598/media-photos/11821-bgpl-4025e5a07e644430823606546727ddb47c542c0a-3.jpg"
},
{
"src": "http://assets.mysuredone.com/688598/media-photos/jac31230mcrv-jns-2efcdf4a2260f47904fdfd910938545bf09274b6.jpg"
}
],
"variants": [
{
"sku": "11821-BGPL",
"price": "639.95",
"title": "Fuel Pump, Universal, Phantom, Diesel, 300, 6-20\" Depth 11821",
"weight": 5.68,
"id": "gid: //shopify/ProductVariant/45770120888533",
"inventoryManagement": "SHOPIFY",
"inventoryPolicy": "DENY",
"barcode": "684980015133"
}
]
},
"imageCount": 4
}
}
Reponse
"{"data": {
"productUpdate": {
"product": {
"id": "gid://shopify/Product/8269882589397",
"publishedAt": "2024-02-02T22:28:00Z",
"handle": "fuel-pump-universal-phantom-diesel-300-6-20-depth-11821",
"images": {
"edges": [
{
"node": {
"originalSrc": "https://cdn.shopify.com/s/files/1/2493/0960/files/jac31230mcrv-jns-2efcdf4a2260f47904fdfd910938545bf09274b6.jpg?v=1714150813",
"id": "gid://shopify/ProductImage/41652059144405"
}
}
]
}
},
"userErrors": []
}
},
"extensions": {
"cost": {
"requestedQueryCost": 14,
"actualQueryCost": 13,
"throttleStatus": {
"maximumAvailable": 2000.0,
"currentlyAvailable": 1987,
"restoreRate": 100.0
}
}
}
}"
As you can see the response in this case has only the new IMG. I checked and the imgs seems to fit with the imgs requirements…
Any help or suggestions would be greatly appreciated. Thank you in advance!