Hi there! The source of truth of GraphQL is not schema.prisma, but the GraphQL endpoint powered by Nexus.
You still need to clearly define how the GraphQL schema looks like (eg. object types), because of security (you don't want to expose everything from your DB, think ID and password) and flexibility (you can write your own resolver instead of being restricted to basic CRUD operations on the database).
However, the Nexus-Prisma plugin provides some simple .crud helpers as you can see from the examples, if you just want to directly expose CRUD operations to your GraphQL API. 😄
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi there! The source of truth of GraphQL is not
schema.prisma
, but the GraphQL endpoint powered by Nexus.You still need to clearly define how the GraphQL schema looks like (eg. object types), because of security (you don't want to expose everything from your DB, think ID and password) and flexibility (you can write your own resolver instead of being restricted to basic CRUD operations on the database).
However, the Nexus-Prisma plugin provides some simple
.crud
helpers as you can see from the examples, if you just want to directly expose CRUD operations to your GraphQL API. 😄