DEV Community

Discussion on: GraphQL Code-First Approach with NestJS 7

marcjulian profile image
Marc Stammerjohann Author

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?

mark600211 profile image

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.