Skip to content

GraphQL

GraphQL is a query language for APIs developed by Facebook in 2012 and released publicly in 2015. Unlike REST, where the server defines the shape of every response, GraphQL lets the client ask for exactly what it needs — nothing more, nothing less.

Analogy: REST is like ordering a fixed-menu meal — you get what the chef decides. GraphQL is like a buffet — you pick exactly what you want on your plate.


flowchart TB
Basics["01 Basics<br/>What, Why, Schema & Types"] --> Operations["02 Operations<br/>Queries, Mutations, Subscriptions"]
Operations --> Server["03 Server<br/>Resolvers, Apollo Server, DataLoader"]
Server --> Client["04 Client & Practice<br/>Client Usage, Errors, Best Practices"]
Client --> Interview["05 Interview<br/>Common Questions & Answers"]
style Basics fill:#7c3aed,color:#fff
style Operations fill:#4f46e5,color:#fff
style Server fill:#059669,color:#fff
style Client fill:#d97706,color:#fff
style Interview fill:#6366f1,color:#fff

SectionWhat You’ll Learn
01 BasicsWhat is GraphQL, how it differs from REST, schema & type system
02 OperationsReading data (queries), writing data (mutations), real-time updates (subscriptions)
03 ServerResolvers, building an Apollo Server, connecting databases & DataLoader
04 Client & PracticeQuerying from frontend, error handling, security & best practices
05 InterviewCommon GraphQL interview questions and answers

ProblemRESTGraphQL
Over-fetchingServer sends all fields, even unused onesClient requests only needed fields
Under-fetchingNeed multiple requests to get related dataOne query fetches nested relations
Multiple endpoints/users, /users/:id/posts, /posts/:id/commentsSingle /graphql endpoint
Versioning/v1/users, /v2/usersEvolve schema — no versioning needed

  • Each page starts with an analogy or plain-English explanation
  • Concepts are followed by small runnable code examples (schema + query + resolver)
  • Pages end with an “In Simple Words” summary
  • Mermaid diagrams illustrate key concepts visually

Start with What is GraphQL? to begin your journey!