At a glance
- Identifier: #883
- Stage: RFC X / Rejected
- Champion: @IvanGoncharov
- Latest activity: Spec PR created on 2021-09-02
- Spec PR: https://github.com/graphql/graphql-spec/pull/883
Spec PR description
At the moment covariance rules for interfaces are incompatible with validation rule for overlapping fragments. For example, if we have schema like this:
interface AddressInterface {
country_code: String
}
type Port implements AddressInterface {
country_code: String!
}
type Warehouse implements AddressInterface {
country_code: String
}
type Query {
addressInterface: AddressInterface
}
This query is valid:
query {
addressInterface {
country_code
}
}
But if you expand interface field into inline fragments will cause a validation error:
query {
addressInterface {
... on Port {
country_code
}
... on Warehouse {
country_code
}
}
}
This PR fixes this issue.
Timeline
- Spec PR created on 2021-09-02 by IvanGoncharov
- Commit pushed on 2021-09-02 by IvanGoncharov: Relax SameResponseShape algorith to be compatible with covariant fields
- Added to WG agenda on 2021-09-02
- Mentioned in WG notes on 2021-09-02