-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
It is widely believed that, in the process of schema evolution, changing field type from T to T! is not a breaking change.
A counter-example is given below (a like of it was encountered in a real-life application).
Consider the following [partial] schema
union ExternalResource = LinkedResource | ResourceCitation
type LinkedResource {
title: String!
link: String
}
type ResourceCitation {
citation: String!
link: String
}and this selection set
{
... on LinkedResource {
link
}
... on ResourceCitation {
link
}
}The selection set is valid (FieldsInSetCanMerge returns true on it).
Suppose the schema evolves:
type LinkedResource {
title: String!
link: String!
}The selection set given above is now invalid, since SameResponseShape (step 3a) returns false.
Since T! is naturally embedded in T, it seems reasonable to allow such 'compatible' fields to be queried without forcing aliasing upon API clients (and possibly causing a breaking change where, semantically, there is none).
The problem looks related to these recently opened issues:
#1171
#1169