Answer the question
In order to leave comments, you need to log in
How to send a bug report from apollo-server?
in apollo-react I use hooks useMutation.
apollo-react
const [addTodo, { loading, error, data }] = useMutation(gql);
Mutation: {
signUp: async (_, formSignUp, { models: { User }, res }) => {
try {
const user = new User(formSignUp);
await user.save();
const token = await user.generateAuthToken();
res.cookie("darkAmasia", token, {
httpOnly: true
});
return "string";
} catch (error) {
?????????
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question