apollographql / apollographql/federation

bug(gateway): Validate against missing `@external` for nested `@requires` fields

Open
#405 1 comment 1 reaction 1 assignee Claimed by @trevor-scheer View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.