rallly/apps/web/src/utils/trpc/config.ts
Luke Vella 07bd33fa63
🧑‍💻 Switch to pnpm
2024-10-12 14:26:05 +01:00

27 lines
592 B
TypeScript

import * as Sentry from "@sentry/nextjs";
import { MutationCache } from "@tanstack/react-query";
import { httpBatchLink } from "@trpc/client";
import superjson from "superjson";
export const trpcConfig = {
links: [
httpBatchLink({
url: "/api/trpc",
}),
],
transformer: superjson,
queryClientConfig: {
defaultOptions: {
queries: {
retry: false,
cacheTime: Infinity,
staleTime: 1000 * 60,
},
},
mutationCache: new MutationCache({
onError: (error) => {
Sentry.captureException(error);
},
}),
},
};