The schema is defined at the database level (Prisma data model) and at the application level (GraphQL Nexus schema). This separation allows for better control over what is stored in the database vs what is exposed to the frontend via the GraphQL endpoint.
The database tables and columns, which correspond to the Prisma data model, are defined inside server/prisma/scheme.prisma
using the Prisma Schema API.
A default data model is provided with a basic User
model for authentication purposes.
The GraphQL types, queries, mutations and subscriptions exposed to the frontend are defined inside server/schema/types/
using GraphQL Nexus in a declarative, code-first approach.
Projecting types from the Prisma data model onto GraphQL is done using the Nexus Prisma plugin along with Nexus Shield as an authorization layer.