I have implemented the Cognito user creation with aws sdk. I can create user i the pool without any issue, Please advice me what is the return type I have to use in the
@Mutation(() =>
resolver,
@Mutation(() =>, {name:"Signup"})
async signUp(@Args('Signup') authRegisterRequest: RegisterRequestDto):Promise<any>{
try{
return await this.authService.signup(authRegisterRequest);
}catch(error){
throw new HttpException(error.message, 400)
}
}
Service class signup function,
const cognito = new CognitoIdentityServiceProvider()
const result = await cognito
.signUp({
ClientId: this.configService.get<string>('AWS_COGNITO_CLIENT_ID'),
Password: password,
UserAttributes: [
{
Name: 'email',
Value: email
},
{
Name: 'name',
Value: name
},
],
Username: email
})
.promise();
return result;
I cannot find the correct type of return for the
@Mutation(() =>….., {name:”Signup”})
Please explain what is the return type I have to use here.