3 ms·
GraphQL is extremely useful, if only to have strong type validation between disparate languages, via code generation. It can be a universal typed schema of your
by satvikpendem 4y ago
GraphQL is extremely useful, if only to have strong type validation between disparate languages, via code generation. It can be a universal typed schema of your data against which you can use whatever server and client combo you want. It's like tRPC but you're not forced to use only TypeScript.
I also have to plug this video [0], since many people think GraphQL somehow is a competitor to SQL and that it goes between the server and the database; it does not and has not ever been intended to be a replacement for a database query language and in fact should never be used there at all. It is only for client/server communication, not server/database communication.
[0] https://www.youtube.com/watch?v=ZfccwYUD8H0 https://www.youtube.com/watch?v=ZfccwYUD8H0
- yencabulator 4y ago> strong type validation The limited types in GraphQL kinda make that not very helpful. A RESTful API with JSON Schema or zod schema for it has much stronger types, and you can even make converting to better types be part of the zod schema.
- satvikpendem 4y ago> A RESTful API with JSON Schema Sure but I get it for free with GraphQL anyway. > you can even make converting to better types be part of the zod schema I'm not using TypeScript so this wouldn't be useful to me. That's why I mentioned that GraphQL is good for disparate servers and clients that aren't necessarily just React/Node/TypeScript.