Hi all, I’m having trouble listing all of the variant with an empty barcode.
When a variant is added to an existing product the barcode is empty, not null, I want to get this one.
So i tried doing this:
{
productVariants(first:250, query: "barcode:''") {
edges {
node {
id
title
barcode
}
}
}
}
and the response i got is this:
{
"data": {
"productVariants": {
"edges": []
}
},
"extensions": {
"cost": {
"requestedQueryCost": 13,
"actualQueryCost": 2,
"throttleStatus": {
"maximumAvailable": 2000,
"currentlyAvailable": 1998,
"restoreRate": 100
}
},
"search": [
{
"path": [
"productVariants"
],
"query": "barcode:''",
"parsed": {
"field": "barcode",
"match_phrase": ""
}
}
]
}
}
But i’m sure i have at least one product with a missing barcode, because if i do:
query {
product(id: "gid://shopify/Product/9827940794707") {
variants(first: 5) {
edges {
node {
displayName
barcode
}
}
}
}
}
I get:
{
"data": {
"product": {
"variants": {
"edges": [
{
"node": {
"displayName": "Maglieria - Rosa / TU",
"barcode": "000000001559"
}
},
{
"node": {
"displayName": "Maglieria - Celeste / TU",
"barcode": ""
}
}
]
}
}
},
"extensions": {
"cost": {
"requestedQueryCost": 6,
"actualQueryCost": 4,
"throttleStatus": {
"maximumAvailable": 2000,
"currentlyAvailable": 1996,
"restoreRate": 100
}
}
}
}
What can i do to get all of the variants with an empty barcode? Thanks.