Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const TodoListFooter = props => {
const [user, functions] = useOssFragment(fragmentSpec, props.user);
const {todos, completedCount, totalCount} = user;
const completedEdges: $ReadOnlyArray =
todos && todos.edges
? todos.edges.filter(
(edge: ?Edge) => edge && edge.node && edge.node.complete,
)
: [];
const [mutate] = useMutation(mutation);
const handleRemoveCompletedTodosClick = () => {
RemoveCompletedTodosMutation.commit(
mutate,
{
edges: completedEdges,
},
user,