GraphQL query filter is not working

Topic summary

A user is attempting to filter product variants using a GraphQL query to exclude barcodes starting with “Super” using the syntax -barcode:Super*. However, the filter is not working as expected—variants with barcodes prefixed by “Super” still appear in the results.

Key findings:

  • The prefix query operator works correctly for the title field but fails for the barcode field
  • A Shopify representative confirmed that prefix queries are currently not supported for barcodes on ProductVariants
  • The representative acknowledged logging this as feedback, recognizing potential usefulness

Current status: The issue remains unresolved as a platform limitation rather than a user error. No workaround or timeline for support was provided.

Summarized with AI on November 22. AI used: claude-sonnet-4-5-20250929.

I use GraphQL to query the product variants with barcodes not starting with Super, but I still see variants with barcodes with Super as prefixes.

query newVariantsQuery {
productVariants (first:10 query:“-barcode:Super*”) {
pageInfo {
hasNextPage
}
edges {
cursor
node {
availableForSale
barcode
compareAtPrice
createdAt
displayName
id
inventoryItem {
id
inventoryLevels (first:1) {
edges {
node {
available
id
}
}
}
tracked
unitCost {
amount
}
}
position
price
product {
createdAt
description
descriptionHtml
hasOnlyDefaultVariant
id
options {
id
name
values
}
productType
publishedAt
status
tags
title
totalVariants
updatedAt
vendor
}
selectedOptions {
name
value
}
sku
storefrontId
taxable
title
updatedAt
weight
weightUnit
}
}
}
}

It seems that the prefix query works for the title field, but not the barcode field. Any idea from anyone?

This is correct, prefix queries currently aren’t supported by barcodes on Product Variants.

I’ll log the feedback though, I can see how this would be helpful.