useQuery
response returns an object containing a json
key
#3421
-
A little confused about what I might be doing wrong here, but I'm using tRPC (v10.5.0) with Prisma (v4.7.1) on Next.js (v13.0.7) and when I call The endpoint response looks something like this: list: publicProcedure.query(() => prisma.product.findMany({...}); and in my component, I'm calling it like so: const query = trpc.dashboard.product.list.useQuery(); but when I log {
"json": [ ... ]
} Looking at the network call, it also looks like the [
{
"result": {
"data": {
"json": [
...
]
}
}
}
]
What might be the issue? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It seems like you've setup the data transformer on the server but not on the client https://trpc.io/docs/data-transformers |
Beta Was this translation helpful? Give feedback.
-
Note @KATT this same issue occurs when calling An object like this is returned |
Beta Was this translation helpful? Give feedback.
It seems like you've setup the data transformer on the server but not on the client https://trpc.io/docs/data-transformers