SileaThor
TTCTheo's Typesafe Cult
•Created by SileaThor on 12/4/2024 in #questions
Skip query: best strategy?
Hi, I've been searching the docs and previous posts and I can't find the answer.
What is the best strategy for skipping a query using the api from trpc/react?
let's say as an example, that i have a modal, where I want to fetch some data for it when is opened, and skip it if is closed. With tanStack query you can pas sin the skip token, but when using trpc/reat I can't find the way to pass in the skip token, any ideas?
like: const {data} = api.somEndpoint.someQuery.useQuery({someid}, {skip: true})
3 replies