更新商店策略-shopPolicyUpdate mutation
更新商店政策。
所需的访问
write_legal_policies
访问范围。
在本页面
互动范例
这是一个示例变异查询。
mutation shopPolicyUpdate($shopPolicy: ShopPolicyInput!) { shopPolicyUpdate(shopPolicy: $shopPolicy) {} } { “shopPolicy”: {
<font style="color:#1F61A0;">shopPolicy</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">id</font>
<font style="color:#555555;">}</font>
<font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">code</font>
<font style="color:#1F61A0;">field</font>
<font style="color:#1F61A0;">message</font>
<font style="color:#555555;">}</font>
} }
<font style="color:#8B2BB9;">"type"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font><font style="color:#555555;">,</font>
<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)
)
执行突变时发生的错误列表。