graphql-compose / graphql-compose-mongoose

Mongoose model converter to GraphQL types with resolvers for graphql-compose https://github.com/nodkz/graphql-compose
MIT License
708 stars 94 forks source link

fix(discriminator): resolved issue with Model type #367

Closed Oluwatemilorun closed 2 years ago

Oluwatemilorun commented 2 years ago

Fixes #366

Stopped document interface from extending mongoose Document.

Based on Mongoose TypeScript documentation it is advised that document interface not extend Document. Using extends Document makes it difficult for Mongoose to infer which properties are present on query filters, lean documents, and other cases.

So, without extending Document mongoose handles the type casting for models.

nodkz commented 2 years ago

Thanks!

github-actions[bot] commented 2 years ago

:tada: This PR is included in version 9.5.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: