Commit 99f2da2
committed
fix: transitive auth requirements on @requires and @fromcontext
Adds new `postMergeValidation` check to ensure that all fields that depends on data from other parts of the supergraph through `@requires` and/or `@fromContext` directives explicitly specify matching `@authenticated`, `@requiresScopes` and/or `@policy` auth requirements, e.g.
```graphql
type T @key(fields: "id") {
id: ID!
extra: String @external
# we need explicit @authenticated as it is needed to access extra
requiresExtra: String @requires(fields: "extra") @authenticated
}
type T @key(fields: "id") {
id: ID!
extra: String @authenticated
}
```1 parent faea2d1 commit 99f2da2
File tree
6 files changed
+1106
-3
lines changed- .changeset
- composition-js/src
- __tests__
- merging
- internals-js/src
- specs
6 files changed
+1106
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments