Mohamed Khalil
07/15/2018, 8:22 AMRobert
07/15/2018, 9:28 AMMohamed Khalil
07/15/2018, 9:32 AMMohamed Khalil
07/15/2018, 9:32 AMRobert
07/15/2018, 9:44 AMgraphql playground
locally you can access your server and the Prisma instance. graphql
reads your .graphqlconfig.yml
to see what projects you have. I'd wait for someone with more expertise than me to answer this, because I'm not sure if you can and would want to have the Prisma instance accessible on your public endpoint.Mohamed Khalil
07/15/2018, 9:46 AMMohamed Khalil
07/15/2018, 9:47 AMMohamed Khalil
07/15/2018, 9:55 AMRobert
07/15/2018, 9:55 AMWhy not just use the Prisma GraphQL API directly?
Prisma really only is an interface to a database. If you consumed the Prisma API directly from your frontend or mobile applications, this would be similar as directly accessing a database.
In very, very rare cases, this might be an option - but the vast majority of applications do need additional logic that is not covered by CRUD operations (data validation and transformation, authentication, permissions, integration of 3rd-party services or any other sort of custom functionality…).
Another potential concern of directly exposing the Prisma API to your client applications is security. GraphQL works in the way that everyone who has access to the endpoint of a GraphQL API can retrieve the entire GraphQL schema from it - this is called introspection. If your clients were talking directly to Prisma, it would be simply a matter of checking the network requests to get access to the endpoint of the Prisma API and everyone would be able to see your entire database schema.
Mohamed Khalil
07/15/2018, 9:56 AMRobert
07/15/2018, 9:59 AMMohamed Khalil
07/15/2018, 10:51 AM