Shopify Storefront API - productByHandle 未返回刚刚从之前的 api 调用返回的产品

Shopify Storefront API - productByHandle not returning a product which has just been returned from a previous api call

我正在使用 iOS SDK 调用店面 API 以获取产品列表。

{products(first:20,query:"product_type:Mug"){edges{node{title,handle,images(first:1){edges{node{transformedSrc(maxWidth:400,maxHeight:400),originalSrc,altText,id}}}}}}}

其中 returns 预期的产品列表。

然后我打电话来获取有关该列表中特定产品的更多信息:

{productByHandle(handle:"handle-from-previous-query"){id,description,images{edges{node{transformedSrc(maxWidth:640,maxHeight:640)}}}}}

但是,这没有返回任何产品(它正在返回这个:<QueryRoot: ["productByHandle": <null>]>)。

我已经理智地检查过我正在传递第一个 api 响应的值,我是。我还通过在网络上查看来检查句柄是否正确并且它有效。

我不明白这一点,因为该产品确实存在并且可见,因为它刚刚从第一个 api 调用返回!

有什么建议吗?

您错过了图像的 first 运算符:

{
  productByHandle(handle: "handle-from-previous-query") {
    id
    description
    images(first: 100) {
      edges {
        node {
          transformedSrc(maxWidth: 640, maxHeight: 640)
        }
      }
    }
  }
}