Product query sku filter not working properly

I need to filter all products with no SKU set. Using -sku:* isn’t working properly and fails to return some products that have variants with a null SKU.

Running the following queries produces no results:

x-request-id: 271998b6-518d-4df8-b292-881578105614-1783992234

{
    products(query:"-sku:*", first:10) {
        nodes {
            id
            title
            variants(first:10) {
                nodes {
                    id
                    title
                    inventoryItem {
                        sku
                    }
                }
            }

        }
     }
}

x-request-id: a69bd0f9-f226-4b8a-80bf-304124347f35-1783992200

query {
  productsCount(query: "-sku:*") {
    count
    precision
  }
}

x-request-id: 47972fe5-0bb3-42d7-a670-c5807d118955-1783992282

{
    productVariants(query:"-sku:*", first:10) {
        nodes {
            id
            title
            inventoryItem {
                sku
            }
        }
     }
}

Even though the following product ID is one example with variants that have a null SKU:

{
    product(id:"gid://shopify/Product/15851419369804") {
            id
            variants(first:10) {
                nodes {
                    id
                    inventoryItem {
                        sku
                    }
                }
            }
     }
}

Returns the result:

{
    "data": {
        "product": {
            "id": "gid://shopify/Product/15851419369804",
            "variants": {
                "nodes": [
                    {
                        "id": "gid://shopify/ProductVariant/57921697186124",
                        "inventoryItem": {
                            "sku": "[redacted]"
                        }
                    },
                    {
                        "id": "gid://shopify/ProductVariant/57921697153356",
                        "inventoryItem": {
                            "sku": "[redacted]"
                        }
                    },
                    {
                        "id": "gid://shopify/ProductVariant/57922056356172",
                        "inventoryItem": {
                            "sku": null
                        }
                    },
                    {
                        "id": "gid://shopify/ProductVariant/57922056388940",
                        "inventoryItem": {
                            "sku": null
                        }
                    }
                ]
            }
        }
    }
}

Is it related to this issue? productVariants's sku search prefix bug

Those exact variants have since been updated to include a SKU, so you won’t be able to reproduce on that store unfortunately.

Hey @DavidT - thanks for reaching out

I did some digging and tested the same products(query: "-sku:*") query using Admin GraphQL API version 2026-07 on my test store, but I wasn’t able to reproduce the empty result. My query returned matching products, and the nested variants included SKU values represented as both "" and null.

Could you confirm whether this is still occurring for you with a newly created product whose SKU remains unset? If it does, can you please share the raw request and response, and a fresh x-request-id? It would also help to check whether the query is modified or combined with any other filters before your app sends it.

Hope this helps!