

It's an alternative to Rest APIs that allows you to request "only the data you need". GraphQL is another method for managing APIs. While some libraries like React do this internally for you, you may have to set it up yourself if you're building without such tools. TypeScript takes an extra step to compile to JavaScript for use. It is also integrated into editors like VSCode, which makes it easier to spot type errors while writing code. TypeScript helps us build more predictable JavaScript code during development through type-checking. This means a missing object property can also result in an error. It can also ensure that correct, expected, structured objects are typed. TypeScript can handle more than primitive types. With TypeScript, such a function will result in a compile-time error unless the appropriate type is passed. Without TypeScript, a function declared to receive a string typed argument may receive a number typed argument during execution, and you may get a runtime error.

TypeScript helps you build typed applications that help you avoid static type errors in those apps and make predictable code. It's like JavaScript, but with powers – type powers. TypeScript is a superset of JavaScript that compiles to JavaScript for production. Then I'll show you how you can use them together using TypeGrapQL, and why you'd want to do this. In this tutorial, I'll explain what TypeScript and GraphQL are, and the benefits of using them.
