---
title: "CollectionRuleConditions"
description: >
  This object defines all columns and allowed relations that can be used in rules for smart collections to automatically include the matching products.
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/objects/collection-rule-conditions'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/objects/collection-rule-conditions.md'
---
# CollectionRuleConditions

This object defines all columns and allowed relations that can be used in rules for smart collections to automatically include the matching products.

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

## Type Signature

`CollectionRuleConditions`

## Fields

* `allowedRelations`

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

  Allowed relations of the rule.

* `defaultRelation`

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

  Most commonly used relation for this rule.

* `ruleType`

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

  Type of the rule.

## Schema Definition

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

## Field from

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

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

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes).

