yeahh i might know the problem. lets see
yeahh i might know the problem. lets see your function and probably can fix it right away
26 Replies
can you post here
sure
i'm still looking. but one suggestion right of the top is.
you should only build query with your if and else and don't return the paginate after every condition. rather just build queries first and return at the end.
something like this
I tried, but I forgot the error message I received.
i can try you suggestion again
hmm, i think you should because maybe because you are returning with every condition so its re running the pagination again with filters in your if else and not loading the whole data.
Let me try it now, and I'll provide you with feedback on your suggestion.
👍
very basic query and
usePaginatedQuery
does not merge results
what does your frontend code looks like ?
can you try without extra params ?
okay
also try returning only results here ?
sure
same problem
isLoading in the usePaginatedQuery doesn't give you any error ?
ok so you mentioned something about infinite scrolling ? how are you managing that ?
infinite scroll
i'm testing something on my own right now
if i'm wrong after all this discussion. i'll be furious 😂
never faced issue with pagination
I'm interested in seeing your results.
this should mean it merges the results right?

so i'm also using infinite scroll in my code here
https://github.com/hamzasaleem2/queryquest/blob/main/src/components/qb.tsx
GitHub
queryquest/src/components/qb.tsx at main · hamzasaleem2/queryquest
Contribute to hamzasaleem2/queryquest development by creating an account on GitHub.
its mean i have bugs....
yep. there might be something related to how you are handling scrolling then ? maybe try console logging the results from usePaginatedQuery in useEffect after you loadMore
just to see if the results are growing
and then you can take reference from the queryquest above to see how infinite scrolling works in there.
sure...
yeah it grows....
there we go.re do your scrolling probably
Ugh, I'M SO FRUSTRATED WITH MYSELF!!! I just realized its MY OWN MISTAKE!!!
Calling loadMore() sets the isLoading state to true.
I owe you one! Thanks for the help!
Hi @Hmza I was looking at your code because I'm trying to do something similar in my own code (i.e. building a query based on the args) but I'm running into TS errors
How would I type the
queryBuilder
to make sure the intermediary OrderedQuery
and QueryInitializer
types are accounted for?