Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
407 views
in Technique[技术] by (71.8m points)

Shopify's `min/maxVariantPrice` filtering doesn't work as expected

When I run the following query:

products(first:10, query:"priceRange:{minVariantPrice:10, }") {
  edges {
    node {
      title
    }
  }
}

I expect to see all products whose variant price is greater than 10, but instead, it returns nothing.

I have a product whose variant price is 15, if I replace 10 with 15 in the above query I see that product as result. Isn't it supposed to show up in the first query as well?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Your query is wrong, the GraphQL request just ignores the query at the moment.

If you want to check the variants price you need to use variants.price so your query should become something like so:

{
  products(first:10, query:"variants.price:>10") {
  edges {
    node {
      title
    }
  }
 }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...