GraphQL

Design and build GraphQL APIs: schemas in SDL, queries and mutations, resolvers without N+1 problems, client caching, pagination, security limits and schema evolution.

Start course →

What you'll learn

  • Explain how GraphQL differs from REST and when it is a good fit.
  • Design schemas with types, inputs, enums, interfaces and unions in SDL.
  • Write queries, mutations and subscriptions with variables, fragments and directives.
  • Implement resolvers with context, authorisation and DataLoader batching.
  • Use GraphQL from clients with caching and generated types.
  • Secure, paginate, evolve and scale a GraphQL API in production.

Syllabus

GraphQL Foundations

  1. GraphQL Compared With REST
  2. How a GraphQL Request Works
  3. When to Use GraphQL

Designing the Schema

  1. Object Types, Scalars and Nullability
  2. Query, Mutation and Subscription Types
  3. Enums, Interfaces, Unions and Inputs

Writing Queries

  1. Fields, Aliases and Fragments
  2. Variables and Directives
  3. Introspection and Tooling

Mutations, Errors and Subscriptions

  1. Designing Mutations
  2. Error Handling
  3. Subscriptions

Building a GraphQL Server

  1. Resolvers
  2. Context and Authorisation
  3. Solving N+1 With DataLoader

Using GraphQL From Clients

  1. Calling GraphQL With fetch
  2. Client Caching Libraries
  3. Code Generation and Typed Operations

Pagination, Limits and Caching

  1. Cursor-Based Pagination
  2. Query Cost, Depth Limits and Persisted Queries
  3. Caching Strategies

GraphQL in Production

  1. GraphQL Security
  2. Evolving the Schema
  3. Federation and Composing Services
  4. A GraphQL API Checklist