Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Query doesn't work for variant sku

Query doesn't work for variant sku

Snodgers
Shopify Partner
25 1 14

Wildcards do not seem to work for variant sku queries:

query {
  productVariants(first: 10, query: "sku:free*") {
    edges {
      node {
        sku
title
}
}
}
}

It does work for title, such as:

 

"title:free*"

 

 

 

Replies 2 (2)

Liam
Community Manager
3108 344 895

Hi Snodgers,

 

When you do use "title:free*", what are you seeing returned, and what are you expecting for the SKU wildcard?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

atyaglik
Shopify Partner
4 0 1

Hi Liam!
I have the same issue with Variant's SKU's wildcard.

I have some products with SKUSs like TOY01, TOY02, ..., TOY10, ... TOY500.

While trying to get only products with skus from TOY01 to TOY09 i use that query:

{
  productVariants(first: 250, query:"sku:TOY0*") {
    nodes {
      title
      sku
    }
  }
}

But there is not correct result:

atyaglik_0-1725610620083.png

The same query with product titles works fine, but with variants SKU's looks like broken