Repository navigation
Tags
Tags
polygen: pass conv to TPH edge queries (#2) ## Summary - Describe your changes TPH edge queries panicked on `.All()`. polygen renders three `Query<Edge>` builders per TPH edge (on the entity, its query and its client), and they built the wrapper without `conv`: ```go func (n *Dashboard) QueryCharts() *DashboardChartQuery { return &DashboardChartQuery{b: n.QueryChartsPattern()} // conv is nil } ``` `All`, `AllX`, `First` and `Only` run each row through `polyMap(rows, wrap.conv)`, so the first row hits a nil func. `Count`, `IDs`, `Exist` and an empty result never call it, which is why it went unnoticed. `With<Edge>` already passed `conv`. `renderEdge` now passes the same `<pattern>Of` converter to all three builders. In aries this hits `Dashboard.QueryCharts()` and `Organization.QueryConnections()`; `Dashboard.charts` reads through `client.DashboardChart` as a workaround until this ships. ## Issue ticket number and link None. ## Test Plans - New `TestTPHEdgeQueriesConvertRows` renders every TPH edge in `testdata/tph` and checks each query wrapper carries `conv`. It fails on main (all three `ConnectionQuery` builders) and passes here. - `go test ./ent/poly/...` passes; `golangci-lint run ./ent/poly/polygen/` reports 0 issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
PreviousNext