---
title: "init(_:comparators:)"
framework: appintents
role: symbol
role_heading: Initializer
path: "appintents/entityqueryproperty/init(_:comparators:)"
---

# init(_:comparators:)

Initializes a EntityQueryProperty that applies to entity property at the provided keyPath.

## Declaration

```swift
convenience init(_ keyPath: KeyPath<Subject, Property>, @EntityQueryComparatorsBuilder<Entity, Entity, Property, PropertyType, ComparatorMappingType> comparators: () -> EntityQueryProperty<Entity, Subject, Property, PropertyType, ComparatorMappingType>.QueryComparators) where Entity == Subject
```

## Parameters

- `keyPath`: The keypath to the property that this EntityQueryProperty applies to. The target property type determines which comparator modifiers will be available.
- `comparators`: The set of EntityQueryComparators that this property supports being queried by.

## See Also

### Creating queryable properties

- [init(_:entityProvider:comparators:)](appintents/entityqueryproperty/init(_:entityprovider:comparators:).md)
- [EntityQueryProperty.QueryComparators](appintents/entityqueryproperty/querycomparators.md)
- [EntityQueryComparatorsBuilder](appintents/entityquerycomparatorsbuilder.md)
