Flattening to get unique nodes within n steps

This serves?


{
  var(func: eq(name, "NodeA"))@recurse(depth: 140, loop: true) {
    G as borders
  }
  
  test(func: uid(G), orderasc: name) {
    n: name
  }
}
{
  "data": {
    "test": [
      {
        "n": "NodeA"
      },
      {
        "n": "NodeB"
      },
      {
        "n": "NodeC"
      },
      {
        "n": "NodeD"
      },
      {
        "n": "NodeE"
      },
      {
        "n": "NodeF"
      },
      {
        "n": "NodeG"
      },
      {
        "n": "NodeH"
      }
    ]
  },
  "extensions": {
    "server_latency": {
      "parsing_ns": 47074,
      "processing_ns": 14195219,
      "encoding_ns": 607901
    },
    "txn": {
      "start_ts": 1781,
      "lin_read": {
        "ids": {
          "1": 2640
        }
      }
    }
  }
}
2 Likes