Kimblis
Kimblis
Explore posts from servers
TtRPC
Created by Kimblis on 6/25/2024 in #❓-help
New versions doesn't fit the docs?
I just updated versions of my packages and now I get typescript errors that the my query doesn't fit with the types. It says that I'm missing initialData and queryKey for .useQuery() however docs says that the queryKey should be auto generated. No? My package versions:
"@tanstack/react-query": "^5.45.1",
"@trpc/react-query": "10.45.2",

"@tanstack/react-query": "^5.45.1",
"@trpc/react-query": "10.45.2",

Query example:
const { data: exercisesCountByDifficulty, isLoading: exercisesCountByDifficultyAreBeingLoaded } =
trpc.dashboard.getStationExercisesCountByDifficulties.useQuery(
{
stationIds,
},
{
refetchOnMount: false,
refetchOnReconnect: false,
refetchOnWindowFocus: false,
trpc: {
context: { skipBatch: true },
},
},
);
const { data: exercisesCountByDifficulty, isLoading: exercisesCountByDifficultyAreBeingLoaded } =
trpc.dashboard.getStationExercisesCountByDifficulties.useQuery(
{
stationIds,
},
{
refetchOnMount: false,
refetchOnReconnect: false,
refetchOnWindowFocus: false,
trpc: {
context: { skipBatch: true },
},
},
);
```
5 replies
TtRPC
Created by Kimblis on 6/6/2024 in #❓-help
Trpc in monorepo with microservices
Hello, so I have monorepo with multiple services. Each client currently has 1 backend for it so it was working well so far, however now I'm building new services (backend only) and I want to either contact them as well through my client (means 1 client should have multiple trpc clients) or my trpc servers should be able to communicate between themselves. What would be the preferable approach and are there any best practices developed on this front yet?
2 replies
PPrisma
Created by Kimblis on 3/22/2024 in #help-and-questions
Connecting relations misunderstanding
No description
1 replies
TtRPC
Created by Kimblis on 3/12/2024 in #❓-help
Subscriptions between different services
How do you make subscriptions to work between different services? For example if we have two different services- teacher and student, both have separate backend and frontend. Can we use redis or something similar so they would communicate correctly? Also it wouldn't work for multi instances for the same instances as well, right? If we save everything in the instance memory, or am I wrong?
2 replies
TtRPC
Created by Kimblis on 2/25/2024 in #❓-help
Sentry integration
Hello. I'm using trpc + fastify approach. I need a proper error loggin so I added fastify sentry, which works fine and logs the errors, however i'm missing some context- trpc data sent for the query/mutation, user information and etc. I would like to add that. Anyone had to deal with this before? So far can't find a decent solution for this, especially for retrieving the input.
5 replies
TtRPC
Created by Kimblis on 6/5/2023 in #❓-help
RateLimiter for fastify tRPC routes
Hi, I would like to add Ratelimiter to a specific fastify trpc route, are there any solutions available yet? Or do we need to write our own solution for this?
4 replies
TtRPC
Created by Kimblis on 3/19/2023 in #❓-help
trpc/react-query batching
Hi. How do you deal with batching? If I don't put any maxURLLength then I get an error 404 since it cuts of some of the requests urls... If I put url length then some requests just does not get executed since url is getting too long. I was thinking about max batching size however react-query does not have that... Any ideas on how to best deal with this?
5 replies
TtRPC
Created by Kimblis on 3/1/2023 in #❓-help
Issue with monorepo architecture ant tRPC
42 replies
TtRPC
Created by Kimblis on 12/1/2022 in #❓-help
Prisma+TRPC monorepo
Hey, so we have a monorepo with 3 backend services and 3 frontend services. It looks like the following: - Content frontend - Content backend - Teacher backend - Teacher frontend .... The problem we are facing: If we want from frontend to interact with 2 backends or from 1 backend to another backend. The easier example would be the second one. For example I try to communicate with content backend from my teacher backend. I get the errors when I try to build teacher backend since it knows only about the schema it has and the prisma client is being generated from that schema, so when it imports router from content backend- it goes through all routers and their imports, where they import things from content-backend prisma client (which looks different than teachers client :/ )
1 replies