def METHOD_NAME(data: Json, graph: Graph) -> None:
    """Process a single line of resotocore graph data"""
    if data.get("type") == "node":
        node_id = data.get("id")
        node = node_from_dict(data)
        node_mapping[node_id] = node
        log.debug(f"Adding node {node} to the graph")
        graph.add_node(node)
        if node.kind == "graph_root":
            log.debug(f"Setting graph root {node}")
            graph.root = node
    elif data.get("type") == "edge":
        node_from = data.get("from")
        node_to = data.get("to")
        edge_type = EdgeType.from_value(data.get("edge_type"))
        if node_from not in node_mapping or node_to not in node_mapping:
            raise ValueError(f"One of {node_from} -> {node_to} unknown")
        graph.add_edge(node_mapping[node_from], node_mapping[node_to], edge_type=edge_type)