---
title: "CollectionRuleRelation"
description: "Describe how the specified columns relate to the conditions."
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/enums/collection-rule-relation'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/enums/collection-rule-relation.md'
---
# CollectionRuleRelation

Describe how the specified columns relate to the conditions.

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

## Type Signature

`CollectionRuleRelation`

## Values

* `ENDS_WITH`

  The attribute finishes with the condition.

* `EQUALS`

  The attribute equals the condition.

* `GREATER_THAN`

  The attribute is larger than the condition

* `LESS_THAN`

  The attribute is smaller than the condition.

* `NOT_CONTAINS`

  The condition is not within the attribute.

* `NOT_EQUALS`

  The attribute is not equal to the condition.

* `STARTS_WITH`

  The condition appears at the start of the attribute.

* `CONTAINS`

  The condition is contained within the attribute.

## Schema Definition

```graphql
enum CollectionRuleRelation { 
	ENDS_WITH 
	EQUALS 
	GREATER_THAN 
	LESS_THAN 
	NOT_CONTAINS 
	NOT_EQUALS 
	STARTS_WITH 
	CONTAINS  
}
```

## Field from

* [CollectionRuleConditions](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/objects/collection-rule-conditions.md).allowedRelations

  Allowed relations of the rule.

* [CollectionRuleConditions](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/objects/collection-rule-conditions.md).defaultRelation

  Most commonly used relation for this rule.

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

  The operator type which the rule is based on, such as equals, not_equals, contains.

## Input field from

* [CollectionRuleInput](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/inputs/collection-rule-input.md).relation

  The operator type on which the rule is based. Examples include: equals, contains, or not_equals.

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

