O'Reilly logo
live online training icon Live Online training

Building data APIs with GraphQL

Get started with the GraphQL query language and runtime for your APIs

Samer Buna

GraphQL provides a common interface between clients and servers for fetching and manipulating data. It's a query language for clients and a runtime for servers, with the goal of giving clients more power into what data they can ask for, the format of that data, how much of it to fetch, and much more. With client-specified queries, clients can retrieve the flexible data they need from the server using a single smart endpoint. The GraphQL runtime is language agnostic, and there are several implementations available, including a JavaScript reference one by Facebook.

Join expert Samer Buna for a hands-on introduction to GraphQL. Over three hours, you'll learn the fundamentals of GraphQL, discover why it's needed for a modern web app architecture, and how it compares to the alternatives. Along the way, you'll explore the theory and design decisions behind GraphQL, dive into all the powerful features that ship with any GraphQL runtime implementation, and see how to get started creating a simple GraphQL service.

What you'll learn-and how you can apply it

By the end of this live online course, you’ll understand:

  • How GraphQL is different and why that matters
  • GraphQL queries and mutations
  • The GraphQL schema language and how to work with it in JavaScript

And you’ll be able to:

  • Use GraphQL queries, mutations, fragments, variables, aliases, directives, interfaces, and unions
  • Inspect GraphQL's introspective nature
  • Build a simple GraphQL server in Node.js
  • Work with GraphQL with a backend data service

This training course is for you because...

  • You're a backend engineer who designs APIs, and you want to learn how GraphQL is different.
  • You're a frontend engineer who works with applications that consume data API, and you want to learn how to make them work with GraphQL-based APIs.

Prerequisites

  • A basic understanding of programming, variables, control structure, and data structures
  • A working knowledge of JavaScript syntax and tools
  • A machine with a modern browser (preferably Chrome or Firefox) and Node.js 10.x or higher (check with: node --version) installed—must be able to install npm packages (check with: npm i -g eslint)

Recommended preparation: Read "REST APIs are REST-in-Peace APIs. Long Live GraphQL." (article)

About your instructor

  • Samer Buna has over 20 years of experience in software development, during which he has worked on web and mobile applications development, API design, functional programming, optimization, system administration, database management, and scalability. Samer is the author of several technical books and online courses on topics such as Node.js, React, and GraphQL. You can follow his latest work over at jsComplete.com and EdgeCoders.com.

Schedule

The timeframes are only estimates and may vary according to how the class is progressing

Introduction to GraphQL (55 minutes)

  • Lecture and hands-on exercises: GraphQL terminology and design principles; the GraphQL way of creating APIs for hierarchical data; how GraphQL is product-centric with client-specified queries; how GraphQL plays well with existing code; how to work with the GraphQL editor
  • Break (5 minutes)

The GraphQL query language (55 minutes)

  • Lecture and hands-on exercises: The query syntax; variables; field aliases; fragments; directives; mutations; GraphQL's introspective nature; how to use GraphQL to write declarative data requirements
  • Break (5 minutes)

The GraphQL runtime (50 minutes)

  • Lecture and hands-on exercises: The GraphQL runtime; schemas; objects; fields; transport channels; type system; composition; introspection; mutations

Wrap-up and Q&A (10 minutes)