-
Notifications
You must be signed in to change notification settings - Fork 98
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
Error upgrading from 1.0.7 -> 1.0.8: cannot preload associations in subquery in query #97
Comments
Hey @davidye can you provide more info? Can you show your loader file? |
@benwilson512 I have schemas User and and UserProfile and querying for user, I preload UserProfile. So in my resolver:
So dataloader calls Accounts.query(...) with [load: :profile] and that constructs a standard Ecto query of this form:
Also just noticed there's more error output - did something change with the way dataloader constructs ecto queries in 1.0.8?
EDIT: Looks like there's been some changes to preload behavior in lib/dataloader/ecto.ex which maybe related? @mbuhot |
@davidye yes the presence of the limit/offset in the query is causing it to use a new code path that runs your query as a lateral subquery. To fix this specific issue we could update the code to not use the I'll have to do some experimenting to figure out how to support preloads generally. |
Fixed in #98 |
Upgraded to 1.0.8 of dataloader and am getting this error now:
Didn't see anything mentioned in the changelog about this - happy to dig in and provide more information if helpful!
The text was updated successfully, but these errors were encountered: