-
Notifications
You must be signed in to change notification settings - Fork 64
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
Typescript declaration for this
object
#82
Comments
I'm not sure—looks like it should be a |
Yes! I was testing and checking all the attributes of the Funnily enough, when using mongoose everything is very well defined, everything works like a charm. :) |
I've just run into this. The underlying problem seems to be that the code here creates an unintended dependency on mongoose. If you don't have mongoose installed in the project,
is treated the same as
Obviously, |
In |
I have mongoose and and apollo-datasource-mongodb Is there a better way of doing this? |
@GeorgGroenendaal Bit of a punt, but is your problem that I've tried to rejig the types to solve both issues but it's difficult. I think the underlying problem is a need for separation of concerns. The Mongoose datasource needs to be in a separate class, perhaps a separate package, from the MongoClient one. Just to make the typings work. But, giving it a lot of thought while using this package in anger for a couple of months, I'm beginning to conclude that a better solution might be a Data Source that works with any Data Loader and separate Data Loaders for MongoClient and Mongoose. Planning to give that a try soon, if I don't find one. |
Hello everybody this is my first time using this library and I'm wondering if there's a way to define the return type of the
collection
object instead of it returningany
Thanks in advance
The text was updated successfully, but these errors were encountered: