---
title: objectType
framework: healthkit
role: symbol
role_heading: Instance Property
path: healthkit/hkquery/objecttype
---

# objectType

The type of objects being queried.

## Declaration

```swift
var objectType: HKObjectType? { get }
```

## Discussion

Discussion Not all queries return objects of the specified type; however, they all use the object type to filter their results. For example, source queries return a set of data sources that have saved objects with a matching type, while statistics queries return statistical information about the objects with a matching type.

## See Also

### Accessing properties

- [predicate](healthkit/hkquery/predicate.md)
- [sampleType](healthkit/hkquery/sampletype.md)
