i have requests to fetch comment and post data, but i’m struggling to work out how to build a tree from the responses? do i fetch comments with arg parent_id to get a comment’s children, and do so recursively for those comments returned that themselves have comments?

  • blawsybogsyOP
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    interesting question. do you mean because if you use limit, and as results are returned unsorted, you might end up with children comments without their parents? have you actually had a go using limit to fetch from your 1000s of comments?

    • shootwhatsmyname@lemm.ee
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Yep exactly, I tested it and I do end up with orphaned comments no matter what I set as “limit” or “sort” (as long as limit is less than the total amount of comments). It’s my guess that fetching a large list of comments would be slower than fetching a few, otherwise I’d just get all the comments in one go.