Search docs
Docs searchValidation rule
Back to Rule CatalogAP-DQR-008Data / Query RiskRepeated query pattern in one request flow
Flags request flows that repeat the same or similar query multiple times.
warningviolationNo auto-fix
How to fix
- Fetch shared context once and pass it through.
- Batch similar queries.
- Add request-level caching only when it matches consistency needs.
What it means
A workflow appears to execute duplicate query patterns during one request.
Why it matters
Repeated queries add latency and increase load without improving correctness.
Common causes
- Several helpers independently fetch the same record.
- No request-level memoization or shared query result exists.
- A service calls multiple workflows that each reload context.
Example bad pattern
A request loads organization membership in auth, service, and repository helpers separately.Example good pattern
Resolve membership once, then pass the scoped context through the workflow.Related files/config
apps/api/srcpackages/db/prisma/schema.prisma
Related CLI commands
archpilot validatearchpilot validate --ci