更新商店策略-shopPolicyUpdate mutation

更新商店政策。

所需的访问

write_legal_policies 访问范围。


在本页面


互动范例

这是一个示例变异查询。

mutation shopPolicyUpdate($shopPolicy: ShopPolicyInput!) { shopPolicyUpdate(shopPolicy: $shopPolicy) {
  1. <font style="color:#1F61A0;">shopPolicy</font> <font style="color:#555555;">{</font>
  2. <font style="color:#1F61A0;">id</font>
  3. <font style="color:#555555;">}</font>
  4. <font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font>
  5. <font style="color:#1F61A0;">code</font>
  6. <font style="color:#1F61A0;">field</font>
  7. <font style="color:#1F61A0;">message</font>
  8. <font style="color:#555555;">}</font>
} } { “shopPolicy”: {
  1. <font style="color:#8B2BB9;">"type"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font><font style="color:#555555;">,</font>
  2. <font style="color:#8B2BB9;">"body"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font>
} }

参数

参数 描述
shopPolicy
() [ShopPolicyInput!](https://shopify.dev/docs/admin-api/graphql/reference/store-properties/shoppolicyinput)

必需的
更新店铺政策时要使用的属性。

ShopPolicyInput字段

  • body[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)必需的
    政策文字,最大大小为512kb。
  • type[ShopPolicyType!](https://shopify.dev/docs/admin-api/graphql/reference/store-properties/shoppolicytype)必需的
    商店政策类型。

返回字段

  • shopPolicy[ShopPolicy](https://shopify.dev/docs/admin-api/graphql/reference/store-properties/shoppolicy)
    已更新的店铺政策。
  • userErrors[[ShopPolicyUserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/store-properties/shoppolicyusererror)
    执行突变时发生的错误列表。