DEV Community

Discussion on: Schema-first or Code-first in GraphQL

Collapse
 
gers2017 profile image
Gers2017

Hey Francisco great article, easy to read and concise.
I'd add to the cons of the schema first approach the schema/data duplication while using an orm.
For example with prisma you'd have your .schema file from prisma and your graphql schema in other

Collapse
 
franciscomendes10866 profile image
Francisco Mendes

Thanks! Yes you are absolutely right! ✌️

But I think Prisma and TypeORM would be an exception if you used TypeGraphql, in Prisma's case the graphql schema would be generated according to Prisma's schema. Whereas with TypeORM you would use entities as a base without needing to define your schema.