GraphQL lets clients ask for exactly the data a screen needs in one request, from a typed schema both sides can rely on. That flexibility also brings new problems: N+1 database queries, expensive nested requests and caching that doesn't work like REST. This course builds a production-style GraphQL API with Apollo Server and a React front end with Apollo Client, and tackles those problems directly.
What you'll learn
- Schema-first design: types, queries, mutations, input types, enums and interfaces
- Writing resolvers in TypeScript and structuring them around a data layer
- Generating types from the schema with GraphQL Code Generator
- The N+1 problem and fixing it with DataLoader batching
- Authentication and field-level authorisation
- Cursor-based pagination following the connection pattern
- Errors as data versus thrown errors, and designing mutation payloads
- Apollo Client: queries, mutations, the normalised cache and optimistic updates
- Subscriptions over WebSockets for live updates
- Security and performance: depth and cost limits, persisted queries, introspection settings, and federating several services into one supergraph
Who it's for
- Node.js developers building an API for web and mobile clients
- React developers consuming a GraphQL API who want to understand the server side
- Teams evaluating whether to move part of a REST API to GraphQL
Prerequisites
- Comfortable with TypeScript and Node.js (see Node.js and Express APIs)
- Basic React for the client modules
- Some database experience; we use PostgreSQL with Prisma
Outcomes
By the end of this course you will be able to:
- Design a GraphQL schema that models your domain cleanly and can evolve.
- Build a typed Apollo Server API with efficient data loading and proper authorisation.
- Use Apollo Client's cache to keep a React interface fast and consistent.
- Protect a public GraphQL endpoint from abusive or expensive queries.
Projects you'll build
- Recipe sharing API – users, recipes, ingredients, comments and likes with cursor pagination, practising schema design, resolvers and DataLoader.
- React dashboard client – a front end with optimistic likes and live comment updates, practising Apollo Client caching and subscriptions.
- Two-service supergraph – split users and orders into separate subgraphs composed with Apollo Federation, practising entity references and gateway routing.
Tools you'll use
Apollo Server, Apollo Client for React, GraphQL Code Generator, DataLoader, Prisma with PostgreSQL, Apollo Router for federation, and GraphiQL or Apollo Sandbox for exploring.
Course outline
| Module | Topic |
|---|---|
| 1 | GraphQL concepts and when it fits |
| 2 | Schema design fundamentals |
| 3 | Apollo Server setup and resolvers |
| 4 | Type generation with Codegen |
| 5 | Data loading and the N+1 problem |
| 6 | Authentication and authorisation |
| 7 | Pagination, filtering and mutations |
| 8 | Apollo Client and caching |
| 9 | Subscriptions and real-time data |
| 10 | Security: limits, persisted queries, introspection |
| 11 | Federation and supergraphs |
| 12 | Project: full-stack GraphQL app |
FAQ
How is this different from the REST and GraphQL API Design course?
REST and GraphQL API Design is about designing APIs in general and comparing styles. This course is hands-on implementation of GraphQL specifically, with Apollo on both server and client.
Do I have to use Apollo?
No. The schema design, DataLoader and security lessons apply to GraphQL Yoga, Mercurius and other servers too. We use Apollo because it is widely adopted and has a complete client.
Is GraphQL replacing REST?
No. Many teams use both. We cover where GraphQL helps, such as varied clients with different data needs, and where plain REST stays simpler.
How do I join?
Get in touch and we'll share the current format, schedule and enrolment details.