lib/write.js
function (graph, opts, params) {
    if (graph.children.length == 0) return '';

    function getRels(node) {
      var rels = [];
      node.children.forEach(function(childNode) {
        rels.push('(' + node.name + ')-[__rel_' + childNode.name + ':' + childNode.comp.rel + ']->(' + childNode.name + ')');
        rels.push.apply(rels, getRels(childNode));
      });
      return rels;
    }
    
    return 'CREATE UNIQUE ' + getRels(graph).join(',');
  }
function (graph, opts, params) {
    if (graph.children.length == 0) return '';

    function getRels(node) {
      var rels = [];
      node.children.forEach(function(childNode) {
        rels.push('(' + node.name + ')-[__rel_' + childNode.name + ':' + childNode.comp.rel + ']->(' + childNode.name + ')');
        rels.push.apply(rels, getRels(childNode));
      });
      return rels;
    }
    
    return 'CREATE UNIQUE ' + getRels(graph).join(',');
  }
function ( graph , opts , params ) { if ( graph . children . length == 0 ) return '' ; function getRels ( node ) { var rels = [ ] ; node . children . forEach ( function ( childNode ) { rels . push ( '(' + node . name + ')-[__rel_' + childNode . name + ':' + childNode . comp . rel + ']->(' + childNode . name + ')' ) ; rels . push . apply ( rels , getRels ( childNode ) ) ; } ) ; return rels ; } return 'CREATE UNIQUE ' + getRels ( graph ) . join ( ',' ) ; }
get the CREATE UNIQUE statement of a write query this will create the required relationships
get the CREATE UNIQUE statement of a write query this will create the required relationships