I am new to .<prisma.io>, and graphql, I have prev...
# orm-help
c
I am new to .prisma.io, and graphql, I have previously used ROR and .net , my question is where do you put your business logic when using Graphql to replace a rest api?
e
Inside resolvers https://www.prisma.io/docs/tutorials/build-graphql-servers/misc/resolver-patterns-eifeecahx4/ above the return statement you can do whatever you want
c
I appreciate the reply. just we are on the same page
if I was building say an app that is a calculator, I would have one revolver for Add, Minus , multiply etc
?
e
Yes
Of course you could manage that with only one resolver and pass arguments into the resolver that tells the resolver what to do but that wouldn't be so clean(at least in my opinion) and that would be against the SOLID principle
You can imagine resolver as functions that get executed on certain events you want them to be executed. They even are just functions
c
Fantastic, that is very clear , thank you !
👍 2