Various problem for product STATUS query

I have some wired result for various GraphQL queries about the product status.

Now as for the queries…

Products:

query {
    products(query: "status:ACTIVE,ARCHIVED", first: 10) {
        nodes {
            id
            status
		}
    }
}

It gives me the following warning and only search for ACTIVE product (default value)

"search": [
            {
                "path": [
                    "products"
                ],
                "query": "status:ACTIVE,ARCHIVED",
                "parsed": {
                    "field": "status",
                    "match_all": "ACTIVE,ARCHIVED"
                },
                "warnings": [
                    {
                        "field": "status",
                        "message": "Input `ACTIVE,ARCHIVED` is not an accepted value."
                    }
                ]
            }
        ]

So it seems not possible to search for multiple status as states in the documentation (both 2024-10 and the newest 2025-01.

It works if I search with the following query: status:ACTIVE OR status:ARCHIVED

ProductVariants: this is a little wired. I’ve got two product with the same SKU, one is active, one is archived.
This query will give me correctly both the products:

query {
    productVariants(query: "sku:TST-SKU", first: 10) {
        nodes {
            id
            sku
            updatedAt
            product {
                id
                status
            }
        }
    }
}

But if I try to add the product status (documentation here: productVariants - GraphQL Admin ), it will fails with every value I insert (ACTIVE or ARCHIVED or ACTIVE,ARCHIVED):

query {
    productVariants(query: "sku:TST-SKU AND product_status:ACTIVE", first: 10) {
        nodes {
            id
            sku
            updatedAt
            product {
                id
                status
            }
        }
    }
}
--------
# result
{
    "data": {
        "productVariants": {
            "nodes": []
        }
    },
    "extensions": {
        "search": [
            {
                "path": [
                    "productVariants"
                ],
                "query": "sku:TST-DEL-S AND product_status:ACTIVE",
                "parsed": {
                    "and": [
                        {
                            "field": "sku",
                            "match_all": "TST-DEL-S"
                        },
                        {
                            "field": "product_status",
                            "match_all": "ACTIVE"
                        }
                    ]
                }
            }
        ]
    }
}
query {
    productVariants(query: "sku:TST-SKU AND product_status:ARCHIVED", first: 10) {
        nodes {
            id
            sku
            updatedAt
            product {
                id
                status
            }
        }
    }
}
---
#result
{
    "data": {
        "productVariants": {
            "nodes": []
        }
    },
    "extensions": {
        "search": [
            {
                "path": [
                    "productVariants"
                ],
                "query": "sku:TST-SKU AND product_status:ARCHIVED",
                "parsed": {
                    "and": [
                        {
                            "field": "sku",
                            "match_all": "TST-SKU"
                        },
                        {
                            "field": "product_status",
                            "match_all": "ARCHIVED"
                        }
                    ]
                }
            }
        ]
    }
}

And both:

query {
    productVariants(query: "sku:TST-SKU AND product_status:ACTIVE,ARCHIVED", first: 10) {
        nodes {
            id
            sku
            updatedAt
            product {
                id
                status
            }
        }
    }
}
---
#result
{
    "data": {
        "productVariants": {
            "nodes": []
        }
    },
    "extensions": {
        "search": [
            {
                "path": [
                    "productVariants"
                ],
                "query": "sku:TST-SKU AND product_status:ACTIVE,ARCHIVED",
                "parsed": {
                    "and": [
                        {
                            "field": "sku",
                            "match_all": "TST-SKU"
                        },
                        {
                            "field": "product_status",
                            "match_all": "ACTIVE,ARCHIVED"
                        }
                    ]
                }
            }
        ]
    }
}

Fun fact that for the “productVariants” query it will not give the warning on the product_status field as seen in the “products” query

It seems like the documentation is not updated and misleading in this scenario. As you said comma-separated values and uppercase status on product_status is not working. If you do lowercase though, it works. Try running the following query: (API version 2024-10)

query {
    productVariants(query: "sku:TST-SKU AND (product_status:draft OR product_status:active)", first: 10) {
        nodes {
            id
            sku
            updatedAt
            product {
                id
                status
            }
        }
    }
}

Yeah it works, but I don’t think this should be the solution: why it work with the UPPERCASE if a single value is specified? And why it works with UPPERCASE only for the “products” query and for the “productVariants”?

# working
query {
    products(query: "sku:TST-SKU AND status:ARCHIVED", first: 10) {
        nodes {
            id
            status
		}
    }
}

# not working
query {
    productVariants(query: "sku:TST-SKU AND product_status:ARCHIVED", first: 10) {
        nodes {
            id
            sku
            product {
                id
                status
            }
        }
    }
}

Everything works fine with lowercase but it still gives the warning for bad value on “products” query

query {
    products(query: "sku:TST-SKU AND status:ARCHIVED", first: 10) {
        nodes {
            id
            status
		}
    }
}
---
# result
{
    "data": {
        "products": {
            "nodes": [
                {
                    "id": "gid://shopify/Product/...",
                    "status": "ACTIVE"
                },
                {
                    "id": "gid://shopify/Product/...",
                    "status": "ARCHIVED"
                }
            ]
        }
    },
    "extensions": {
        "search": [
            {
                "path": [
                    "products"
                ],
                "query": "sku:'TST-SKU' AND status:active,archived",
                "parsed": {
                    "and": [
                        {
                            "field": "sku",
                            "match_phrase": "TST-SKU"
                        },
                        {
                            "field": "status",
                            "match_all": "active,archived"
                        }
                    ]
                },
                "warnings": [
                    {
                        "field": "status",
                        "message": "Input `active,archived` is not an accepted value."
                    }
                ]
            }
        ]
    }
}

Best I can guess from what I see is documentation is not updated.

  1. For products query, you have to use uppercase values for status and instead of comma-separating them use OR logical operator to combine them.
  2. For productVariants query, you have to use lowercase values for product_status and you can use comma-separation as well here.

So, for products query should be “sku:TST-SKU AND (status:ARCHIVED OR status:ACTIVE)”.
For productVariants query should be “sku:TST-SKU AND product_status:archived,active”. Using these queries shouldn’t give any warnings and should achieve what you are trying to do.

I hope this helps!