And the real issue is how to define and where to place a single source of truth for the schema an operations. So far we saw approaches where:
- GraphQL schema is generated from SQL tables. Makes total sense for a project or a company that looks to capitalize on customers with existing databases (e.g., PostGraphile, Hasura);
- SQL schema is generated from a GraphQL schema;
- SQL schema and TypeScript CRUD resolvers are generated from GraphQL schema (graphback);
- a language is introduced and GraphQL and SQL are generated from that language (Prisma);
- a library and a set of decorators are used to define both GraphQL schema and a typed ORM schema within a standard language (e.g, TypeGraphQL + TypeScript + some ORM such as TypeORM).