Closed JoviDeCroock closed 3 weeks ago
Latest commit: e1ad44d746deeeecd6bfc57054eddcf50d1e95f3
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Resolves #3600
Summary
Currently we are holding a mapping of abstract --> concrete types, however when we are in a write operation we always say the fragment matches. This meant that in the union case we would often write concrete type maps to another concrete type. This is invalid, I changed the condition to check whether the fragment actually matches before writing an abstract to concrete type mapping. This however begs the question whether this functionality is worth keeping around because a heuristic match could still make us fall into the concrete to concrete mapping which could in turn cause unexpected behaviour in later queries.
This also adds a check to see whether we have accidentally persisted a concrete type in the past due to i.e. multiple matching selection-sets. This ensures that we can't confuse types.
In the test case this would result in us writing
Type1 maps to Type2
and hence any subsequent read would result in a fragment match for both and hence resulting in null as we would think some scalar values are undefined.