Hi there, I was wondering what everyone uses as RE...
# orm-help
b
Hi there, I was wondering what everyone uses as REST Api layer with Prisma lately. I was going for NestJS - but that framework seems to rely heavily on decorators and thus reflection - which in-turn is only available with classes. So you need to manually create DTO and Entity classes implementing (partial) types from PrismaClient. NestJS uses class-validator and class-transformer to validate HTTP request payload and to filter properties from HTTP response bodies. Even worse - class-transformer only works on instances of a class... and PrismaClient returns plain-old JavaScript objects (which I actually like a lot) It also requires classes to generate Swagger documentation (because of Reflection again) Looking for any kind of response here 😀
just saw this post basically asking the same question...
I know there is a dedicated channel for #nest-generator - doesn't seem ready yet
k
I also found the reliance on OOP techniques a bit much for my case since I'm just making a hobby project and not an enterprise business. If you're like me, I'd be hoping for a JS version of FastAPI in an ideal scenario
o
I quite simply use it with the next API routes as it is
d
Nextjs provides a full-stack structure so don’t need a dedicated backend
c
@Daniel Laera @Omar Hamdan Do either of you have experience with using GraphQL as an api route in NextJS? I keep seeming to run into various issues and am now wondering if it makes more sense to keep the GraphQL API in a separate repo.
a
fastify is really good, but the TS support is not top notch, and the way to write code is bit fastify-style, there is a bit learning curve to it
o
I don’t use that sorry. Unless using prisma counts. It has some of the features such as the ability to return custom sized objects with A smaller subset of fields.