fix: incorrect type detection for abstract types - #1613
Conversation
There was a problem hiding this comment.
Claude Code Review
Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.
Tip: disable this comment in your organization's Code Review settings.
|
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 (1)
📝 WalkthroughWalkthroughAdds support for federated ChangesAbstract
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant GraphQLQuery
participant NewDataSource
participant RPCPlanVisitor
participant ProductService
participant MockService
GraphQLQuery->>NewDataSource: load _entities query
NewDataSource->>RPCPlanVisitor: build `@requires` execution plan
RPCPlanVisitor->>ProductService: call abstract-return required-field RPC
ProductService->>MockService: resolve Storage field by id
MockService-->>ProductService: return interface or union value
ProductService-->>NewDataSource: return protobuf response
NewDataSource-->>GraphQLQuery: return concrete __typename and selected fields
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
v2/pkg/engine/datasource/grpc_datasource/execution_plan_requires_test.go (1)
3592-3663: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider hoisting the shared expectation helpers out of the test functions.
storageEntityLookupCallandstorageKeyMessageare byte-for-byte copies of the closures inTestExecutionPlan_FederationRequires_AbstractTypes(lines 2664-2734) in this same file. Extracting them to package-level helpers keeps the two suites from drifting when the lookup call shape changes.🤖 Prompt for 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. In `@v2/pkg/engine/datasource/grpc_datasource/execution_plan_requires_test.go` around lines 3592 - 3663, Extract the duplicated storage lookup builders from the current test scope into package-level helpers, such as shared functions for the RPCCall and RPCMessage, and update both TestExecutionPlan_FederationRequires_AbstractTypes and the current test to use them. Remove the local storageEntityLookupCall and storageKeyMessage closures while preserving their existing returned structures.
🤖 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.
Nitpick comments:
In `@v2/pkg/engine/datasource/grpc_datasource/execution_plan_requires_test.go`:
- Around line 3592-3663: Extract the duplicated storage lookup builders from the
current test scope into package-level helpers, such as shared functions for the
RPCCall and RPCMessage, and update both
TestExecutionPlan_FederationRequires_AbstractTypes and the current test to use
them. Remove the local storageEntityLookupCall and storageKeyMessage closures
while preserving their existing returned structures.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 33a28d12-bcaa-49d0-9614-cd091a565d5f
⛔ Files ignored due to path filters (2)
v2/pkg/grpctest/productv1/product.pb.gois excluded by!**/*.pb.gov2/pkg/grpctest/productv1/product_grpc.pb.gois excluded by!**/*.pb.go
📒 Files selected for processing (12)
v2/pkg/engine/datasource/grpc_datasource/execution_plan.gov2/pkg/engine/datasource/grpc_datasource/execution_plan_requires_test.gov2/pkg/engine/datasource/grpc_datasource/execution_plan_visitor.gov2/pkg/engine/datasource/grpc_datasource/execution_plan_visitor_federation.gov2/pkg/engine/datasource/grpc_datasource/grpc_datasource_federation_test.gov2/pkg/engine/datasource/grpc_datasource/mapping_test_helper.gov2/pkg/grpctest/mapping/mapping.gov2/pkg/grpctest/mockservice_requires.gov2/pkg/grpctest/product.protov2/pkg/grpctest/productv1/productv1connect/product.connect.gov2/pkg/grpctest/schema.gov2/pkg/grpctest/testdata/products.graphqls
🤖 I have created a release *beep* *boop* --- ## [2.14.2](v2.14.1...v2.14.2) (2026-07-31) ### Bug Fixes * incorrect type detection for abstract types ([#1613](#1613)) ([e249e88](e249e88)) --- 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>
Abstract types for
requiredfields were missing some type configuration in the planner step. This PR adds the missing config and provides test casesChecklist
Open Source AI Manifesto
This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.
Summary by CodeRabbit
@requiressupport when the required field returns abstract GraphQL types (interfaces/unions), including nested and list/nullable scenarios.Storagefields for recommended items and latest operations (including optional latest operation), with corresponding gRPC-backed responses.@requires, ensuring only selected abstract members contribute to results.@requiresbehavior.