Shopify Storefront GraphQL API 获取可用国家/地区和州/省的列表(不带 REST API)
要求:请勿使用 Shopify Admin Rest API
如何使用 Storefront GraphQL API 获取国家/地区及其州/省的列表?
我正在 React 创建一个页面,客户可以在其中编辑他们的地址。对于我的
我尝试了此查询,但看起来无法检索州/省。为什么此处不可用州/省?
https://shopify.dev/api/storefront/2022-01/对象/国家#字段
{
localization {
availableCountries {
name
}
}
}
Requirement: Do not use the Shopify Admin Rest API
How do I get a list of the countries and their states/provinces with the Storefront GraphQL API?
I am creating a page in React where a customer can edit their address. For my <Select>
fields, for countries and provinces, I want to use the Storefront GraphQL API because that is what all of the other queries in my React site are written with.
I tried this query but it looks like the states/provinces are not available to be retrieved. Why are the states/provinces not available here?
https://shopify.dev/api/storefront/2022-01/objects/Country#fields
{
localization {
availableCountries {
name
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论