GraphQLGuide / apollo-datasource-mongodb

Apollo data source for MongoDB
MIT License
285 stars 64 forks source link

Include Model on createCachingMethods loader #30

Closed edgareler closed 4 years ago

edgareler commented 4 years ago

Similar to #28, but uses Model.find().exec() as promise, and checks if the collection parameter is Model.

lorensr commented 4 years ago

Is there a benefit to using exec?

edgareler commented 4 years ago

According to Mongoose docs, that gives you better stack traces.

lorensr commented 4 years ago

Sounds good, and thanks for the contribution! Would you mind adding a test to cover the new logic?

edgareler commented 4 years ago

Hi @lorensr, I've just included two new ID matchers to the existing tests, which basically covers the Model vs Collection issue.

lorensr commented 4 years ago

Thanks again! Published in 0.2.7