是否可以自动清除args?
...
@Mutation(returns => Ok)
async signup(@Args() args: args.GetSignupArgs ) {
sanitize(args);
const { name, email, password } = args;
const checkUser = await this.userRepository.findOne({ email })
...
答案 0 :(得分:0)
您应该可以通过注入全局中间件来做到这一点。参见:https://github.com/19majkel94/type-graphql/blob/master/docs/middlewares.md