-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
fix: empty entity when query with nested relations #7450
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
fix: empty entity when query with nested relations #7450
Conversation
…into empty-entity-with-subrelations
|
I've been running the tests a few times and there has always been some kind of issue with databases like |
|
I just checked this out and ran |
|
I guess as you did not add any documentation that is the reason you did not tick |
|
@DerMolly that’s exactly the reason I didn’t tick it. I think there is nothing to document here. |
|
Maybe one of the devs could clarify what should be done to get this PR merged? |
|
Perhaps @AlexMesser knows the answer to that? |
|
thank you for contribution! |
|
Is this already released? |
|
@lovetodream Yes, since 0.2.32 |
|
@filipw01 ok, it doesn't seem to work when using custom many-to-many relations. I am still getting the empty objects when including those into relations. Can this be true or might this be an issue on my site? |
|
@lovetodream See the tests done if they cover your case, https://github.com/typeorm/typeorm/pull/7450/files . This was my first and only contribution so far so I'm not that competent with typeorm to answer your question. |
Closes: #7041
Description of change
If there is a nested join for example User->OrganizationMembership->Organization and there is no OrganizationMembership for an User currently
the new behavior
Example old
User{id: "1", name: "me", membership: {id: null, organization: null}}
User{id: "1", name: "me", membership: [{id: null, organization: null}}]
Example new
User{id: "1", name: "me", membership: null}
User{id: "1", name: "me", membership: []}
Fixes #7041
Fixes #3163
Fixes #3145
Pull-Request Checklist
masterbranchnpm run lintpasses with this changenpm run testpasses with this changeFixes #0000