apollo-datasource-mongodb icon indicating copy to clipboard operation
apollo-datasource-mongodb copied to clipboard

Typescript error on super.intialize

Open Baptiste-Garcin opened this issue 3 years ago • 1 comments

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

Baptiste-Garcin avatar Sep 14 '21 15:09 Baptiste-Garcin

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 ☺️

lorensr avatar Sep 14 '21 16:09 lorensr