const [editStatus, {data, loading, error}] = useMutation(EDIT_STATUS)
const submitNewStatus = () => {
editStatus({
variables: {
id: myId,
status: newStatus,
},
}).then((data) => {
client.writeFragment({
id: `User:${currentId}`,
fragment: gql`
fragment user on User {
status
}
`,
data: {
__typename: 'User',
status: data?.data.editStatus.status
}
})
})
}