useInfiniteQueries example with skip instead of cursor #1307
-
Got a use-case where using prisma cursor isn't fitting, can i use the endpoint cursor input as a skip property instead...? |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
Yup, I've done that myself, just have something like It can also act as a page if you do |
Beta Was this translation helpful? Give feedback.
-
Got an other issue with that, ...data.pages seems to be an array of either `BaseRun[] | { items: BaseRun[]; nextCursor: number; }` Why is that? |
Beta Was this translation helpful? Give feedback.
-
I need to see your procedure to answer that |
Beta Was this translation helpful? Give feedback.
-
Here is my definition:
and the consumer:
|
Beta Was this translation helpful? Give feedback.
-
If you have access to our repo: https://github.com/invisible-tech/invisible/blob/5780f864b099e2563c52c872b264090cad62c598/apps/manticore/components/Base.tsx#L269 |
Beta Was this translation helpful? Give feedback.
-
Looks like you do an early return where you don't return |
Beta Was this translation helpful? Give feedback.
-
Oh yes thank you! sorry about that, my bad... |
Beta Was this translation helpful? Give feedback.
-
@KATT sorry to poke you again, have you ever tried to use getQueryData to get the infinite query cache? can't seem to get it to work... |
Beta Was this translation helpful? Give feedback.
Yup, I've done that myself, just have something like
cursor: z.number().min(0).default(0)
It can also act as a page if you do
limit*cursor