-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
lazy loading, many-to-one, querying on the wrong entity id. #234
Comments
when you can
then it will load all lists of all users. That's why this id exist. Do you have problems with this query? Is result incorrect or something else? |
@pleerock The problem is I am only getting one list because |
It is not accidentally repeat my problem #191? |
@Fokir Thanks for pointing that out. I'll see if the alpha version fixes this later today. |
It does version 0.0.7-alpha.8 (or alpha.25, or 0.0.7, or 0.0.8) does not appear to fix my issue. I am going to update the issue now |
fixed and released in |
…rectly from one-to-many and many-to-many sides"
I updated the details below after further investigation
I am having an issue where I am lazy loading a relationship, but a where an the wrong entity id is being queried
executing query: SELECT "lists"."id" AS "lists_id", "lists"."name" AS "lists_name", "lists"."owner" AS "lists_owner" FROM "shopping_list" "lists" INNER JOIN "user" "User" ON "User"."id"="lists"."owner" WHERE "lists"."id"=$1 -- PARAMETERS: [1]
Should just be
executing query: SELECT "lists"."id" AS "lists_id", "lists"."name" AS "lists_name", "lists"."owner" AS "lists_owner" FROM "shopping_list" "lists" INNER JOIN "user" "User" ON "User"."id"="lists"."owner" WHERE "user"."id"=$1 -- PARAMETERS: [1]
If I don't lazy load and use add the join to the repo.findById (everything works fine)[https://github.com/ericwooley/graphql-typeorm-passport-boilerplate/blob/master/src/graphql/queries/user.ts#L6]
I have a user class, with a lazy loaded one to many relationship:
and a class for ShoppingList
I cannot figure out for the life of me, why this where clause is being added. Maybe it's something dumb I am doing, but I have tried messing with it every way I can think of.
The text was updated successfully, but these errors were encountered: