What is GraphQL?
Turkish: GraphQL
GraphQL is a schema-based API query language and runtime that lets clients select exactly the fields they need.
What is GraphQL?
GraphQL is a query language and runtime where API clients explicitly describe the fields they need. In REST, data is often gathered from several resource URLs; in GraphQL, the client sends a schema-valid query to a single endpoint.
For example, a product detail screen can request only the product name, price, stock level, and first three reviews. The server resolves those fields and returns a JSON response with that shape.
How Does It Work?
A GraphQL API publishes a schema that defines types, queries, mutations, and subscriptions. The client sends a query against that schema; the server validates it, collects data through resolver functions, and returns JSON.
The main operation types are:
- Query: Reads data
- Mutation: Creates, updates, or deletes data
- Subscription: Listens for real-time events
Business Use
GraphQL is useful when mobile apps, dashboards, customer portals, and third-party integrations consume the same data model in different shapes. By avoiding unnecessary fields, it can make complex screens more efficient over the network.
It does not automatically replace a REST API. File downloads, simple CRUD, and cache-friendly resource structures may remain simpler with REST. A well-designed API using GraphQL needs authorization, query complexity limits, and observability from the start.
Related Terms
An API is a contract that lets software systems request approved data or actions from one another through documented endpoints.
GraphQL FederationGraphQL Federation combines independently owned schemas so multiple teams can expose one unified GraphQL supergraph.
GraphQL SchemaA GraphQL schema is the contract layer that defines API types, queries, mutations, and relationships between fields.
GraphQL SubscriptionA GraphQL Subscription is an operation type that streams server events to clients in real time while a connection stays open.
gRPCgRPC is an RPC framework that uses Protocol Buffers and HTTP/2 for fast, type-safe communication between services.
REST APIA REST API designs web services around resources and HTTP methods, making integrations predictable across web and mobile systems.
StrapiStrapi is an open-source, self-hostable headless CMS that turns content models into APIs for websites and apps.
tRPCtRPC carries server procedure types to TypeScript clients end to end without requiring a separate API schema or code generation step.