I'm working on 2 steps authentication with nexmo, I have a plan to realize this by graphl mutation because I have graphql API and I can't get to requestId value
Mutation: {
signUpFirstStep: async ( parent, { number }, { models, secret }) =>
{
const response = nexmo.verify.request({
number: number,
brand: 'Nexmo',
code_length: '4'
}, (err, result) => {
const requestId = result.request_id
return requestId
});
console.log(response); //right here I have undefined
}
}
All I want is to get requestId value to return it in the mutation