GraphQL

GraphQL is a query language and runtime for APIs that lets clients request exactly the fields they need from a single endpoint, returning predictable, typed responses.

GraphQL exposes a typed schema and a single endpoint. Clients send queries describing precisely the data and shape they want, avoiding the over-fetching and under-fetching that can occur with rigid endpoints.

It excels when many different clients consume the same data graph or when UIs are deeply nested. The trade-offs are harder HTTP caching (it's typically one POST endpoint) and the operational cost of running and securing a GraphQL server.

REST and GraphQL both work well; the choice depends on your clients, caching needs, and how much infrastructure you want to run. Auto-generated REST often wins on simplicity and caching.

Related terms

GraphQL in Kolaybase

See it in practice

Kolaybase gives you PostgreSQL, auth, storage, and a REST API in minutes.

Get started