Allow down casting query trail interface and union types #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is part of fixing
davidpdrsn/juniper-eager-loading#15.
In order to perform eager loading on a
Vec<User>
you need to knowwhich associations are being queried. The
QueryTrail<User, _>
type hasthat information.
However, this doesn't work for interfaces since if you have an interface
called for example
Entity
you will not get aQueryTrail<User, _>
butinstead a
QueryTrail<Entity, _>
. That doesn't work to eager loadusers, which means you cannot eager at all. This is because
Entity
isan enum with a variant for each type that implements that interface.
With this change we also generate implementations of
Into
forQueryTrail<Entity, _>
into each type that implements it. That allowsyou get a
QueryTrail<User, _>
to do eager loading with.TODO: