Search docs
Docs searchValidation rule
Back to Rule CatalogAP-DQR-007Data / Query RiskMissing projection/select for partial entity use
Flags queries that load full entities when only a small subset of fields is used.
warningviolationNo auto-fix
How to fix
- Add select/projection for required fields.
- Keep sensitive fields out of read paths by default.
- Update response mapping tests after narrowing the shape.
What it means
A query appears to retrieve more columns than the workflow consumes.
Why it matters
Explicit projection reduces data exposure, payload size, and coupling to schema changes.
Common causes
- ORM defaults return full records.
- A response mapper uses only a few fields.
- Sensitive columns are included accidentally.
Example bad pattern
Load full user records to render only name and email.Example good pattern
select: { id: true, name: true, email: true }.Related files/config
apps/api/srcpackages/db/prisma/schema.prisma
Related CLI commands
archpilot validatearchpilot validate --ci
Related docs