-
Notifications
You must be signed in to change notification settings - Fork 259
Implement progressive @override
#2911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or 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
🦋 Changeset detectedLatest commit: 29a2576 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
7854667
to
18c7482
Compare
This was referenced Jan 19, 2024
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.
Implement progressive override functionality in QP and validation logic Co-authored-by: Sachin D. Shinde <[email protected]>
88dd0ef
to
29a2576
Compare
trevor-scheer
pushed a commit
that referenced
this pull request
Jan 20, 2024
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated. # Releases ## @apollo/[email protected] ### Minor Changes - Implement progressive `@override` functionality ([#2911](#2911)) 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). - Support `@join__directive(graphs, name, args)` directives ([#2894](#2894)) ### Patch Changes - Allow known `FeatureDefinition` subclasses to define custom subgraph schema validation rules ([#2910](#2910)) - Updated dependencies \[[`6ae42942b13dccd246ccc994faa2cb36cd62cb3c`](6ae4294), [`66833fb8d04c9376f6ed476fed6b1ca237f477b7`](66833fb), [`931f87c6766c7439936df706727cbdc0cd6bcfd8`](931f87c)]: - @apollo/[email protected] - @apollo/[email protected] ## @apollo/[email protected] ### Minor Changes - Implement progressive `@override` functionality ([#2911](#2911)) 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). ### Patch Changes - Updated dependencies \[[`6ae42942b13dccd246ccc994faa2cb36cd62cb3c`](6ae4294), [`66833fb8d04c9376f6ed476fed6b1ca237f477b7`](66833fb), [`931f87c6766c7439936df706727cbdc0cd6bcfd8`](931f87c)]: - @apollo/[email protected] - @apollo/[email protected] - @apollo/[email protected] ## @apollo/[email protected] ### Minor Changes - Implement progressive `@override` functionality ([#2911](#2911)) 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). - Allow known `FeatureDefinition` subclasses to define custom subgraph schema validation rules ([#2910](#2910)) - Support `@join__directive(graphs, name, args)` directives ([#2894](#2894)) ## @apollo/[email protected] ### Minor Changes - Implement progressive `@override` functionality ([#2911](#2911)) 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). ### Patch Changes - Updated dependencies \[[`6ae42942b13dccd246ccc994faa2cb36cd62cb3c`](6ae4294), [`66833fb8d04c9376f6ed476fed6b1ca237f477b7`](66833fb), [`931f87c6766c7439936df706727cbdc0cd6bcfd8`](931f87c)]: - @apollo/[email protected] ## @apollo/[email protected] ### Minor Changes - Implement progressive `@override` functionality ([#2911](#2911)) 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). ### Patch Changes - Updated dependencies \[[`6ae42942b13dccd246ccc994faa2cb36cd62cb3c`](6ae4294), [`66833fb8d04c9376f6ed476fed6b1ca237f477b7`](66833fb), [`931f87c6766c7439936df706727cbdc0cd6bcfd8`](931f87c)]: - @apollo/[email protected] - @apollo/[email protected] ## @apollo/[email protected] ### Minor Changes - Implement progressive `@override` functionality ([#2911](#2911)) 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). ### Patch Changes - Updated dependencies \[[`6ae42942b13dccd246ccc994faa2cb36cd62cb3c`](6ae4294), [`66833fb8d04c9376f6ed476fed6b1ca237f477b7`](66833fb), [`931f87c6766c7439936df706727cbdc0cd6bcfd8`](931f87c)]: - @apollo/[email protected] ## [email protected] Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add new optional
label
arg to@override
which is aString
. Capture label in the supergraph via the new@join__field
argoverrideLabel
so these values can be used during query graph creation and query planning.Reviewed in two separate PRs:
#2879
#2902