why is there a prisma.graphql and a datamodel.pris...
# orm-help
s
why is there a prisma.graphql and a datamodel.prisma file? why could they not be unified?
c
The
prisma.graphql
file is defining your data model at an ORM level (to define the functionality available via the Prisma client) whereas your
datamodel.graphql
file is what is used on your publicly exposed graphQL API. Prisma does expose its own graphQL API but it’s fully exposing your data model, which you probably dont want because you’d be exposing things that are not relevant to clients or you might want to extend your graphQL API to include other pieces of data outside of the database that Prisma is controlling as the ORM.
The way that I’m increasingly thinking about it is that Prisma is an ORM that happens to give you a graphQL API out of the box for proof-of-concept/development use, but if you’re going to be exposing something to clients you’re going to end up rolling your own graphQL API that will integrate pretty closely/easily with Prisma as the ORM handling data persistence
👍 2
s
i'm just writing a code challenge... it might be okay to only use the public graphQL api