Skip to content

Command And Query Integration

Validation runs automatically before command execution and query performance.

const command = new CreateUserCommand();
command.email = '';
command.age = 15;
const result = await command.execute();
// result.isValid === false
const query = new SearchUsersQuery();
query.parameters = { searchTerm: 'ab', minAge: -5 };
const result = await query.perform();
// result.isValid === false

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 and Backend Query Validation.