Skip to content

Commit

Permalink
move-transformer 2
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge authored Feb 15, 2024
1 parent 3af78ac commit 4851a61
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions cli/template/extras/src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ const getBaseUrl = () => {
export const api = createTRPCNext<AppRouter>({
config() {
return {
/**
* Transformer used for data de-serialization from the server.
*
* @see https://trpc.io/docs/data-transformers
*/
transformer: superjson,

/**
* Links used to determine request flow from client to server.
*
Expand All @@ -40,6 +33,12 @@ export const api = createTRPCNext<AppRouter>({
(opts.direction === "down" && opts.result instanceof Error),
}),
httpBatchLink({
/**
* Transformer used for data de-serialization from the server.
*
* @see https://trpc.io/docs/data-transformers
*/
transformer: superjson,
url: `${getBaseUrl()}/api/trpc`,
}),
],
Expand Down

0 comments on commit 4851a61

Please sign in to comment.