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