Hussam
Explore posts from serversSuggested way to invalidate queries on a component that is used on multiple pages.
Please suggest me a way I can handle the following situation in the best possinle manner.
Coinsider a Component
- used in multiple pages
- has mutations, which requires query invalidation on other components of the page.
- the query invalidation differes from page to page, if we invalidate everything that will be waste of network request. - I dont always have the key to invalidate the cache
- the query invalidation differes from page to page, if we invalidate everything that will be waste of network request. - I dont always have the key to invalidate the cache
.invalidate({ id: input.id }) // input.id is not known
solutions tried
- conditionally do invalidtion based on route1 replies
The inferred type of this node exceeds the maximum length the compiler will serialize.
Hey, there I am running into this error when I have more than 12 routers in the mergeRouters function.
The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
version: latest
related: https://github.com/trpc/trpc/issues/2568 // that din't work for me.19 replies
How to infer types of a query
Coinsider the example
const hello = trpc.hello.useQuery();
I would like to export the type we get on hover(on hello).
I could only find how to infer the data type from the docs
const { data } = trpc.hello.useQuery()
https://trpc.io/docs/infer-types using inferRouterOutputs
The reason I am passing everything and not just data as props down to components, is because I want to access the loading, error states etc.6 replies