GraphQL API

Definition

A managed GraphQL service letting clients request exactly the data they need in one typed query, eliminating REST over-fetching and extra round trips.

Use Cases

Provider Equivalents

Frequently Asked Questions

What's the difference between a GraphQL API and a REST API?
REST typically exposes multiple endpoints (for example, /users, /posts, /comments) and each endpoint returns a fixed shape of data. GraphQL usually exposes a single endpoint where the client sends a query describing exactly which fields it wants, and the server returns only those fields. This can reduce over-fetching (getting too much data) and under-fetching (needing extra requests to get missing data), especially for mobile apps and complex UIs.
When should I use a GraphQL API?
Use GraphQL when clients have different data needs (web vs. mobile), screens require data from multiple resources at once, or you want to minimize network round trips on slow or high-latency connections. It’s also useful when product requirements change frequently and you want clients to evolve queries without creating many new endpoints. REST can be simpler when your resources map cleanly to endpoints, responses are stable, and caching via standard HTTP patterns is a primary goal.
How much does a GraphQL API cost?
Cost depends on whether you use a managed service or self-host. With AWS AppSync, pricing is primarily based on the number of GraphQL operations (queries/mutations/subscriptions), real-time subscription usage, and any connected data sources (like DynamoDB, Lambda, or HTTP backends). With self-hosted GraphQL (for example on containers or functions), you pay for the underlying compute, networking/egress, and any API gateway or load balancer. Key cost drivers include request volume, response size, resolver complexity, and data source read/write costs.

Category: software

Difficulty: intermediate

Related Terms

See Also