GraphQL

Definition

Query language and runtime for APIs that allows clients to request specific data, optimizing data retrieval and reducing over-fetching of information.

Use Cases

Provider Equivalents

Frequently Asked Questions

What's the difference between GraphQL and REST?
REST typically exposes multiple endpoints (for example, /users and /users/{id}/orders), and each endpoint returns a fixed response shape. GraphQL usually exposes a single endpoint where the client specifies exactly which fields it wants. This can reduce over-fetching (getting too much data) and under-fetching (needing multiple calls to assemble a screen), but it also requires careful schema design, authorization, and query controls.
When should I use GraphQL?
Use GraphQL when clients need flexible data shapes, especially for mobile apps, complex UIs, or multiple frontends (web + iOS + Android) that need different fields. It’s also helpful when you want a strongly typed API contract (schema) and good developer tooling. Avoid or be cautious if your API is very simple, if you can’t invest in schema governance and security controls, or if caching and CDN-friendly patterns are your top priority and you don’t have a plan for GraphQL caching.
How much does GraphQL cost?
GraphQL itself is free (it’s a specification and many server libraries are open source). Costs come from how you run it: compute (containers/serverless), networking, and operational tooling (monitoring, logging, tracing). If you use a managed service like AWS AppSync, pricing is based on service-specific factors such as the number of API operations/requests and any connected data sources. If you place GraphQL behind an API management product, you may also pay for gateway capacity, requests, and analytics features.

Category: software

Difficulty: intermediate

Related Terms

See Also