Forum Discussion

allensmith81's avatar
15 hours ago

QraphQL Missing constraint on the messages collection

Hi all,

I am trying to create a system to pull all messages from a board posted in the last hour, can someone tell me what I am missing here.. There is no constraint for postTime.. I only want the new posts (depth 0) but that makes both of the other constrains useless as the feed would be polluted with messages surfaced because someone has commented on the original post...

 

 

4 Replies

  • MattV's avatar
    MattV
    Khoros Staff
    15 hours ago

    Post time is going to be a sort. So you can sort by that, then grab something like 10 or 20 at a time until you've reached 1 hour ago.

  • MattV​ 

    Yeah I figured that but that's very inefficient, I now have to pull down 100 records when I might only need 2.. Why is post time not a constraint?

  • MattV's avatar
    MattV
    Khoros Staff
    15 hours ago

    In classic/LiQL the post time constraint ended up being very inefficient, and even inaccurate with larger date ranges. So, assuming this omission is intentional in GraphQL, I'd say it was likely omitted because of similar reasons.

    I don't know the actual reason though; I'd have to confer with our internal dev teams to confirm the actual reason for post time not being a constraint.

  • If you could, it seems a bit daft that I either need to chunk the data into small enough firsts so I don't pull more records that necessary or that i have to process the data in our external cloud system and evaluate it for post time on my side.

    It also doesn't make sense that i can constrain upon conversation activity post time but not the original post time itself.