Open rafaneri opened 3 years ago
For those viewing this issue, a workaround is to call the .wrapResolve
method on the returned resolver, e.g.
UserTC.mongooseResolvers.createOne().wrapResolve((next) => async (rp) => {
// extend resolve params with hook
rp.beforeRecordMutate = async (doc: any, resolveParams: any) => {
console.log(doc, resolveParams)
};
return next(rp);
});
I'm trying to use wrapResolverResolve for an ObjectTypeComposer created using composeMongoose function, but I get the error:
But when I use the same but with a composeWithMongoose it works. (example bellow)