-
Notifications
You must be signed in to change notification settings - Fork 275
Create federation @policy directive #2818
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
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
08d7925
add new subdirectory for specs
clenfest ca0fa22
finish up @policy directive implementation and tests
clenfest c25a137
Merge branch 'next' into clenfest/policy_directive
clenfest 2f393f9
Add changeset and apollo federation 2.6 bump for @policy
clenfest 8121351
run prettier on tests
clenfest 63a6ae7
fix directive definition in changeset
dariuszkuc 4d8edac
remove dead code - these methods are unreferenced
trevor-scheer 6f944a1
Update .changeset/khaki-rockets-complain.md
trevor-scheer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| --- | ||
| "apollo-federation-integration-testsuite": minor | ||
| "@apollo/query-planner": minor | ||
| "@apollo/query-graphs": minor | ||
| "@apollo/composition": minor | ||
| "@apollo/federation-internals": minor | ||
| "@apollo/gateway": minor | ||
| --- | ||
|
|
||
| Introduce the new `@policy` scope for composition ([#2818](https://github.com/apollographql/federation/pull/2818)) | ||
|
|
||
| > Note that this directive will only be _fully_ supported by the Apollo Router as a GraphOS Enterprise feature at runtime. Also note that _composition_ of valid `@policy` directive applications will succeed, but the resulting supergraph will not be _executable_ by the Gateway or an Apollo Router which doesn't have the GraphOS Enterprise entitlement. | ||
|
|
||
| Users may now compose `@policy` applications from their subgraphs into a supergraph. | ||
|
|
||
| The directive is defined as follows: | ||
|
|
||
| ```graphql | ||
| scalar federation__Policy | ||
|
|
||
| directive @policy(policies: [[federation__Policy!]!]!) on | ||
| | FIELD_DEFINITION | ||
| | OBJECT | ||
| | INTERFACE | ||
| | SCALAR | ||
| | ENUM | ||
| ``` | ||
|
|
||
| The `Policy` scalar is effectively a `String`, similar to the `FieldSet` type. | ||
|
|
||
| In order to compose your `@policy` usages, you must update your subgraph's federation spec version to v2.6 and add the `@policy` import to your existing imports like so: | ||
| ```graphql | ||
| @link(url: "https://specs.apollo.dev/federation/v2.6", import: [..., "@policy"]) | ||
| ``` | ||
|
|
||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.