-
Notifications
You must be signed in to change notification settings - Fork 142
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
[Bug] new release v0.18.1 broke relationships #493
Comments
@yeomann sorry about that, all my tests assumed the relationships were bi-directional. I'm working on a fix with tests to cover this use case in the future. |
Thank you @doug-martin waiting for the fix, appreciate your effort. |
I'm having this issue as well with uni-directional one-to-one relationships. I started working on a PR but have had only trouble getting tests to run locally. I did a quick fix by changing line 224 in const inverseEntityMetadata = relation.inverseRelation?.entityMetadata ?? relation.inverseEntityMetadata;
const fromPrimaryKeys = inverseEntityMetadata.primaryColumns.map((pk) => ({ and that got my project working. This could possibly be slimmed down to: const fromPrimaryKeys = relation.inverseEntityMetadata.primaryColumns.map((pk) => ({ as I am pretty sure |
Just issued a PR, @JeffSchofield you were spot on. Sorry I didn't get this out earlier, spent quite a bit of time writing tests and making sure that they failed with the old code, and didnt break anything else :) |
@yeomann @JeffSchofield just published Thanks for the bug report! |
Hi,
Thanks for the great library, we using Nx based multiple apps that extends some entity from core module in multiple Nestjs projects.
we had defined the relationships this way for example in user entity
After update to v0.18.1 graphql was broken on accessing the relationships and give the entitymetadata error.
we found the fix which is to write the second argument in like this
agent => agent.user
due to complexity of the app and sharing of entities from core to multiple nestjs projects, it not possible to pass the second argument in some cases, that is why we had to downgrade to 0.17.10
The above explained scenario was working until the update. It's seems a big bug to be honest.
Kindly can you please check it?
Thanks
The text was updated successfully, but these errors were encountered: