Implementations may not deprecate a field that the interface hasn't deprecated
At a glanceā
- Identifier: #1053
- Stage: RFC2: Draft
- Champion: @benjie
- PR: Implementations may not deprecate a field that the interface hasn't deprecated
Timelineā
- Added to 2025-01-09 WG agenda
- Commit pushed: Avoid negative, don't refer to directive on 2024-12-06 by @benjie
- Added to 2024-12-05 WG agenda
- Mentioned in 2024-12 WG notes
- Added to 2023-12-07 WG agenda
- Mentioned in 2023-12 WG notes
- Spec PR created on 2023-11-09 by benjie
- Commit pushed: Implementations may not deprecate a field that the interface hasn't dā¦ on 2023-11-09 by @benjie
This PR addresses a spec validation omission; if an interface field is not deprecated then any implementation of that interface field should also not be deprecated. I.e. the following schema should be invalid, but before this PR it is valid:
interface Node {
id: ID!
}
type Foo implements Node {
id: ID! @deprecated(reason: "...")
}
type Query {
foo: Foo
}To solve this, either the deprecation should be removed, or the
id
field onNode
should also be deprecated:interface Node {
id: ID! @deprecated(reason: "...")
}Relevant action item: https://github.com/graphql/graphql-wg/issues/1331
GraphQL.js Implementation: https://github.com/graphql/graphql-js/pull/3986