Skip to content

Commit

Permalink
fix: try to fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
QuiiBz committed Dec 17, 2022
1 parent 34519ad commit c2fddff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/client/src/createTRPCClient.ts
Expand Up @@ -18,7 +18,7 @@ export function createTRPCClient<TRouter extends AnyRouter>(
return [httpBatchLink(opts)];
};
const client = new Client<TRouter>({
transformer: opts.transformer,
...opts,
links: getLinks(),
});
return client;
Expand Down
12 changes: 10 additions & 2 deletions packages/client/src/internals/TRPCClient.ts
Expand Up @@ -27,21 +27,29 @@ import {
type CreateTRPCClientBaseOptions<TRouter extends AnyRouter> =
TRouter['_def']['_config']['transformer'] extends DefaultDataTransformer
? {
transformer?: 'You must specify a transformer in your backend router';
/**
* Data transformer
*
* You must use the same transformer on the backend and frontend
* @link https://trpc.io/docs/data-transformers
**/
transformer?: 'You must set a transformer on the backend router';
}
: TRouter['_def']['_config']['transformer'] extends DataTransformerOptions
? {
/**
* Data transformer
*
* You should use the same transformer on the server and client
* You must use the same transformer on the backend and frontend
* @link https://trpc.io/docs/data-transformers
**/
transformer: TRouter['_def']['_config']['transformer'];
}
: {
/**
* Data transformer
*
* You must use the same transformer on the backend and frontend
* @link https://trpc.io/docs/data-transformers
**/
transformer?: ClientDataTransformerOptions;
Expand Down

0 comments on commit c2fddff

Please sign in to comment.