Complete Intro Graphql


This book covers:

  • What GraphQL is and the design concepts behind it

  • How GraphQL is different from its alternatives, like REST APIs

  • The language and service parts of a GraphQL system

  • The advantages and disadvantages of GraphQL

  • Using GraphQL’s in-browser IDE to test GraphQL requests

  • Exploring the fundamentals of sending GraphQL data requests

  • Exploring read and write example operations from the GitHub GraphQL API

  • Exploring GraphQL’s introspective features

  • Exploring auto-generated GraphQL APIs

  • Using arguments to customize what a field in a GraphQL request returns

  • Using aliases to customize the property names in a response object

  • Using directives to describe alternate runtime executions

  • Using fragments to reduce any duplicated text in a GraphQL document

  • Composing queries and separating data requirement responsibilities

  • Using inline fragments with interfaces and unions

I first learned about GraphQL when Facebook engineers publicly talked about it for the very first time at a React.js conference and I knew I had to try it right away. At the time, I was working on a few data-driven applications that all suffered from the lack of a structured and efficient data API solution. These applications used custom data API endpoints that were created to optimally satisfy the growing data needs of their views. However, it was clear that managing these custom endpoints will eventually become a nightmare. The GraphQL talk beautifully validated these concerns.

Like others who attended that conference, I believed a validation from Facebook on the ideas and concepts behind GraphQL would probably create a game changer in the data API space and be a very good alternative to the problematic REST and ad-hoc API solutions that have been dominating the space before GraphQL. I had a feeling GraphQL would become very popular very fast.

Learning GraphQL was one of the best time investments I ever made. GraphQL allows me to implement ideas faster and have my projects perform better and working with GraphQL is simply a more pleasant experience overall.

GraphQL has many advantages that you will learn about here but it also comes with some challenges, especially in the areas of optimization and cache management. I will talk about the challenges as well, but first let me give you a gentle introduction to GraphQL.