\n\n\n\n### Link to reproduction\n\nNot Needed\n\n### To reproduce\n\nfetch an query on the server and the error type is messed up\n\n### Additional information\n\n_No response_\n\n### 👨👧👦 Contributing\n\n- [ ] 🙋♂️ Yes, I'd be down to file a PR fixing this bug!",[3215],{"name":3205,"color":3206},6956,"bug: since TRPC v11.5.0 errors on createTRPCOptionsProxy are broken and not typed properly","2025-09-22T23:38:43Z","https://github.com/trpc/trpc/issues/6956",0.6875976,{"description":3222,"labels":3223,"number":3227,"owner":3175,"repository":3175,"state":3177,"title":3228,"updated_at":3229,"url":3230,"score":3231},"### Describe the feature you'd like to request\n\nI wanna set a default global callback in trpc.\r\n\r\nFor example, i can has a default error alert tip if we throw error in request, or we have take mutation show operate success alert tip.\r\n\r\nNow, i have to set those in every where.\r\n\r\nI take a look of source code, its weird:\r\n\r\n- why only get default option with `getMutationDefaults` rather than `getDefaultOptions`?\r\n- why not append default option into `__useMutation` options?\r\n- in `mutationSuccessOverride`, why the `overrides` handler is higher priority than options callback in caller where define as `originalFn`?\r\n\r\nhttps://github.com/trpc/trpc/blob/42e6910cfb9f25ab12f522a3ede01a0078b5bc6d/packages/react-query/src/shared/hooks/createHooksInternal.tsx#L338-L370\n\n### Describe the solution you'd like to see\n\nSet in `trpc.createTRPCReact` \r\n```ts\r\nexport const trpc = createTRPCReact\u003CAppRouter>({\r\n overrides: {\r\n useMutation: {\r\n onSuccess: ()=> console.log('success'),\r\n },\r\n },\r\n});\r\n``` \r\n\r\nor in `new QueryClient` \r\n\r\n```ts\r\nexport const queryClient = new QueryClient({\r\n defaultOptions: {\r\n mutations: {\r\n onSuccess: () => console.log('success'),\r\n onError: () => console.log('error'),\r\n },\r\n },\r\n});\r\n```\n\n### Describe alternate solutions\n\nnone\n\n### Additional information\n\nI want to contribute code to implement this feature, but i cant understand why there logic is it.\r\n\r\nI'm not sure if this is intentional, can you give me some context?\n\n### 👨👧👦 Contributing\n\n- [X] 🙋♂️ Yes, I'd be down to file a PR implementing this feature!",[3224],{"name":3225,"color":3226},"✅ accepted-PRs-welcome","0052cc",4924,"feat: wanna default handle callback for `useMutation` in `react-query`","2025-03-20T15:41:58Z","https://github.com/trpc/trpc/issues/4924",0.69152373,{"description":3233,"labels":3234,"number":3235,"owner":3175,"repository":3175,"state":3236,"title":3237,"updated_at":3238,"url":3239,"score":3240},"### Describe the feature you'd like to request\r\n\r\nI'm using trpc inside nextjs app with external trpc server that uses `nestjs-trpc`. I want to have acces for both `query` and `useQuery` since `query` will be useful in react server components for fetching data on server and react query hooks will be useful for client components fe. infinite query pagination.\r\n\r\n### Describe the solution you'd like to see\r\n\r\nI would like to extend an existing trpc client with react query.\r\n\r\nExample:\r\n\r\n`trpc.ts`\r\n```ts\r\nimport { createTRPCClient, httpBatchLink } from '@trpc/client'\r\n\r\nimport type { AppRouter } from '../../api'\r\n\r\nimport { env } from './env'\r\n\r\nexport const trpc = createTRPCClient\u003CAppRouter>({\r\n links: [\r\n httpBatchLink({\r\n url: `${env.API_URL}/trpc`,\r\n }),\r\n ],\r\n})\r\n```\r\n\r\n`layout.tsx`\r\n```ts\r\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\r\nimport { httpBatchLink } from '@trpc/client';\r\nimport React, { useState } from 'react';\r\nimport { trpc } from './utils/trpc';\r\nexport function App() {\r\n const [queryClient] = useState(() => new QueryClient());\r\n const [trpcClient] = useState(() =>\r\n trpc.createReactQueryClient(),\r\n );\r\n return (\r\n \u003Ctrpc.Provider client={trpcClient} queryClient={queryClient}>\r\n \u003CQueryClientProvider client={queryClient}>\r\n {/* Your app here */}\r\n \u003C/QueryClientProvider>\r\n \u003C/trpc.Provider>\r\n );\r\n}\r\n```\r\n\r\n### Describe alternate solutions\r\n\r\nMaybe add `.extend` and use it like this\r\n\r\n`trpc.ts`\r\n```ts\r\nexport const trpc = createTRPCClient\u003CAppRouter>({\r\n links: [\r\n httpBatchLink({\r\n url: `${env.API_URL}/trpc`,\r\n }),\r\n ],\r\n}).extend(createTRPCReact\u003CAppRouter>())\r\n```\r\n\r\nI just need any way to extend vanilla trpc client with react-query hooks.\r\n\r\n### Additional information\r\n\r\nhttps://discord.com/channels/867764511159091230/1290004736006946816\r\n\r\n### 👨👧👦 Contributing\r\n\r\n- [ ] 🙋♂️ Yes, I'd be down to file a PR implementing this feature!",[],6069,"closed","feat: Using `@trpc/client` and `@trpc/react-query` simultaneously ","2025-03-20T15:42:35Z","https://github.com/trpc/trpc/issues/6069",0.64922225,{"description":3242,"labels":3243,"number":3244,"owner":3175,"repository":3175,"state":3236,"title":3245,"updated_at":3246,"url":3247,"score":3248},"### Describe the feature you'd like to request\n\nOver the years of using GraphQL we always found that using query and mutation was pointless.\r\nWe just set all our quires to mutation.\r\n\r\nWe're using tRPC with the express plugin for a Flutter project, believe it or not is great tRPC even without the type completion is the best choice for any project; the tRPC playground gives great documentation.\r\n\r\nOne massive problem we have though is GET and POST requests from the mutation and query have different formats to get data.\r\n\r\nSo we set everything to POST with mutation and use body.\r\n\r\nPerhaps removing query, or just naming everything with query is better?\r\n\r\nOr maybe I'm wrong and you want to maintain GET for server logs? If that matters.\n\n### Describe the solution you'd like to see\n\n^^\n\n### Desribe alternate solutions\n\n^^\n\n### Additional information\n\n_No response_\n\n### 👨👧👦 Contributing\n\n- [ ] 🙋♂️ Yes, I'd be down to file a PR implementing this feature!",[],2653,"[idea] make distinction between queries & mutations optional","2022-09-09T11:01:54Z","https://github.com/trpc/trpc/issues/2653",0.6572609,{"description":3250,"labels":3251,"number":3185,"owner":3175,"repository":3175,"state":3236,"title":3258,"updated_at":3259,"url":3260,"score":3190},"When [doing updates optimistically](https://react-query.tanstack.com/guides/optimistic-updates), having a `context` value to roll back failed mutations with is crucial. Unfortunately, the `TContext` type used within React Query isn’t inferred in tRPC’s React Query client, and so the value of `context` will always be `unknown`, e.g. in `onError` handlers.\r\n\r\nProviding a fourth generic type parameter, `TContext`, to the underlying `useQuery` and `useMutation` hooks might help – please see the related code snippet for details: https://github.com/trpc/trpc/blob/39129c54eb9ede1542b4cd2093d85bf371cdfa8e/packages/react/src/createReactQueryHooks.tsx#L188-L223",[3252,3255],{"name":3253,"color":3254},"👉 good first issue","7057ff",{"name":3256,"color":3257},"wontfix","ffffff","Context type of queries and mutations isn’t inferred when using React Query","2022-10-05T00:09:26Z","https://github.com/trpc/trpc/issues/391",{"description":3262,"labels":3263,"number":3264,"owner":3175,"repository":3175,"state":3236,"title":3265,"updated_at":3266,"url":3267,"score":3268},"I am looking on how to enable ReactQueryDevtools within trpc client.",[],1253,"enabling ReactQueryDevtools? ","2021-11-14T02:09:51Z","https://github.com/trpc/trpc/issues/1253",0.6665407,["Reactive",3270],{},["Set"],["ShallowReactive",3273],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fnyzN6nWbgSeTzQ58--yf_mP2VN9_ETvT0RJNFMvtIn4":-1},"/trpc/next-13/2"]