<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/EntityQueryProperty/init(_:comparators:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents19EntityQueryPropertyC_11comparatorsACyxxq0_q1_q2_Gs7KeyPathCyxq0_G_SayAA03AnycD10ComparatorVyxxq0_q1_q2_GGyXEtcq_Rszrlufc"
  },
  "title" : "init(_:comparators:)"
}
-->

# init(_:comparators:)

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

```
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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)