hey guys, I recently watched - <https://www.youtub...
# orm-help
r
hey guys, I recently watched -

https://www.youtube.com/watch?v=XI5Yj_FCyfE

which is a live coding session for prisma advertised on the graphql weekly mailing list. From my understanding, the way they use prisma + react doesn’t really make sense as they don’t have a wrapper api to wrap prisma. Is my thinking correct that you wouldn’t genereal expose a prisma api publicly as it is completely open. You would need to lock it down with a wrapper api and auth?
n
There is no business logic at all in this tutorial. One example would be she it not even writing resolver on the server level. She is just using basic crud operations. This is one of many tutorial out there and I don't think there is 'de facto' way of using prisma. You can expose your API or you can seperate your API in two parts like they do here https://www.howtographql.com/graphql-js/4-adding-a-database/ I actually enjoyed that tutorial that Sara did, one thing she says that Int! in graphql would be string and then she does some parseInt() to converted back to a number. So this is her state
state = {  age: ' ' }
If here initial state was just a number like this
state = { age: 0 }
n
Hey @ryannealmes, your points are very valid! For most apps, it’s not a production use case to have your frontend talk directly to Prisma but you’ll add the actual API server on top of it. We’ve a bit of information around that here: https://docs-beta.prisma.io/1.13/understand-prisma/prisma-introduction-what-why-how-j9ff/#how-does-prisma-fit-into-your-stack (check Architecture #3)
I think Sara’s tutorial is still very valid as it actually focussed on learning GraphQL on the frontend rather than on the backend (which is actually one of the use cases where talking directly to Prisma makes a lot of sense, but you’re right it’s indeed not a production use case)
r
thanks so much guys
👍 1
i missed that page in the docs