我使用iossdk调用Storefront 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}}}}}}}
返回预期的产品列表。
然后我打电话从列表中获取有关特定产品的更多信息:
{productByHandle(handle:"handle-from-previous-query"){id,description,images{edges{node{transformedSrc(maxWidth:640,maxHeight:640)}}}}}
但是,它不返回任何产品(它返回的是:
<QueryRoot: ["productByHandle": <null>]>
).
我已经检查过是否传递了第一个api响应的值,我是。我还检查了手柄是否正确,通过在网上查看它的工作。
我不明白这一点,因为产品肯定存在,而且是可见的,因为它刚刚从第一个api调用返回!
有什么建议吗?