-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature request: Enable support for promises in typeORM when using Lazy loading #10
Comments
Thanks for bringing this to my attention, I was unaware that you could do lazy loading with Promise types. I added checking for Promises in #11. I am collecting the current issues into a bigger release, it will be out in a few days, I hope. |
Perfect, thanks, I will test it once it's released. |
I released v0.3.0, and added the Promise changes as a feature. Feel free to close if it works for you. |
@daniel7grant Unfortunately it's still not working. It gives this error:
for the code @Field(() => PowerTableGroup, { nullable: false })
@ManyToOne(() => PowerTableGroup, { nullable: false })
@JoinColumn()
group!: Promise<PowerTableGroup>; Note:When I remove the |
Are you sure that you are on the Do you know what the difference may be? |
My mistake. NPM was stuck and not updating |
Currently, the package is supporting types without Promises
And since this a relationship and according to TypeORM docs Lazy Loading to be able to load the relationship object you should mark the type as a promise. Like this:
And this is totally a valid and acceptable form and type, yet it shows this error:
Suggestion
The package should get the type inside the promise and check if it's the same as the type in the
Field
decoratorThe text was updated successfully, but these errors were encountered: