T
tRPC

Getting data as "any"

Getting data as "any"

PPatrickJ6/10/2023
For some reason, probably after update I started getting following issue. My router is no longer typed and I cannot wrap my head why. Anyone have ideas?
PPatrickJ6/10/2023
It appears that tRPC is not able to handle all the queries coming from my typed graphql-request client (https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-graphql-request)
Nnlucas6/10/2023
Have you restarted the language server?
PPatrickJ6/10/2023
@Nick Lucas yes
Nnlucas6/10/2023
Got it, we’ll I would always start by checking that types are available in the api itself If not then it’s probably some change in your repo which is causing the types to not reach the client
PPatrickJ6/10/2023
If I return static value from that router I get the types
Nnlucas6/10/2023
Do you have an example of the types which are causing the problem? If you pop the result in a variable and return the variable what is the type of said variable? If that’s not any it may be a bug, would be useful to get some kind of reproduction Could also be that your project setup isn’t giving the client access to the types of the graphql client and so TS falls back on any
PPatrickJ6/11/2023
The type is not any when I assign it to variable in the router. I was changing typescript setup in my project, that might be related. I will look into that

Looking for more? Join the community!

T
tRPC

Getting data as "any"

Join Server
Recommended Posts
What is error formatingI understand error handeling but what is error formating , found it in trcp docs have'nt seen that twhere does opts.path and opts.type came from ? i guess by default it only stores ctx ,next and input```ts const loggerMiddleware = middleware(async (opts) => { const start = Date.now();   const rePassing objects to the next() function of the middle ware```ts // ------------------------------------------------- // @filename: context.ts // -------------opts object passed to mutation , i can not understand where it came from```ts export const authorizedProcedure = publicProcedure .input(z.object({ townName: z.string() })How do I log thrown errors from the query/ mutation on the server side globally?I was surprised to find that the server servicing tRPC requests do not log any thrown errors from a trpc with app dir nextjsHello im wondering how to use trpc with nextjs app router now?. I have t3 app but for now its a src/if I export 'appRouter' instead of 'router' I get errorhey everyone, I have this exact setup https://icflorescu.github.io/trpc-sveltekit/getting-started I React Native/Expo: Uncaught Error: No QueryClient set, use QueryClientProvider to set oneFound this issue but it just says to use patch-package, I was wondering if there was any changes sinAll values in DecoratedProcedureRecord are of type anyI've stumbled across an issue and I'm not sure how to start diagnosing it... Basically in my IDE tDetecting batch queries/mutations on the server-sideHello all, Looking to leverage batching as a means to streamline some of our cross-service requests,VS Code becomes unresponsiveHello everyone, I've started to experience huge performance issues with my project that's based onMiddleware-ish for clientHi! I had a quick question about client-side usage: I have users with long-running sessions, and iWhy cannot I specify a mutation input with useQueryKey?It's supported with queries, but for some reason not with mutations. Why is this the case?how to connect trpc server (t3 stack) from my external nextjs app?how to connect trpc server (t3 stack) from my external nextjs app?trpc.legacyRouterName.procedure "does not exist" on type CreateTRPCNextBase, runs anywayHave reached the end of a massive trpc 9 -> trpc 10 migration, executed using the official guide witNot getting legacy router ops in merged tRPC 9 routerFollowed the guide to merge my large tRPC 9 router with tRPC 10, but now I can't use useQuery or acccreateTRPCNext Type Error + useQuery Not DefinedI'm trying to use the conventions for `createTRPCNext ` from https://github.com/trpc/examples-next-pRead response headers on the clientIve been searching for a while trying to figure out how to access response headers on the client. FoIs it possible to access context in input?Hi, I have a validator that requires to get context of prisma in the `input`, Is it possible to get TRPCContextState not found in v10In our v9 app, we used TRPCContextState from internals to type out TRPC utils, importing it like `im