I was trying to check the arguments of the updateQueries function to update the component's props with the new information, but it seems that the function is not being called, any idea why?
mutation toggleTodo($id: ID!) {
toggleTodo(id: $id) {
completed
}
}
const withMutations = graphql(TOGGLE_TODO_MUTATION, {
props: ({ ownProps, mutate }) => {
return {
onTodoClick: id => mutate({
variables: { id },
updateQueries: {
toggleTodo: (prev, { mutationResult }) => {
console.log(prev);
console.log(mutationResult);
return prev;
}
}
}),
todos: getVisibleTodos(ownProps.todos, ownProps.filter),
...ownProps
};
}
});