更新商店语言环境-shopLocaleUpdate mutation

更新商店的语言环境。

所需的访问

write_locales 访问范围。


在本页面


互动范例

这是一个示例变异查询。

mutation shopLocaleUpdate($locale: String!, $shopLocale: ShopLocaleInput!) { shopLocaleUpdate(locale: $locale, shopLocale: $shopLocale) {
  1. <font style="color:#1F61A0;">shopLocale</font> <font style="color:#555555;">{</font>
  2. <font style="color:#1F61A0;">locale</font>
  3. <font style="color:#1F61A0;">name</font>
  4. <font style="color:#1F61A0;">primary</font>
  5. <font style="color:#1F61A0;">published</font>
  6. <font style="color:#555555;">}</font>
  7. <font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font>
  8. <font style="color:#1F61A0;">field</font>
  9. <font style="color:#1F61A0;">message</font>
  10. <font style="color:#555555;">}</font>
} } { “locale”: “placeholder”, “shopLocale”: {} }

参数

参数 描述
locale
() [String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

必需的
指定要更新的语言环境。
shopLocale
() [ShopLocaleInput!](https://shopify.dev/docs/admin-api/graphql/reference/translations/shoplocaleinput)

必需的
指定商店区域设置的输入字段。

ShopLocaleInput字段

  • published[Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)
    指定语言环境的发布状态。

返回字段

  • shopLocale[ShopLocale](https://shopify.dev/docs/admin-api/graphql/reference/translations/shoplocale)
    已更新的语言环境。
  • userErrors[[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror)
    执行突变时发生的错误列表。