---
title: "CollectionRuleConditions"
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/objects/collection-rule-conditions'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/collection-rule-conditions.md'
---
# CollectionRuleConditions

该对象定义可在智能分类的规则中使用的所有列和允许的关系，用以自动包含匹配的产品

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

## Type Signature

`CollectionRuleConditions`

## Fields

* `allowedRelations`

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

  允许的规则关系

* `defaultRelation`

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

  此规则最常用的关系

* `ruleType`

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

  规则的类型

## Schema Definition

```graphql
type CollectionRuleConditions { 
	allowedRelations: [CollectionRuleRelation!]
	defaultRelation: CollectionRuleRelation!
	ruleType: CollectionRuleColumn! 
}
```

## Field from

* [Query](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/queries/collection-rules-conditions.md).collectionRulesConditions

  列出所有可用于创建智能分类的规则

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

