Mutation
Mutation: {
signUp: (_, { res }) => {
try {
res.cookie("jwt", "token", {
httpOnly: true
});
return "Amasia";
} catch (error) {
return "error";
}
};
}
Apollo-clenet-react
const [addTodo, { loading, error, data }] = useMutation(gql);
const [formSignUp, setFormSignUp] = useState({
lastName: '',
firstName: '',
password: '',
email: '',
});
const change = e => {
const { value, name } = e.target;
setFormSignUp({ ...formSignUp, [name]: value });
};
When i make a request from react. Here is the answer I get from the server.
1)Data {"data": {"signUp": "Amasia"}}
Application
Well when I look in Application Cookies, it is empty.
What am I doing wrong Why are cookies empty?