Thursday 31 October 2019

GraphQL Questions (Prisma2)

Hi All,I've been looking into graphQL, particularly Prisma2 and have a few questions. I'm trying to get my head around the overall architecture, it's quite different to what I've worked with before (JSON APIs)[1] Business LogicIn a JSON API, I'd create an API endpoint to allow a user to sign up (this might kick off some async tasks and e.g. send an email).It seems like in graphQL architectures, mutations are used to provide the equivalent of an API endpoint, where business logic would be implemented (e.g. user sign up). Is this correct?I'm trying to understand how a system would be implemented without using express to provide API endpoints that would implement business logic and make calls to the graphQL layer via e.g. PhotonJS.[2] PhotonI understand that photon is a generated library to allow you easy access to your graphQL interface, but is this really only intended for usage on the server? Can this be exported to be used in e.g. an Angular 2+ project?It also seems that the generated photon client doesn't include mutations, so I'm a bit confused as to what the intent is with it.Any input would be useful :)Thank you!

Submitted October 31, 2019 at 11:55AM by seventai

No comments:

Post a Comment