我正在使用nexmo进行两步身份验证,我计划通过graphl突变来实现这一点,因为我有graphql API并且我无法获得requestId值
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
}
}
我想要的只是获取 requestId 值以在突变中返回它