Class PossibleMappingsCalculator


  • public class PossibleMappingsCalculator
    extends java.lang.Object
    We don't want to allow arbitrary schema changes. For example changing an Object type into a Scalar is not something we want to consider.

    We do this to make SchemaDiffings better understandable, but also to improve the overall runtime of the algorithm. By restricting the possible mappings the Schema diffing algo is actually able to finish in a reasonable time for real life inputs.

    We restrict the algo by calculating which mappings are possible for given vertex. This is later used in DiffImpl.calcLowerBoundMappingCost(graphql.schema.diffing.Vertex, graphql.schema.diffing.Vertex, graphql.schema.diffing.Mapping, java.util.Map<graphql.schema.diffing.Vertex, java.lang.Double>). While doing this we need to also ensure that there are the same amount of vertices in the same "context": for example if the source graph has 3 Objects, the target graph needs to have 3 Objects. We achieve this by adding "isolated vertices" as needed.