---
title: Command And Query Integration
---

Validation runs automatically before command execution and query performance.

## Commands

```typescript
const command = new CreateUserCommand();
command.email = '';
command.age = 15;

const result = await command.execute();
// result.isValid === false
```

## Queries

```typescript
const query = new SearchUsersQuery();
query.parameters = { searchTerm: 'ab', minAge: -5 };

const result = await query.perform();
// result.isValid === false
```

## Backend-Governed Validation

Rules are defined on the backend and extracted by proxy generation:

- Single source of truth for validation rules
- Consistent frontend/backend behavior
- Type-safe generated validators

See [Backend Command Validation](/arc/backend/commands/validation/) and [Backend Query Validation](/arc/backend/queries/validation/).

## Related

- [Rules And Fluent API](/arc/frontend/core/validation/rules/)
- [Validation Results](/arc/frontend/core/validation/results/)
- [Severity Filtering](/arc/frontend/core/validation/severity-filtering/)
