-
Notifications
You must be signed in to change notification settings - Fork 642
Closed
Labels
Description
Hi there,
Thanks for the awesome library. We recently upgraded to v2.1.3 and start using the skipFetched option to replace patterns like if (!person.children) person.$fetchGraph('children'). It works great in most cases but I found an edge case not working.
For codes like below, assuming:
- animal => person is a many-to-one relationship
- person => country is many-to-one, too
const animal = await Animal.findById(1);
// This line will fetch as expected
await animal.$fetchGraph('owner');
// This line will throw an error like "unknown relation "country" in an eager expression"
await animal.$fetchGraph('owner.country', { skipFetched: true });
// If I change the line above to `await animal.$fetchGraph('owner.country');`, it works
Please confirm if this is an issue of skipFetched. Thanks.