2021-09-27 14:47:55 +00:00
|
|
|
/**
|
|
|
|
* This file contains the root router of your tRPC-backend
|
|
|
|
*/
|
2021-10-07 15:43:20 +00:00
|
|
|
import superjson from "superjson";
|
|
|
|
|
2021-09-27 14:47:55 +00:00
|
|
|
import { createRouter } from "../createRouter";
|
|
|
|
import { viewerRouter } from "./viewer";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create your application's root router
|
|
|
|
* If you want to use SSG, you need export this
|
|
|
|
* @link https://trpc.io/docs/ssg
|
|
|
|
* @link https://trpc.io/docs/router
|
|
|
|
*/
|
|
|
|
export const appRouter = createRouter()
|
|
|
|
/**
|
|
|
|
* Add data transformers
|
|
|
|
* @link https://trpc.io/docs/data-transformers
|
|
|
|
*/
|
2021-10-07 15:43:20 +00:00
|
|
|
.transformer(superjson)
|
2021-09-27 14:47:55 +00:00
|
|
|
/**
|
|
|
|
* Optionally do custom error (type safe!) formatting
|
|
|
|
* @link https://trpc.io/docs/error-formatting
|
|
|
|
*/
|
|
|
|
// .formatError(({ shape, error }) => { })
|
2021-10-08 11:43:48 +00:00
|
|
|
.merge("viewer.", viewerRouter);
|
2021-09-27 14:47:55 +00:00
|
|
|
|
|
|
|
export type AppRouter = typeof appRouter;
|