
Querying a GraphQL API from React - nareshbhatia
https://medium.com/naresh-bhatia/graphql-concepts-i-wish-someone-explained-to-me-a-year-ago-959b234ff430
======
nareshbhatia
In Part 3 of my GraphQL series, we build querying capability into a freshly
created React client.

We'll use Apollo Client's <Query> component. Also, we will cover the special
case of executing multiple unrelated queries from a single React component.

Back when I first came across this use case, I was scratching my head

Just like we modularize code to make it reusable, we should do the same for
queries. Fragments allow us to do this.

Despite careful documentation, it's easy to get client and server data
structures out of sync – resulting in painful bugs.

I show you how to avoid this by generating TypeScript definitions from our
schema and using them in React components.

