tmy03
TypeError: queryClient.getMutationDefaults is not a function (it is undefined)
Hi!
There's not much code to show here, as I'm really not sure where the error actually occurs.
In my React component I have:
const { mutate } = api.story.create.useMutation();
This gives the following error:
ERROR TypeError: queryClient.getMutationDefaults is not a function (it is undefined)
Has anyone experienced the same? I can't find any good results on Google, so I guess it's not a typical issue.
The is the first mutation I've tried to do. GET queries are working just fine.5 replies
Help to understand how and when to use tRPC in larger projects
Hi!
I'm pretty sure the answer to my question is that tRPC is not suitable for this project, but anyway I would like a second though and perhaps also some inspiration to what kind of projects it is suitable for.
I'm soon bootstrapping a project where I'll have multiple webapps (NextJS) and possibly iOS/Android (React Native) which consumes API(s) (Express/Fastify?) that talks to one or more databases (Prisma) and third party APIs. The API/functionality is fairly large, so it would make sense to not make a huge monolith but aim for something between microservice/macroservice architecture. The API also needs to be "public", so I've had a look at trpc-openapi.
Given this, I've thought about solving it like so:
"Consumer facing apps" -> BFF -> APIs -> Databases
Where would tRPC fit in this solution?
1 replies