The Road to GraphQL
The Road to GraphQL (The Bare Essentials)
The Road to GraphQL

Last updated on 2019-04-05

About the Book

The Road to GraphQL is your personal journey to master pragmatic GraphQL in JavaScript. The book is full with applications you are going to build along the way with React.js and Node.js. Afterward, you will be able to implement full-stack JavaScript applications.

I wrote the The Road to GraphQL over the last year, while building several GraphQL applications for my clients and for myself. During this time, I came to understand the practical genius of GraphQL, and how it dramatically improves communication in client-server architectures. Not only does it improve the interface between the client and the server, it also enhances client-side state management by eliminating remote data management. Sophisticated GraphQL libraries like Apollo Client provide powerful features like caching, optimistic UI, and data prefetching for free. This book covers the fundamentals of GraphQL itself, as well as its ecosystem.

What's in the book?

I applied the same principles as my other books:

  • Stay pragmatic
  • Keep it simple
  • Answer the why, not just the how
  • Experience a problem, solve a problem

This book is not intended to be an end-all reference for GraphQL APIs, nor an in-depth guide about the internals of the GraphQL specification. Instead, its purpose is to journey through learning GraphQL with JavaScript the pragmatic way, building client and server applications yourself. The book covers lots of facets about GraphQL in JavaScript that are important for building modern applications, without just throwing the libraries like Apollo at problems before experiencing them. It starts with the basic HTTP requests to perform GraphQL queries first, then moves on to using dedicated GraphQL libraries for it. You will even get the chance to implement your own GraphQL client library, so you understand how these libraries work under the hood. There are no hidden abstractions in this book, just plenty of fundamentals for JavaScript, React.js, Node.js, and GraphQL.

Client-side GraphQL with React

The first part teaches how to build a GraphQL client application in React. Understanding React is a requirement before this book, so I recommend you take a look at my other free book called "The Road to learn React" if you need a good course. At some point, you will see the tedium in performing every GraphQL operation with basic HTTP requests. That's when we'll swap basic HTTP implementation for Apollo Client. While building your application with Apollo Client, you will learn more advanced features like caching, optimistic UI, and pagination with Apollo in React. In the end, you will have created a functional GraphQL client application.

Server-side GraphQL with Node

The second larger block of the book continues with implementing your own GraphQL server application with Express.js and Apollo Server in Node.js. There you will not only learn about all the GraphQL server-side topics, but also how they can be applied in context in a real world server application which offers pagination, authentication, role- and permission-based authorization, batching, caching, subscriptions, and a SQL database. The GraphQL server topics are not only about GraphQL, but also about using GraphQL in context of other JavaScript technologies to build powerful real world applications with it. In the end, you will have a running GraphQL server project which has all the mentioned features and can be used to realize your own ideas on top of it.


To get the most out of this book, you should be familiar with the basics of web development, which includes some knowledge of HTML, CSS and JavaScript. You will also need to be familiar with the term API, because they are discussed frequently. I encourage you to join the official Slack Group for the book, help or get help from others.


On the client-side, this book uses React to teach about GraphQL in JavaScript. My other book called The Road to learn React teaches you all the fundamentals about React. It also teaches you to make the transition from JavaScript ES5 to JavaScript ES6. The book is available for free and after having read the Road to learn React, you should possess all the knowledge to implement the GraphQL client-side application with this book.


On the server-side, this book uses Node with Express as library to teach about GraphQL in JavaScript. You don't need to know much about those technologies before using them for your first GraphQL powered applications. The book will guide you through the process of setting up a Node application with Express and shows you how to weave GraphQL into the mix. Afterward, you should be able to consume the GraphQL API provided by your server-side application in your client-side application.

About the Author

Robin Wieruch
Robin Wieruch

Robin Wieruch is a german software engineer and freelancer located in Berlin. In the recent years he has gained experiences in single page applications which use Ember, Angular and React. He is a full-time JavaScript developer, is doing his best to teach students on his blog and strives to learn something new every day himself.

Authors have earned$8,243,198writing, publishing and selling on Leanpub,
earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. Free App. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets), MOBI (for Kindle) and in the free Leanpub App (for Mac, Windows, iOS and Android). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub