1 year ago
#364871
pedrosc94
Problem reading from rest api with autogenerated BigInt Id
I'm having some issues with my rest api when I try to read from database. My server stack right now is NestJS + Prisma + Cockroachdb
At first when I generated a new User, with a POST, all went great and got it to go to my database. But when I tried to read from it it went really wrong and gave me an error, saying that couldn't serialize a BigInt.
I googled a lot and found a fix for it ('json-bigint-patch'), but now instead of getting an error it just returns me 'null'.
Later I found out if I manually change the autogenerated ID for a smaller number, I get the result as I was expecting.
So right now I'm stuck with this and I dont know how to solve this issue.
Thanks for your help in advance
Note: I'm really new at all this
typescript
nestjs
prisma
bigint
cockroachdb
0 Answers
Your Answer