AI Query Products without images

So I asked the AI for a query that would give me all products without images. I honestly didn’t expect a response, was totally excited that I got a response and then disappointed that it didnt work.

query ProductsWithoutImages {
  products(first: 10, query: "-image:*") {
    edges {
      node {
        id
        title
        handle
      }
    }
    pageInfo {
      hasNextPage
    }
  }
}

It’s something that I have wanted for a while and is even more relevant in recent times since image processing has become increasingly unreliable. I have noticed recently that when creating products that images are being dropped without warning or indication that the image could not be processed. Both with the now deprecated REST api (but less so) and with the graphql api (in my opinion totally unreliable with no warnings or errors).

My only conclusion is that Shopify has recently (within the last 6 months) changed how images are processed. I have an almost 25% drop rate or more with ProductSet mutation with files, and < 2% drop rate with the REST API. Its not a huge number, but I would at least like some kind of feedback or warning that something has gone wrong instead of simply a return value which contains less images that I sent. The images are all small in size well below the 20mb max (most are in the 100-200kb range) but they are simply getting dropped. I ended up “downgrading” my product create code from GrapqhQL to REST because of this.

But I digress…

The above query would come in real handy, if it actually worked, to quickly find which products don’t have images allowing me to quickly “repair” them.

Cheers,
Gary

Hey @Gary_Gilbert - I’m the PM on the media side of things here and this is a really good feature idea and definitely something we’ll take back and consider.
I wanted to follow up though to understand more about the 25% fail rate you’re experieincing. Could you post more context regarding specific shops and requests where this is happening? If you’d rather, feel free to email me matt.koenig@shopify.com and I’ll look into this. We should figure out what’s going on, because that’s not expected or normal and I’m sure is incredibly frustrating!

1 Like

Hi @Matt_Koenig,

Thanks for reaching out. I think I still have the code available. I will have to set up a development shop to run it and see if I still get the drops, we are a week or so out now from deploying the shop and only noticed it once they started finalizing their products, and migrating their images to a webserver. I prefer this approach than pushing BASE64 encoded images or using the shudder staged upload.

It might take a bit before I can do this as we are finalizing the ERP integration and there is still a lot to do and coordinate.

Cheers,
Gary

No worries, just reach out whenever you’re able to and I’m here to help get to the bottom of this! Thank you!