---
title: "collectionUpdate"
description: >
  更新店铺中的分类。  :::tip{title="提示"} 分类的 SEO 信息通过元字段（Metafield）进行管理。具体操作方式，可参考 [通过 Metafield 的 Open API 编辑资源页面 SEO 信息](https://developer.shopline.com/zh-hans-cn/docs/apps/shopline-metafields/overview/#metafields-seo%E6%95%B0%E6%8D%AE%E4%BC%98%E5%8C%96)。  通过本接口更新分类时，不对分类的 SEO 信息做更新。 :::
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/mutations/collection-update'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/mutations/collection-update.md'
---
# collectionUpdate

更新店铺中的分类。

:::tip{title="提示"}
分类的 SEO 信息通过元字段（Metafield）进行管理。具体操作方式，可参考 [通过 Metafield 的 Open API 编辑资源页面 SEO 信息](https://developer.shopline.com/zh-hans-cn/docs/apps/shopline-metafields/overview/#metafields-seo%E6%95%B0%E6%8D%AE%E4%BC%98%E5%8C%96)。

通过本接口更新分类时，不对分类的 SEO 信息做更新。
:::

- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Mutation

## Arguments

* `input`

  [CollectionInput!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/inputs/collection-input.md)

  用于指定要更新的分类的输入字段

## Returns

* `collection`

  [Collection](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/collection.md)

  更新后的分类

* `userErrors`

  [[UserError!]!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/user-error.md)

  执行突变时发生的错误列表

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes)。

