You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reacted by Christopher Ehrlich, Özüm Eldoğan, Jody Hoon-Starr, Kylegl, Maik Kowol, gkTim, Giannis Koutsaftakis, Eric Buxkemper, Heb, Isaac Way and 8 more
I think I just figured out I am in need of the this.
I am using trpc outside a component via: await trpc.products.list.query()) when I was searching for a way to set a timeout on the query but it seems there are only the options context and signal.
I am currently working around the issue with this:
importtype{FetchQueryOptions}from'@tanstack/query-core';importtype{QueryClient}from'@tanstack/react-query';/** * This is a temporary work around until we can use TRPC and Tanstack Query * outside React directly: * https://github.com/trpc/trpc/issues/3629 */exportconstqueryTRPCViaReactQuery=async<Qextends(arg: any,{ signal }: {signal?: AbortSignal})=>Promise<any>,>({
queryClient,
id,
query,
params =undefined,
options ={},}: {queryClient: QueryClient;id: string;query: Q;params?: Parameters<Q>[0];options?: FetchQueryOptions<any>;}): Promise<ReturnType<Q>>=>{constcontroller=newAbortController();constsignal=controller.signal;try{returnawaitqueryClient.fetchQuery([id,params],async()=>query(params,{ signal }),{
...options,});}catch(error){controller.abort();throwerror;}};
hi, is this still wanted? the issue is from 2023 and on current main it still is not there: @trpc/tanstack-react-query exists and is react-only. i'd actually extract a framework-agnostic adapter for vue/solid/core if you still want that. should i send a pr, or did the plan change?
Activity
jrmyio commentedon Feb 1, 2023
I think I just figured out I am in need of the this.
I am using trpc outside a component via:
await trpc.products.list.query())when I was searching for a way to set a timeout on the query but it seems there are only the optionscontextandsignal.What I really need are the options from
@tanstack/queryQueryClient:https://tanstack.com/query/latest/docs/react/reference/QueryClient
I guess this issue is exactly about this?
I am currently working around the issue with this:
[-]Generic TanStack Query Adapters[/-][+][TRP-57] Generic TanStack Query Adapters[/+][-][TRP-57] Generic TanStack Query Adapters[/-][+]Generic TanStack Query Adapters[/+]ArjunCodess commentedon Sep 20, 2026
hi, is this still wanted? the issue is from 2023 and on current main it still is not there: @trpc/tanstack-react-query exists and is react-only. i'd actually extract a framework-agnostic adapter for vue/solid/core if you still want that. should i send a pr, or did the plan change?
KATT commentedon Nov 2, 2026
🤖 This is happening in v12 (the
v12branch): one TanStack Query package plus experimental Solid, Vue, Svelte, Angular, Preact and Lit adapters. https://v12.trpc.io/v12/docs/integrations/tanstack-query. v12 isn't released yet and there's no ETA. Thanks @ArjunCodess for offering; v11 won't get this.