Even though Apollo Client and React Apollo are both written in TypeScript. Getting started with TypeScript and Apollo. This is a follow up to a similar post on using Flow and Apollo which can be found here. When the Apollo team started out to build a flexible and incrementally adoptable GraphQL client, one of the early discussions centered around static typing for the library code.
This is a follow up to a similar post on using Flow and Apollo which can be found here.
When the Apollo team started out to build a flexible and incrementally adoptable GraphQL client, one of the early discussions centered around static typing for the library code. Since the library deals with a complex data types (like the parsed abstract syntax tree of a GraphQL operation), it seemed like making the code type safe was a needed addition.
The team investigated both Flow and TypeScript, and ultimately went with TypeScript for its active development, editor integration, and strong tooling. It’s been a huge help ever since.
Even though Apollo Client and React Apollo are both written in TypeScript, the actual type usage for application developers was not as strong as it should have been. In many places, React Apollo used either
any, essentially bypassing static types, or left types off all together where allowed.
Luckily, thanks to the efforts of Ian Ker-Seymer, these shortcomings were brought to the attention of the Apollo team. With his help, application developers can opt in to much stronger TypeScript checking of their React apps!
This article will follow the same progression as the article on Flow , and it also assumes you already have TypeScript configured in your project. If you don’t, check out this great starter tooling from Microsoft.
Learn TypeScript | TypeScript Crash Course | TypeScript Tutorial for Beginners: My goal with this courses is just give your the fundamentals of the language, show you what TypeScript is and how to use it. We as developers don't have time neither can we afford to spend too much time on any tehcnology.