Devii · APIs & integration · 2026-04-28 · 8 min read
GraphQL: Schema, Queries, And Where It Fits Next To REST
The GraphQL specification defines a typed schema and a single endpoint; benefits and costs are structural, not marketing.
**GraphQL** is a query language and execution model maintained at `graphql.org`. Clients request a tree of fields; servers resolve fields against a **schema** with types, queries, mutations, and subscriptions (subscriptions depend on transport).
Strengths: clients fetch the shape they need in one round trip; strong typing aids tooling (code generation, GraphiQL). Costs: complexity at the server (N+1 resolver patterns need batching or DataLoader-style helpers), caching is harder at HTTP CDNs than idempotent GET resources, and public APIs require depth/complexity limits to prevent abuse.
GraphQL is not a database. Resolvers map to services, SQL, or REST backends. Authorization belongs at the field or object level, not only at the HTTP edge.
Many teams use GraphQL internally and REST or gRPC externally. Choose based on client diversity and operational tooling, not slogans.