Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not sure TypeScript and GraphQL are mutually exclusive.


They aren’t, but graphql would give you safer types in your api than typescript.


Not sure one gives you safer typing than the other in absolute. They both have a different context/purpose. TypeScript is great for typing a code base for function calls type of APIs, whereas GraphQL is great to express types for inter-system communication (usually over HTTP).

Using GraphQL to type your in-process API would be overkilled and would require quite a bit of contortionism, and while you can share same TypeScript types between your end-points interfaces (and can be a good first step), inter-process communication is better expressed with something like GraphQL or Protobuf.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: