我是 graphQL 的新手,我必须检索所有产品。我一直在环顾四周,观看教程和阅读,人们似乎返回了他们想要的所有某种类型的数据,但我不能。例如,它会抛出一个错误,指出您必须提供第一个或最后一个,但我想要全部,否则它会说totalCount或count不存在。
\n {\n products {\n id\n title\n price\n \n }\n}\n\n// or get total count of products\n\n {\n products {\n totalCount\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n我基本上是在尝试做类似的事情。我知道我可能不会收到任何帮助,因为没有人可以访问我的 shopify admin api,但甚至可能是一个示例或我可以看到的任何内容。这是来自我的产品选项的 graphQL 查询根。\n产品列表。
\nProductConnection!\nfirst: Int\nReturns up to the first n elements from the list.\n\nafter: String\nReturns the elements that come after the specified cursor.\n\nlast: Int\nReturns up to the last n elements from the list.\n\nbefore: String\nReturns the elements that come before the specified cursor.\n\nreverse: Boolean = false\nReverse the order of the underlying list.\n\nsortKey: ProductSortKeys …Run Code Online (Sandbox Code Playgroud)