<!--
{
  "availability" : [
    "iOS: 8.0.0 - 9.3.0",
    "iPadOS: 8.0.0 - 9.3.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 2.0.0 - 2.2.0"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKQuery/sampleType",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKQuery(py)sampleType"
  },
  "title" : "sampleType"
}
-->

# sampleType

The type of objects being queried.

```
var sampleType: HKSampleType? { get }
```

## Discussion

Not all queries return objects of the specified type; however, they all use the object type to generate 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.

---

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)