Issue: withPgClient leads to N+1 queries when used outside mutations; need batched read helpers
Issue: withPgClient leads to N+1 queries when used outside mutations; need batched read helpers: a task in LegoFlow-SWE (Harbor dataset). The withPgClient helper is intended only for side-effecting operations (mutations), but its name does not communicate this limitation. Developers frequently use…
The task
The `withPgClient` helper is intended only for side-effecting operations (mutations), but its name does not communicate this limitation. Developers frequently use it to perform read queries in fields that are not on the mutation root type – for example, computing an aggregate or looking up related data for each item…
Part of Lego-X/LegoFlow-SWE.