-
Notifications
You must be signed in to change notification settings - Fork 208
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Component(s)
router
Is your feature request related to a problem? Please describe.
@override's all-or-nothing approach makes it challenging to safely migrate a monolith to use Cosmo Router. Once the schema is composed with @override, 100% of traffic immediately routes to the new service with no ability to gradually roll out (1% → 25% → 100%) or validate with a small percentage of production traffic first.
Describe the solution you'd like
Implement Apollo Federation 2.7's progressive override.
type Query {
user(id: ID!): User @override(from: "monolith", label: "percent(25)")
}Implementation:
- Composition: Parse and store
labelparameter in supergraph metadata - Runtime: Router evaluates label per-request and routes accordingly
- Support built-in
percent(X)syntax at minimum
Describe alternatives you've considered
The following approach is the only viable alternative that I've considered.
HTTP middleware that introspects request body:
- Custom
@overridePercentage(pct: Int)directive that adds override context to custom HTTP round trippers. - Parse requests bound for downstreams, determine fields eligible for percentage routing, then route based on the configured percentage.
- Not ideal: requires parsing every request, completely works around cosmo/router's federation implementation.
Additional context
- Apollo introduced this in Federation 2.7 (April 2024)
- Documentation
- Blog post
- Current limitation: graphql-go-tools generates query plans at composition time, would need runtime evaluation
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request