---
title: "CollectionRuleInput"
description: "表示用于将产品分配到分类的规则"
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/inputs/collection-rule-input'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/inputs/collection-rule-input.md'
---
# CollectionRuleInput

表示用于将产品分配到分类的规则

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

## Type Signature

`CollectionRuleInput`

## Input Fields

* `condition`

  [String!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/string.md)

  应用运算符的值。例如：`Hats`

* `column`

  [CollectionRuleColumn!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/enums/collection-rule-column.md)

  规则关注的属性。例如：`title` 或 `product_type`

* `relation`

  [CollectionRuleRelation!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/enums/collection-rule-relation.md)

  规则所基于的运算符的类型。例如：`equals`, `contains`, 或 `not_equals`

## Schema Definition

```graphql
input CollectionRuleInput { 
	condition: String!
	column: CollectionRuleColumn!
	relation: CollectionRuleRelation! 
}
```

## Input field from

* [CollectionRuleSetInput](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/inputs/collection-rule-set-input.md).rules

  用于将产品分配到分类的规则

## 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)。

