---
title: "result(for:)"
framework: healthkit
role: symbol
role_heading: Instance Method
path: "healthkit/hkasyncquery/result(for:)"
---

# result(for:)

Runs a one-shot query and asynchronously returns a snapshot of the current matching results.

## Declaration

```swift
func result(for healthStore: HKHealthStore) async throws -> Self.Output
```

## Parameters

- `healthStore`: The access point for HealthKit data.

## Mentioned in

Running Queries with Swift Concurrency

## Discussion

Discussion The adopting type’s Output associated type specifies the values that this method returns. For example, HKSampleQueryDescriptor returns an array of HKQuantitySample objects. let stepType = HKQuantityType(.stepCount)

let descriptor = HKSampleQueryDescriptor(     predicates:[.quantitySample(type: stepType)],     sortDescriptors: [SortDescriptor(\.endDate, order: .reverse)],     limit: 10)

let results = try await descriptor.result(for: store)

## See Also

### Running Queries

- [Output](healthkit/hkasyncquery/output.md)
