fixing type creation query to make sure changing bases does not create duplicate types in the graph