-
I am using Dynamodb and react-query and it works great as long as I have a small set of data and want all of it at once. But if I want to do a limit on what gets returned from dynamo with an It would more or less be the useInfiniteQuery I think - though dynamo does not work with paging the way other db's do. I also think maybe it should be a mutation to add to the original query but that doesn't sound right. Any examples that anyone can share, or tips to point me in the right direction? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
You should probably share how dynamo works with paging. Just mentioning that it works differently will not be enough to get anyone to help unless they have experience with that specific database ... |
Beta Was this translation helpful? Give feedback.
-
Dynamo uses LastEvaluatedKey to get the next batch, which I think will work. I just need to pass that to my api. I have the initial set loading, but what is being passed to my api doesn't make sense to me. I don't understand the example where it does:
I have changed that to
so that it will pass the LastEvaluated Key to my api but instead when I log what is passed in it is My fetchHistory is using axios like this:
console log in the api of the data is: I'm still new to fetching data and working with it, fairly sure I am just misunderstanding the example and what lastPage, pages means. here is a console log of the data in the app: |
Beta Was this translation helpful? Give feedback.
-
the result of
|
Beta Was this translation helpful? Give feedback.
-
yes! just figured that out a minute ago, I think I am almost there. |
Beta Was this translation helpful? Give feedback.
-
I got it working, thanks for your help! Here is what my api code is (NextJS):
and then I call it like:
as a newb trying to understand this:
which helped me to see that I needed to use |
Beta Was this translation helpful? Give feedback.
I got it working, thanks for your help!
Here is what my api code is (NextJS):