更新私有元字段-privateMetafieldUpsert mutation

创建或更新私有元字段。


在本页面


互动范例

这是一个示例变异查询。

变异privateMetafieldUpsert $ input PrivateMetafieldInput !){ privateMetafieldUpsert 输入$ input {
  1. <font style="color:#1F61A0;">privateMetafield </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;">场地</font>
  6. <font style="color:#1F61A0;">信息</font>
  7. <font style="color:#555555;">}</font>
} } { “输入” {
  1. <font style="color:#8B2BB9;">“ namespace” </font><font style="color:#555555;"></font><font style="color:#D64292;">“ placeholder” </font><font style="color:#555555;"></font>
  2. <font style="color:#8B2BB9;">“ key” </font><font style="color:#555555;"></font><font style="color:#D64292;">“占位符” </font><font style="color:#555555;"></font>
  3. <font style="color:#8B2BB9;">“ valueInput” </font><font style="color:#555555;"></font><font style="color:#555555;">{</font>
  4. <font style="color:#8B2BB9;">“ value” </font><font style="color:#555555;"></font><font style="color:#D64292;">“ placeholder” </font><font style="color:#555555;"></font>
  5. <font style="color:#8B2BB9;">“ valueType” </font><font style="color:#555555;"></font><font style="color:#D64292;">“占位符”</font>
  6. <font style="color:#555555;">}</font>
} }


参数

参数 描述
input
() [PrivateMetafieldInput!](https://shopify.dev/docs/admin-api/graphql/reference/metafields/privatemetafieldinput)

必需的
指定私有元字段的输入字段。


PrivateMetafieldInput字段

  • key[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)必需的
    私有元字段的密钥。
  • namespace[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)必需的
    私有元字段的名称空间。
  • owner[ID](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)
    拥有的资源。
  • valueInput[PrivateMetafieldValueInput!](https://shopify.dev/docs/admin-api/graphql/reference/metafields/privatemetafieldvalueinput)必需的
    元字段的值和值类型,包装在ValueInput对象中。


返回字段

  • privateMetafield[PrivateMetafield](https://shopify.dev/docs/admin-api/graphql/reference/metafields/privatemetafield)
    创建或更新的私有元字段。
  • userErrors[[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror)
    执行突变时发生的错误列表。