-
-
Notifications
You must be signed in to change notification settings - Fork 96
Description
As I understand it, queries return fully instantiated Mongoose models by default. But you can override this if you just need the raw data, and don't plan on calling any instance methods, etc by using the lean option...
In my (limited) testing, it doesn't seem like that is supported in resolvers here..? I've tried both Model.find({ query }, null, { lean: true }) and Model.find({ query }).lean() but it seems to prevent me from querying relational data. (It's been a while since I tested, I'm only just now circling back to this. I can provide fuller examples/errors if needed).
In the past, on REST projects, I've noticed significant performance impacts when querying for multiple documents without lean, and in my current GraphQL project I'm thinking this may also be the reason for slow query times.
Thanks for any insight!