text: WITH RECURSIVE search_graph(id, link, data, depth, is_cycle, path) AS (
      SELECT g.id, g.link, g.data, 0,
        false,
        ARRAY[g.id]
      FROM graph g
    UNION ALL
      SELECT g.id, g.link, g.data, sg.depth + 1,
        g.id = ANY(path),
        path || g.id
      FROM graph g, search_graph sg
      WHERE g.id = sg.link AND NOT is_cycle
  )
  SELECT * FROM search_graph;
  