-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
startFrom
parameter
#10
Comments
Thanks @ahdinosaur !
Yes and no. Basically we could just pass that parameter down to I don't know how GraphQL interfaces with things like this, but I believe you could also take the output pull-stream and just "pull one at a time", e.g. how I do with pull-flat-list (similar in spirit to pull-more). Can GraphQL keep the ssb-threads pull-stream output in memory? If it can, then what I just suggested would work well. If not, there is a simple method that you can apply as a post-processing step after ssb-threads returns: pull(
ssb.threads.publicSummary(),
pull.skip(cursor),
pull.take(1)
) Where |
no that's good, this is what we want! 🙆 the next step is to know the latest sequence number (furthest away from the starting sequence number) processed by the query, so we could know what to ask for next (after we take some amount of items from the query and end the pull stream). |
the original use case i have in mind first is to just control where the stream starts, so we don't fetch anything more until the user clicks through an "update" button of sorts (or pulls down for more). but i can imagine proper pagination using sequence numbers to be a more complex beast, since posts in a thread can be all over the show. so i might need to give that more thought, and see how Piet did that in |
yeah i'll give this more thought before i ask anything more. thanks for your response @staltz ! 🌻 |
hi, first of all, this module looks very impressive, thanks y'all for the good work. 😺
i haven't begun to use this module yet, but was scoping the usage, and had a question:
would
ssb-threads
methods be able to accept astartFrom
parameter (a sequence number to start from), to be passed down tojitdb.operators.paginate
?when requesting Scuttlebutt threads over a non-streaming interface, i see sequence numbers being very useful as cursors. for example, this is how we did
ssb-patchql
. so this is what i'm looking to do for a new GraphQL interface i'm playing with. would it be possible to use sequence numbers to start the streams inssb-threads
?cheers 💜
The text was updated successfully, but these errors were encountered: