Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2021

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