In this case, I go deep in apollo documentation and I have to return something like this.
authenticatedUser: (_, { input }) => {
const {email} = input;
const token = jwt.sign({ email }, process.env.SECRET_KEY, { expiresIn:'24h' });
return {token}
}
},
no like
return token
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…