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

Unexpected behaviour when upgrading to mongoose 6 with mutation resolvers #381

Open trollcus opened 2 years ago

trollcus commented 2 years ago

When updating a nested field with a updateOne resolver, all the other field in that same object field becomes null.

let's say we have:

basic_info {
size
email
}

when updating one of the fields, the other ones becomes null.

Had to downgrade to mongoose 5 for now as it's working as expected there.

steverogers180 commented 2 years ago

Send the whole document with an updated field. That's the only solution for now until someone fixes this.