feat: enable to ignore cost weights on implementing types#1542
Conversation
This PR adds a feature flag that allows to emulate behavior of Apollo that ignored weights on implementing types when the fields on interface does not have cost weight assigned.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds ChangesIgnoreImplementingTypeWeights feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@v2/pkg/engine/plan/cost.go`:
- Around line 589-590: The actual-cost path for abstract-list normalization is
not respecting the skipImplementingTypesOnAbstract flag. In the section around
line 775 where implementing field weights are read (around lines 790-794), add a
check to skip reading implementing field weights when
skipImplementingTypesOnAbstract is enabled, similar to how it's checked at line
589. Additionally, add a regression test that sets
IgnoreImplementingTypeWeights=true with an abstract-list child field containing
non-zero default type or scalar weights, then verify that implementing field
weights remain zero in actual-cost mode and are not reintroduced despite the
non-zero defaults.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f8510e00-4df0-43b9-9d54-71f9850cfed2
📒 Files selected for processing (4)
execution/engine/execution_engine_cost_test.goexecution/engine/execution_engine_test.gov2/pkg/engine/plan/configuration.gov2/pkg/engine/plan/cost.go
…x-across-implementations-instead
🤖 I have created a release *beep* *boop* --- ## [2.5.0](v2.4.6...v2.5.0) (2026-06-18) ### Features * enable to ignore cost weights on implementing types ([#1542](#1542)) ([1ade300](1ade300)) ### Bug Fixes * **cost:** determine correctly the type of list-wrapped scalars and enums ([#1546](#1546)) ([2575480](2575480)) * remove connections from transport connection pool ([#1541](#1541)) ([ca47200](ca47200)) * **resolve:** fix GC-liveness bug in the loadBatchEntityFetch ([#1536](#1536)) ([2ad6fc4](2ad6fc4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: wundergraph-bot[bot] <285992168+wundergraph-bot[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [1.16.0](execution/v1.15.6...execution/v1.16.0) (2026-06-18) ### Features * enable to ignore cost weights on implementing types ([#1542](#1542)) ([1ade300](1ade300)) ### Bug Fixes * **cost:** determine correctly the type of list-wrapped scalars and enums ([#1546](#1546)) ([2575480](2575480)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: wundergraph-bot[bot] <285992168+wundergraph-bot[bot]@users.noreply.github.com>
This PR adds a feature flag that allows to emulate behavior
of Apollo that ignored weights on implementing types when
the fields on interface does not have cost weight assigned.