Skip to content

Conversation

@Oluwatemilorun
Copy link
Contributor

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.

Stopped document interface from extending mongoose Document
@nodkz nodkz merged commit c7ee449 into graphql-compose:master Aug 22, 2021
@nodkz
Copy link
Member

nodkz commented Aug 22, 2021

Thanks!

@github-actions
Copy link

🎉 This PR is included in version 9.5.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type 'Doc' does not satisfy the constraint 'Document<any, any, any>' when using discriminators

2 participants