3 ms·
Embedding SQL into GraphQL without sacrificing type safety
- jensneuse 4y agoAuthor here: I know that at first glance, this looks like an absolutely awful idea. Who in their right mind wants to put SQL into their GraphQL? At the same time, I think it's actually a quite practical solution to bridge the gap between what GraphQL can do, and what you really need to interact with a database. By embedding SQL into GraphQL, we're able to build powerful type-safe APIs super fast without being limited to what GraphQL can do. I'm curious what people think. Awful idea? Great escape hatch? If you don't like the idea, how would you do it differently with similar complexity on the user's side? E.g. what other tools can achieve the same functionality in 7 lines of code?