Maybe stupid question, but I just can’t figure this out
Let’s use this simple example…
I want to query first user, and populate his pets information from relation model.
const user = await User.query().with('pets').first()
Now, for some reason I want to console.log first pet name… But I can’t do something like:
After calling toJSON on user, user.pets is possible to console log. How to achive this without serializing to json?
If you ask yourself why I don’t want to call toJSON, imagine if Pet model had get hidden method inside model which is hidding pet name…