-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement progressive
@override
(#2911)
Add new optional `label` arg to `@override` which is a `String`. Capture label in the supergraph via the new `@join__field` arg `overrideLabel` so these values can be used during query graph creation and query planning. Reviewed in two separate PRs: #2879 #2902 --------- Co-authored-by: Sachin D. Shinde <sachin@apollographql.com>
- Loading branch information
1 parent
66833fb
commit 6ae4294
Showing
20 changed files
with
1,363 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
"@apollo/query-planner": minor | ||
"@apollo/query-graphs": minor | ||
"@apollo/composition": minor | ||
"@apollo/federation-internals": minor | ||
"@apollo/subgraph": minor | ||
"@apollo/gateway": minor | ||
--- | ||
|
||
Implement progressive `@override` functionality | ||
|
||
The progressive `@override` feature brings a new argument to the `@override` directive: `label: String`. When a label is added to an `@override` application, the override becomes conditional, depending on parameters provided to the query planner (a set of which labels should be overridden). Note that this feature will be supported in router for enterprise users only. | ||
|
||
Out-of-the-box, the router will support a percentage-based use case for progressive `@override`. For example: | ||
```graphql | ||
type Query { | ||
hello: String @override(from: "original", label: "percent(5)") | ||
} | ||
``` | ||
The above example will override the root `hello` field from the "original" subgraph 5% of the time. | ||
|
||
More complex use cases will be supported by the router via the use of coprocessors/rhai to resolve arbitrary labels to true/false values (i.e. via a feature flag service). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -190,6 +190,7 @@ Reviwed | |
Rhai | ||
righ | ||
rulesof | ||
runtimes | ||
samee | ||
Sant | ||
SATISFIABILITY | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.