GraphQL Fundamentals & Query Language
Solve over-fetching and under-fetching: Schema Definition Language (SDL), Queries, Mutations, Subscriptions, and client-specified data fetching.
01.1. Why GraphQL Was Created (Meta / Facebook 2012)
GraphQL was created internally at Meta in 2012 during the rebuild of Facebook's mobile applications. On mobile cellular networks, the traditional REST architectural pattern suffered from two major physics constraints:
1. Over-Fetching (Wasted Bandwidth & CPU):
When a mobile screen needs only a user's name and avatar_url, calling GET /v1/users/42 might return 80 database fields (biography, address, settings, preferences, metadata) totaling 60KB of JSON instead of 300 bytes. On slow mobile networks, parsing and transferring unused JSON drains battery and slows UI rendering.
2. Under-Fetching & Network Waterfalls:
To render a single feed screen, a REST client must make chained sequential network calls:
GET /v1/users/42(Fetch user info)GET /v1/users/42/feed(Fetch post IDs)GET /v1/posts/101/author(Fetch author for each post)GET /v1/posts/101/comments(Fetch comments)
Each round-trip incurs mobile network latency (50-150ms RTT), producing a sluggish multi-second page load.
REST Multi-Roundtrip Over-Fetching vs GraphQL Single Precision Query šÆ
REST Multi-Roundtrip Over-Fetching vs GraphQL Single Precision Query šÆ
GraphQL allows client devices to fetch exact hierarchical data graphs in a single HTTP request.
Unlock Topic #130: GraphQL Fundamentals & Query Language
You are viewing a preview. The full in-depth engineering deep dive, interactive simulators, architecture flowcharts, and self-assessment quizzes for this topic are available with Pro or Lifetime Access.
Failure modes, high-throughput bottlenecks, and real FAANG implementation decisions.
Interactive system topology diagrams, live parameter simulators, and downloadable SVG charts.
Staff-level multiple-choice quiz questions with instant feedback and answer explanations.
Firebase Google authentication automatically syncs your completed topics and quiz scores.
How clear and staff-actionable was this system breakdown?