Flexible Queries with GraphQL
This chapter explores under-fetching and over-fetching in REST APIs, and how GraphQL solves them. It is framed around a case study of an online shop, which has a website and a phone app.
After reading this chapter, you should be able to:
- Define over-fetching and under-fetching, and explain why they hurt a phone app more than a website
- Describe how a REST API can reduce over-fetching and under-fetching, and what each approach costs
- Explain what problem GraphQL was built to solve and how it solves it
- Read a GraphQL query and say what shape its response has
- List the decisions a designer makes for a GraphQL API
- Read a GraphQL schema: its types, fields, nullability, and entry points