GraphQLGuide / apollo-datasource-mongodb

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

fix: using mongoose Document model interface #98

Closed flaviotux closed 2 years ago

flaviotux commented 2 years ago

The extended mongoose Document will be dropped in the next major version.

We strongly recommend against using this approach, its support will be dropped in the next major version as it causes major performance issues. Many Mongoose TypeScript codebases use the below approach. - https://mongoosejs.com/docs/typescript.html#using-extends-document

It will correctly infer the model or collection TypeScript types when mongoose.

Interface

Captura de Tela 2022-06-19 às 20 40 56

Before

Captura de Tela 2022-06-19 às 20 41 30

After

Captura de Tela 2022-06-19 às 20 39 51