Adding edge nodes to the query logic