-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement InclusionResolver for hasManyThrough relation #5946
Comments
(8-20-2020) Just to be clear, I have 2 tables (doctors, patients) and a many-many relationship between them using a hasManyThrough relationship, generated with the relation generator , does this mean that there is no way to get the relations between those 2 things via the controller? For instance, return doctors, and all their patients? Thanks in advance! Also sorry if this doesn't go here, just trying to understand what has been built yet! |
@cardea-fletcher Yes. Currently only the relation is implemented, which means you can get the related models based on the foreign key. But getting parent models together with their related models is not supported yet as this is done by the inclusionResolver. As a workaround you need to send 2 queries. |
When will this be published to npm ? |
@ErwSim hi, check for it early next week. |
Could you elaborate on how the workaround with 2 queries work ? I need 3 queries and then have to traverse over every object to link them together. Is there a better way ? |
@nabdelgadir Still not available ? 😥 |
@ErwSim hi, sorry for the delay, but check again next week 🤞 I'll post a comment here when it's available. |
@nabdelgadir : do you have an idea when this will be available? :) |
@ErwSim @SebastianDaehnrich there was just a new release, so it should be available now 😄 |
Yay, thanks @nabdelgadir |
Acceptance criteria
HasManyThroughRepositoryFactory
to provideresolver
property.packages/repository-tests
to verify that resolver works for real databases.The text was updated successfully, but these errors were encountered: