GraphQL is a query language for APIs where clients specify exactly what data they need. REST: GET /users/1 returns everything (id, name, email, address, etc.). GraphQL: client says "give me id and name only." Reduces over-fetching (getting too much) and under-fetching (making multiple requests). One endpoint, flexible queries. Created by Facebook, used by GitHub, Shopify. More complex than REST, best for complex frontend needs.
Use GraphQL when you have complex data relationships, mobile apps that need minimal data (save bandwidth), multiple clients with different needs (web wants everything, mobile wants less), or when you want to avoid versioning APIs. Don't use for simple CRUD—REST is simpler. Don't use if backend complexity isn't worth frontend flexibility. Start with REST, add GraphQL when pain points emerge.
System Design Patterns
Ask for exactly what you need