Relax SameResponseShape algorithm to be compatible with covariant fields
At a glance​
- Identifier: #883
- Stage: RFCX: Closed 2022-01-06T18:33:52Z
- Champion: @IvanGoncharov
- PR: Relax SameResponseShape algorithm to be compatible with covariant fields
Timeline​
- Spec PR created on 2021-09-02 by IvanGoncharov
- Commit pushed: Relax SameResponseShape algorith to be compatible with covariant fields on 2021-09-02 by @IvanGoncharov
- Added to 2021-09-02 WG agenda
- Mentioned in 2021-09-02 WG notes
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.