You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The validateDoc function used in many resolvers, e.g. updateById, createOne, found here will call doc.validateSync for mongoose >= v7. validateSync does not run asynchronous validators, and instead skips them. This leads to validation being silently skipped within this package.
Since validateDoc is an asynchronous function, and awaits for validations in mongoose < v7, it seems that there is no good reason to not await for validation in the >= v7 case as well.
Happy to make a pull request if the maintainers agree.
The text was updated successfully, but these errors were encountered:
The
validateDoc
function used in many resolvers, e.g.updateById
,createOne
, found here will calldoc.validateSync
for mongoose >= v7.validateSync
does not run asynchronous validators, and instead skips them. This leads to validation being silently skipped within this package.Since
validateDoc
is an asynchronous function, andawait
s for validations in mongoose < v7, it seems that there is no good reason to notawait
for validation in the >= v7 case as well.Happy to make a pull request if the maintainers agree.
The text was updated successfully, but these errors were encountered: