System:
OS: macOS 26.4.1
CPU: (12) arm64 Apple M3 Pro
Memory: 129.14 MB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.4.1 - /Users/tmk/.local/share/mise/installs/node/24.4.1/bin/node
npm: 11.4.2 - /Users/tmk/.local/share/mise/installs/node/24.4.1/bin/npm
pnpm: 10.33.2 - /Users/tmk/.local/share/mise/installs/node/24.4.1/bin/pnpm
bun: 1.3.13 - /opt/homebrew/bin/bun
Deno: 2.7.14 - /opt/homebrew/bin/deno
Browsers:
Chrome: 147.0.7727.138
Safari: 26.4
npmPackages:
@tanstack/react-query: ^5.100.9 => 5.100.9
@trpc/client: ^11.17.0 => 11.17.0
@trpc/server: ^11.17.0 => 11.17.0
typescript: ^6.0.3 => 6.0.3
import { QueryClient } from '@tanstack/query-core';
import { createTRPCClient } from '@trpc/client';
import { initTRPC } from '@trpc/server';
import { createTRPCOptionsProxy } from '@trpc/tanstack-react-query';
const t = initTRPC.create({
isServer: true,
});
const appRouter = t.router({
foo: t.router({
bar: t.procedure.mutation(() => {
return 'hello';
}),
}),
});
type AppRouter = typeof appRouter;
const trpcClient = createTRPCClient<AppRouter>({
links: [],
});
export const trpc = createTRPCOptionsProxy<AppRouter, { keyPrefix: true }>({
client: trpcClient,
queryClient: new QueryClient(),
keyPrefix: 'ns',
});
console.log(trpc.foo.bar.mutationKey()); // [ [ 'ns' ], [ 'foo', 'bar' ] ] ✅
console.log(trpc.foo.bar.mutationOptions().mutationKey); // [ [ 'foo', 'bar' ] ] ❌
Provide environment information
Describe the bug
mutationOptions().mutationKeydoesn't containkeyPrefixLink to reproduction
none
To reproduce
Additional information
No response
👨👧👦 Contributing