About This Book

This book is organized into three parts.

Part I introduces you to the core concepts behind GraphQL, then guides you through building a GraphQL API in Elixir. You’ll learn about queries, mutations, and subscriptions, and end up with a functional example by the time you’re through.

Part II addresses the most common security, maintainability, and performance questions that people have about GraphQL in production, focusing on building real-world solutions that turn naive implementations into rock-solid, scalable APIs that are easy to maintain.

Part III is all about using your GraphQL API. You’ll learn how to support client-side GraphQL frameworks that access it over HTTP or directly from within your Elixir applications.

The book wraps up by providing a useful appendix to use as a quick reference when building your GraphQL schema and interacting with your API.

What This Book Isn’t

This book isn’t an introductory book on Elixir or Phoenix. While the book’s code should be straightforward reading for most developers, we will cover some more advanced topics that would benefit from a firm grounding in the Elixir language and the Phoenix web framework. We recommend the following supplementary books to readers who might be coming at this book from a different background:

This book isn’t a lengthy diatribe about REST or JSON APIs. While we’ll take time to compare GraphQL with other technologies—building on your experience—this isn’t going to be a point-by-point takedown of other choices; GraphQL is a compelling choice, and while we’ll often touch on why, we’ll move on to actually building things with it rather quickly.

Who This Book Is For

If you’re a developer who writes modern web APIs, this book is for you. You know the rewards and challenges of building a RESTful API using JSON, working with databases, and aggregating data from remote services. This book is for you because you’re in a good position to experience the “aha moment” of GraphQL full-force. You already know the problem space.

If you write Elixir (or Erlang) code, this book is for you. You use the Erlang/OTP platform for a reason—it’s robust, fault-tolerant, and battle-tested. This book is for you because GraphQL is the web API and (data retrieval/mutation) technology that Elixir/Erlang deserves, and you’re using a platform that can take GraphQL to the next level.

If you write Node.js code, and especially if you’re already supporting GraphQL APIs for JavaScript-based web frameworks, this book is for you. Maybe you’re looking for an alternative backend technology, and you’ve heard a lot about Elixir and Phoenix. You already know a fair bit about GraphQL, but you want to take it further. This book is for you because it will help you take the jump to Elixir with the confidence and knowledge to make your APIs even better.

How to Read This Book

If you’re brand new to GraphQL and want the full background story, or if you’ve played a bit with it before but would like a solid refresher, start at the beginning. In Chapter 1, Meet GraphQL, you’ll learn about its origins and walk through the core concepts that you’ll need as you read the rest of the book.

If you’ve used GraphQL before in another language and want to jump straight into building your first Elixir GraphQL API, then Chapter 2, Building a Schema is the chapter for you. It’s where you’ll be introduced to Absinthe, the GraphQL toolkit for Elixir, and start building the GraphQL schema for our example application.

Readers who have already had some experience building GraphQL APIs using Elixir and are looking for specific answers might want to start at Part 2, Publish Your API; its chapters are focused on common challenges GraphQL developers face taking their dreams to reality. If you’re ready to use your Absinthe-based GraphQL API, take a look at Part 3, Use Your API, where you’ll learn about supporting fancy JavaScript GraphQL-fluent, client-side frameworks over HTTP and even building some custom processing logic to use GraphQL directly from elsewhere in your Elixir applications.

Regardless of where you start reading the book, check out the “Moving On” section at the end of each chapter. You’re sure to find ideas and challenges there that will help you take your understanding of GraphQL and its use in Elixir to the next level.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.89.2