This worked
CREATE QUERY sort_edge_attribute_value() FOR GRAPH workflow_graph SYNTAX v3 {
TYPEDEF TUPLE <src_node_id INT, dst_node_id INT, weight FLOAT> myTuple;
HeapAccum<myTuple>({heap_size}, weight ASC) @@sorted_edges;
res = SELECT s FROM (s:Node)-[e:Edge]-(t:gsbNode) ACCUM @@sorted_edges += myTuple(s.node_id, t.node_id, e.weight);
PRINT @@sorted_edges;
}
Here heap size represents the number of rows we need to sort.
I wonder though, why this roundabout way of sorting edges when sorting nodes is so easy. Cypher allows sorting both nodes and edges very easily