GraphQL
A query language for APIs that lets clients request exactly the data they need — an alternative to REST favored by product-focused engineering teams.
GraphQL, developed by Meta, allows API clients to specify exactly what data they need in a single request rather than making multiple REST calls and over-fetching. It's common at companies with complex data requirements, multiple client types (web, mobile, third-party), or that prioritize frontend developer experience. Many larger tech companies use it alongside REST rather than replacing it entirely.
Typical time to job-readiness: ~4 weeks.
Learning GraphQL
Beginner
Understand queries, mutations, subscriptions, and types. Use Apollo Client in a frontend project to consume an existing GraphQL API before building your own server.
Intermediate
Build a GraphQL server with Apollo Server or Yoga, design schemas, write resolvers, and prevent N+1 query problems with DataLoader.
Advanced
Federated schemas (Apollo Federation), subscriptions for real-time data, and schema design for long-term evolution without breaking clients. Assessed through schema design exercises.
Key concepts
- Single endpoint — all queries go to one URL unlike REST's many endpoints
- Schema definition language (SDL) defines types and relationships
- Queries fetch data, mutations modify data, subscriptions push real-time updates
- Resolvers — functions that return data for each field in the schema
- Over-fetching vs under-fetching: clients ask for exactly what they need
- N+1 problem and DataLoader for batching database calls
Common interview topics
- What problem does GraphQL solve compared to REST
- Explain queries vs mutations vs subscriptions
- What is the N+1 problem in GraphQL and how does DataLoader solve it
- How do you handle authentication and authorization in a GraphQL API
- When would you choose REST over GraphQL