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

correct typings for mongoose model

Open sojharo opened this issue 2 years ago • 4 comments

Types should not extend Document as per discussion in https://github.com/GraphQLGuide/apollo-datasource-mongodb/issues/88

sojharo avatar Sep 27 '22 13:09 sojharo

Hey @sojharo, sorry for the delay, and thanks for the contribution! Did you test the types manually for both MongoDB Collections and Mongoose Models? If you feel like an automated test (just running tsc on an example ts file), that would be helpful ☺️

lorensr avatar Oct 08 '22 22:10 lorensr

Hey, I had the library installed in my current project and went into node_modules folder to do the changes and then test with my current project. I was able to reproduce the issue and then solve it with these changes in index.d.ts which are in this PR. When I run the project, I compile it using sucrase-node library so it compiles the typescript to javascript.

sojharo avatar Oct 14 '22 19:10 sojharo

@lorensr Any progress on this PR ?

andrmaz avatar Jan 03 '23 23:01 andrmaz

Hey, yes. I had tested them with tsc and also tested it with my project by doing these changes directly inside installed version inside node_modules folder.

sojharo avatar Mar 01 '23 09:03 sojharo