apollographql / apollographql/federation
bug(gateway): Validate against missing `@external` for nested `@requires` fields
- Dominant language
- TypeScript
- Stars
- 725
- Forks
- 276
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 1
Description
```graphql
# User service
type User @key(fields: "id") {
id: String!
}
type EmailAddress {
...
}
```
```graphql
# Emails service
extend type User @key(fields: "id") {
id: String! @external
emailAddress: EmailAddress @external
emails: [Email] @requires(fields: "emailAddress { userName domain }")
}
extend type EmailAddress {
userName: String @external
# domain: String @external
}
```
Typed this example up by hand and haven't validated it reproduces the issue, but it should encompass the heart of the issue. Nested `@requires` fields aren't validated to have a matching external field in the schema.
`domain` should be required to pass validations, but it's not.
Contributor guide
Assessment
This issue has not been assessed yet.