Currently, when relationships are not loaded, it becomes undefined. How about we throw an error when accessing unloaded relationships?
const user = userRepo.find(1)
user.posts // Error('relationship is not loaded')
This might make it easier to catch errors where people forget to load them, and try to access it 🤔
Currently, when relationships are not loaded, it becomes
undefined. How about we throw an error when accessing unloaded relationships?This might make it easier to catch errors where people forget to load them, and try to access it 🤔