GraphQLGuide / apollo-datasource-mongodb

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

Typescript error on super.intialize #80

Open Baptiste-Garcin opened 3 years ago

Baptiste-Garcin commented 3 years ago

I have a typescript error when I try to implement an initialize method in my dataSource

image

So either the doc is wrong or the type for this method is missing in the index.d.ts.

I am a typescript newbie so I don't really know the good way to fix it. Should the initialize method be define in you index.d.ts ? Does this error is normal and I should ensure the method exist before calling it ?

I can do a PR if we agree on the good way to do this

lorensr commented 3 years ago

Thanks for reporting! MongoDataSource's initialize function is always defined, so you shouldn't need to check. Adding to index.d.ts would be great, thanks ☺️