How to use the Dataloader correctly w/ Mongoose? #221
-
Hi there. I saw the official examples and the documentation but I still do not fully understand how to leverage the built-in dataloader to address a N+1 query issue when using the Mongoose adapter. We keep seeing N+1 queries even when pulling 1st-level connections. We did not provide |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 15 replies
-
I do not know much about the Mongoose one, but willing to take a look, could you share your code? |
Beta Was this translation helpful? Give feedback.
@TriPSs and @smolinari: I invested some time into troubleshooting why this wasn't working and finally figured it out. This was a bug in the implementation of the Mongoose adapter and there's a similar issue in the Typegoose adapter which I am not intending to fix myself but anyone's invited to fix it based on my fix which is here: #279
Can you please review?