---
title: "performQuery(_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/scene/performquery(_:)"
---

# performQuery(_:)

Returns all entities of the scene which pass the query.

## Declaration

```swift
@MainActor @preconcurrency func performQuery(_ query: EntityQuery) -> QueryResult<Entity>
```

## Discussion

Discussion When in update(context:), call entities(matching:updatingSystemWhen:) instead of performQuery. This allows the System to sleep on some platforms when there is no matching component, reducing unnecessary work.

## See Also

### Finding entities

- [findEntity(named:)](realitykit/scene/findentity(named:).md)
- [findEntity(id:)](realitykit/scene/findentity(id:).md)
