【发布时间】:2020-01-04 01:48:49
【问题描述】:
我在 react 项目中使用 useMutation 钩子。突变成功运行,但之后没有达到 onCompleted 。
我已在突变中将 notifyOnNetworkStatusChange 设置为 true,但这似乎没有帮助。
const [createUser] = useMutation(SIGNUP_MUTATION);
createUser({
variables: {
firstname,
lastname,
email
},
notifyOnNetworkStatusChange: true,
onCompleted: (data) => {
// not called
confirm(data);
}
});
【问题讨论】: