Primary source
Learning GraphQL (O'Reilly)
Official book page with publication and online reading details.
Learning GraphQL
Authors: Eve Porcello, Alex Banks
Publisher: O'Reilly Media, Inc.
Length: 196 pages
A practical introduction from Eve Porcello and Alex Banks: graph theory, schema, queries/mutations/subscriptions and the Apollo Client.
OriginalWhat this book is and who it helps
Learning GraphQL by Eve Porcello and Alex Banks was published in 2018 and gives a practical path: from graph mindset and query language to schema design, server implementation, and client integration.
Publication year
2018
Length
~196 pages
Focus
Schema-first API and DX
Book structure by chapters
The book has 7 chapters and covers the full cycle: GraphQL language, schema design, server, client, and production concerns.
1. Welcome to GraphQL
- What GraphQL is and why it emerged next to REST APIs.
- The core overfetching/underfetching pain in endpoint-based APIs.
2. Graph Theory
- A concise vocabulary of graphs and trees.
- How to model connected entities instead of isolated records.
3. The GraphQL Query Language
- Queries, fragments, mutations, variables, and subscriptions.
- GraphiQL/Playground, introspection, and AST mention.
4. Designing a Schema
- Schema as API contract: types, scalars, enums, input/output.
- 1:1, 1:N, N:M relations, arguments, filtering, and docs.
5. Creating a GraphQL API
- Resolver layers, context, custom scalars, and Apollo Server.
- MongoDB integration and GitHub OAuth-based auth flow.
6. GraphQL Clients
- From fetch/graphql-request to Apollo Client + React usage.
- Caching, fetch policies, and mutation-driven cache updates.
7. GraphQL in the Real World
- Subscriptions, file upload, incremental migration, schema-first.
- Query depth/complexity limits, timeouts, and safeguards.
What you get after reading
Why GraphQL is often convenient
1. Exactly the fields you need
Clients request precise response shape and reduce overfetching/underfetching.
2. Schema as a shared contract
Frontend and backend align around one strongly typed model.
3. Introspection and tooling
Schema discovery powers IDE support, docs, and faster onboarding.
4. Unified operation model
Queries, mutations, and subscriptions live in one API model.
5. API evolution without hard v1/v2 gates
Schemas can evolve gradually while clients adopt new fields incrementally.
Mini example: query tailored to a single screen
Core idea from the book: describe data shape at the client layer for each UI use case.
query UserCard($id: ID!) {
user(id: $id) {
id
name
avatarUrl
}
}Important caveat: where GraphQL needs discipline
Performance
Resolver chains require guardrails to avoid N+1 query patterns.
Caching
HTTP caching "like REST" often needs additional strategy in GraphQL.
Security
Depth/complexity limits and timeouts/rate limits are key for safe operation.
