[build][js] fix graph rules builder