hi, i wonder what's the best way now to integrate ...
# orm-help
s
hi, i wonder what's the best way now to integrate prisma with graphql? i know that prisma 2 is just a query engine now and not like the old days and some graphql operation is offloaded to something like nexus but it just feels unnatural
n
Hey @stevefan1999 👋 there's not really a "best way" I think, but you can really use your preferred GraphQL library and use Prisma as an ORM when building out the server. This work with SDL-first approaches as well as code-first with Nexus or TypeGraphQL 🙌 Also, maybe you find some more helpful context here: https://www.prisma.io/graphql prisma rainbow graphql
s
i understand, but using either nexus or TGQL is not directly integrating with prisma 2...
also the typescript query client can only be used in server, i.e. no client side/mobile code right?
j
Not having any layer in the middle is typically a bad idea, since this means that you have no authorization layer. Even Prisma 1 highly recommended putting GraphQL Yoga in front of the Prisma server
👍 1
n
There are also some integration libraries for both TypeGraphQL and Nexus that allow you to auto-generate GraphQL models and CRUD resolvers. Maybe that's more what you're looking for?
also the typescript query client can only be used in server, i.e. no client side/mobile code right?
Yes, Prisma 2 doesn't have a native GraphQL layer any more but really is "just an ORM", therefore you'd always need to use another GraphQL server library on top of it 🙂
l
I've got the same question. I started a project using nexus and nexus-plugin-prisma. Basically you can define your schema using nexus and automatically generate types/queries for your models using the
nexus-plugin-prisma.
But I am not sure if this is a good choice to build a production. Honestly I had the feeling that the project is on lack of documentation and the based on the number of issues/replies on the repository I assume the maintainers are busy at the moment. I would be keen to hear more if anyone is using this in production
r
@Lucas 👋 You’ll find people using Prisma + Nexus in the #showcase channel.