DEV Community

Discussion on: GraphQL Code-First Approach with NestJS 7

Collapse
 
mark600211 profile image
mark600211

and the main question. can I use schema.gql file auto generated when I use code first approach as schema.prisma???

Collapse
 
marcjulian profile image
Marc Stammerjohann

I am not sure if I understand your question.

You use Graphql code first approach to generate your graphql api which generates the schema.gql.

The schema.prisma describes your database and is separate to the graphql endpoint. You have to write your prisma schema your self.

That means you can use both at the same time. Code first to generate schema.gql and write the database schema.prisma manually.

Does that answer your question?

Collapse
 
mark600211 profile image
mark600211

thanks for answer. I get it yesterday, when start do it, not read) But this good idea, I think: we have slightly different between our schema.gql and schema.prisma. Cause we would be generate prisma use our ObjectType objects. it would be pretty nice.