mountetna / magma

Data server with friendly data loaders
GNU General Public License v2.0
5 stars 2 forks source link

Clean up link validation #160

Open alimi opened 4 years ago

alimi commented 4 years ago

The link validation is a bit bizarre and doesn't seem correct, or it's at least very provisional and not rigorous enough. For example, you could have two models with "collections" of each other - each expects the other to hold a foreign key, but neither does because there is no join model - but they should check out as reciprocally linked. Also, a self-referential link (which is in use, e.g., in the ipi::patient model for setting a reference_patient) checks out - but only because it proves to be its own reciprocal! Bizarre and strange. These behaviors should be clarified before we start trying to figure out how to make mutations, since in the future we'll have to validate graph integrity at every step.