H
Web & Technology

GraphQL (جراف كيو إل)

GraphQL is a query language and runtime for APIs that lets clients request exactly the data they need. Instead of fixed endpoints returning set shapes, one endpoint answers flexible queries, reducing over-fetching and under-fetching of data.

In Iraqi dialect

تطلب من السيرفر بس البيانات اللي تريدها بالضبط

In detail

In REST, a mobile screen might need several endpoints to assemble one view, fetching fields it never uses. GraphQL solves this with a typed schema and a query language: the client describes the shape of the response it wants, and the server returns precisely that. This makes apps faster on slow networks — valuable in emerging markets — and simplifies evolving APIs without versioning. GraphQL also supports subscriptions for real-time updates. The trade-off is added server complexity around caching and authorization. Many modern apps combine REST for simplicity with GraphQL where flexible data fetching pays off.

Practical example

A product page asks for the name, price, and three reviews in one GraphQL query instead of three REST calls.

Frequently asked questions

What problem does GraphQL solve?

It lets clients fetch exactly the fields they need in one request, avoiding over- and under-fetching.

Is GraphQL a replacement for REST?

Not always — it's an alternative that shines for flexible, data-heavy clients; REST remains simpler for many APIs.

Related terms

Related services