Neon
Neon10mo ago

Infinite query get direction info

Hello everyone, I'm implementing a bidirectional infinite query and i would need to access the direction param into my trpc endpoint: https://tanstack.com/query/v5/docs/framework/react/guides/query-functions#queryfunctioncontext. Is it possible to get this param passed in trpc procedure input with useInfiniteQuery? (for info i'm using trpc v11)
Query Functions | TanStack Query Docs
A query function can be literally any function that returns a promise. The promise that is returned should either resolve the data or throw an error. All of the following are valid query function configurations:
1 Reply
Anatol Zakrividoroga
trpc automatically passes the direction as direction: z.enum(["forward", "backward"])