Skip to content

Commit 4097915

Browse files
authored
fix: trpc client helper bugs (#532)
1 parent 53621c8 commit 4097915

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

packages/plugins/trpc/res/client/next.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { type CreateTRPCNext, createTRPCNext as _createTRPCNext } from '@trpc/ne
66
import type { DeepOverrideAtPath } from './utils';
77
import type { ClientType } from '../routers';
88

9-
export function createTRPCReact<
9+
export function createTRPCNext<
1010
TRouter extends AnyRouter,
1111
TPath extends string | undefined = undefined,
1212
TSSRContext extends NextPageContext = NextPageContext,

packages/plugins/trpc/src/helpers.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ function getPrismaOperationTypes(model: string, operation: string) {
5353
switch (operation) {
5454
case 'findUnique':
5555
case 'findUniqueOrThrow':
56-
argsType = selectSubset;
57-
resultType = getPayload;
58-
break;
59-
6056
case 'findFirst':
6157
case 'findFirstOrThrow':
6258
argsType = selectSubset;
@@ -65,7 +61,7 @@ function getPrismaOperationTypes(model: string, operation: string) {
6561

6662
case 'findMany':
6763
argsType = selectSubset;
68-
resultType = getPayload;
64+
resultType = `Array<${getPayload}>`;
6965
break;
7066

7167
case 'create':

0 commit comments

Comments
 (0)