Hussam
Hussam
Explore posts from servers
TtRPC
Created by Hussam on 5/17/2023 in #❓-help
Suggested 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 .invalidate({ id: input.id }) // input.id is not known solutions tried - conditionally do invalidtion based on route
1 replies
TtRPC
Created by Hussam on 3/30/2023 in #❓-help
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
TtRPC
Created by Hussam on 3/7/2023 in #❓-help
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