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

Current version incompatible with mongoose v6 #371

Closed JacquesLoubser closed 3 years ago

JacquesLoubser commented 3 years ago

Not an expert here.

When trying to use the latest graphql-compose-mongoose with latest mongoose (now v6 as of ) I get the following error: Right-hand side of 'instanceof' is not an object

The issue comes from the mongoose.Schema.Types.Embedded object that seems to no longer exist in mongoose v6. https://github.com/graphql-compose/graphql-compose-mongoose/blob/c2449a99cf1a4547619d414d405aa99b98630a18/src/fieldsConverter.ts#L281

Can confirm the downgrading mongoose to v5 resolved the issue.

canac commented 3 years ago

It looks like mongoose.Schema.Types.Embedded was renamed to Subdocument in https://github.com/Automattic/mongoose/issues/10419.

nodkz commented 3 years ago

@JacquesLoubser thanks for reporting @canac thanks for investigation

the new version will support both v5 & v6 🎉

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 9.6.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: