大数跨境

GraphQL 管理 API 2026-10 版本中已移除 DraftOrderDiscountNotAppliedWarning.priceRule

GraphQL 管理 API 2026-10 版本中已移除 DraftOrderDiscountNotAppliedWarning.priceRule Shopify电商独立站
2026-06-23
1
导读:从 GraphQL Admin API 版本 2026-10 开始,已弃用的 DraftOrderDiscountNotAppliedWarning 对象中的 priceRule 字段已被移除。

从GraphQL管理API版本2026-10开始,DraftOrderDiscountNotAppliedWarning对象上已弃用的priceRule字段已被移除。

对于在DraftOrderDiscountNotAppliedWarning上查询priceRule的应用程序而言,这是一个破坏性变更,因为该字段会作为来自draftOrderCalculate、draftOrderCreate和draftOrderUpdate等变体的草稿订单折扣警告的一部分返回;如果您的应用程序在这些响应中选择了priceRule,则必须在升级到2026-10之前更新这些查询。

警告信息已经直接暴露了相关的折扣数据,因此您不再需要旧的priceRule对象,请使用以下字段代替:

  • discountTitle——无法应用的折扣标题,请用它来代替priceRule { title }。
  • discountCode——无法应用的折扣代码,请用它来代替priceRule { discountCodes { nodes { code } } }。

更新任何从此警告中读取priceRule的查询,改为选择discountTitle和discountCode。

之前:

... on DraftOrderDiscountNotAppliedWarning { priceRule { title discountCodes(first: 1) { nodes { code } } } }

之后:

... on DraftOrderDiscountNotAppliedWarning { discountTitle discountCode }

DraftOrderDiscountNotAppliedWarning是公共GraphQL管理API中唯一可以访问旧版PriceRule对象的地方,因此,移除priceRule也意味着在2026-10及更高版本的公共模式中移除了PriceRule对象及其相关类型。

较旧的受支持API版本将继续在DraftOrderDiscountNotAppliedWarning上暴露priceRule,直到这些版本停止支持为止。

了解更多关于DraftOrderDiscountNotAppliedWarning对象的信息。

【声明】内容源于网络
0
0
Shopify电商独立站
1234
内容 7146
粉丝 0
Shopify电商独立站 1234
总阅读87.4k
粉丝0
内容7.1k