I am curious how you stored it schemawise
# orm-help
c
I am curious how you stored it schemawise
e
I will soon be diving into setting up a similar schema. If you find a good method it would be nice to hear.
c
I guess I am just going to be doing something like
Copy code
Post {
Comments: [Comment!]!
}
Copy code
Comment {
    parentComment: commentID,
    commentText: String,
}
I guess? something along those lines
e
What about doing:
Copy code
Comment {
    parentComment: Comment!,
    commentText: String,
}
Then the relationship is clear, and if a comment is deleted the children can automatically be cascade deleted as well.
c
yea, what you wrote is actually what I meant to write
it should definitely be a relationship, not stick the id in there
I just wrote it by hand into the slack window haha
e
Cool to hear back if you encounter any challenges with this approach. I will probably be testing it out myself in a few weeks as my project progresses.
c
sure ill let you know, I doubt I will see issues initially, my concern is scaling as comment threads get large with a lot of reads
👍 1
a
Then you should have two distinct types of comments. I.e: a
Comment
can have a field
replies: [Reply]
but replies do not have anything else but the content of the reply itself
That will ensure that your threads will only grow linearly in comments