Out-of-stock products search

I am using this query to search for products:

query searchProducts {
search(first: 250, query: “azur”, unavailableProducts: SHOW, types: PRODUCT) {
nodes {
… on Product {
id
title
variantsCount {
count
precision
}
}
}
}
}

Out-of-stock products are only appearing if they have variants; simple products (without variants) are being excluded from the results.

1 Like

Hey @Tony_Silva

I tested this on my end using a single-variant product with availableForSale: false and quantityAvailable: 0, and it returned correctly with unavailableProducts: SHOW.

I wonder if this is something specific to the affected products in your store.

Some things to check:

  • What is the product status? If it’s DRAFT, it won’t appear in Storefront API results at all
  • Check that it’s published to the channel making the request
  • verify that “azur” actually appears in the missing products’ title, description, tags, etc.
  • Try fetching one of the missing products directly by its GID via the Storefront API to confirm that the product is accessible to the storefront

Hello @KyleG-Shopify ,

It’s working for us now as well. Unfortunately, I didn’t save the Request ID from the previous query,
Thanks for looking into it anyway!