【问题标题】:shopify storefront api doesn't show filter results as expectedshopify 店面 api 未按预期显示过滤结果
【发布时间】:2022-07-04 16:54:45
【问题描述】:

我正在使用shopify Storefront api 构建一个应用程序。到目前为止,我能够获取产品、收藏品。但是当我尝试过滤集合中的产品时,它没有按预期返回结果。这是我在邮递员中尝试的内容

{
  collection(id:"Z2lkOi8vc2hvcGlmeS9Db2xsZWN // collection id"){
    products(first:10, filters:[{productVendor:"ADDIDAS"}]){
      edges{
        node{
            id
            title
            description
            productType
            vendor
        }
      }
    }
  }
}

但我得到的结果有 NIKE 和其他类型的供应商。我需要改变什么吗? 但是当我尝试使用price 进行过滤时,它工作正常,但是当我尝试使用productType 进行过滤时,它给了我意想不到的结果。难道我做错了什么? 请在这里帮忙

【问题讨论】:

  • 这显然是一个错误......我会报告

标签: graphql postman shopify shopify-storefront-api


【解决方案1】:

尝试使用variants.price 而不是price。结帐https://shopify.dev/api/storefront/2022-04/queries/products 以获取所有可用的过滤器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-11
    • 2011-10-02
    • 2019-04-05
    • 2022-08-14
    • 2018-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多