-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce
@authenticated
directive in composition (#2644)
With this change, users can now compose `@authenticated` directive applications from their subgraphs into a supergraph. This addition will support a future version of Apollo Router that enables authenticated access to specific types and fields via directive applications. Since the implementation of `@authenticated` is strictly a composition and execution concern, there's no change to the query planner with this work. The execution work is well under way in Apollo Router (and won't be built at all for Gateway). So as far as this repo is concerned, only composition is concerned with `@authenticated`.
- Loading branch information
1 parent
aac2893
commit 9396c0d
Showing
9 changed files
with
368 additions
and
9 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,28 @@ | ||
--- | ||
"@apollo/composition": minor | ||
"@apollo/federation-internals": minor | ||
"@apollo/subgraph": minor | ||
"@apollo/gateway": minor | ||
--- | ||
|
||
Introduce the new `@authenticated` directive for composition | ||
|
||
> 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 `@authenticated` 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 `@authenticated` applications from their subgraphs into a supergraph. This addition will support a future version of Apollo Router that enables authenticated access to specific types and fields via directive applications. | ||
|
||
The directive is defined as follows: | ||
|
||
```graphql | ||
directive @authenticated on | ||
| FIELD_DEFINITION | ||
| OBJECT | ||
| INTERFACE | ||
| SCALAR | ||
| ENUM | ||
``` | ||
|
||
In order to compose your `@authenticated` usages, you must update your subgraph's federation spec version to v2.5 and add the `@authenticated` import to your existing imports like so: | ||
```graphql | ||
@link(url: "https://specs.apollo.dev/federation/v2.5", import: [..., "@authenticated"]) | ||
``` |
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
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
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
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
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.