GraphQL
GraphQL is an API query language that lets a client request exactly the data it needs in a single call, rather than relying on multiple fixed endpoints. Created by Facebook in 2015, it returns precisely the requested fields, which avoids the over-fetching and under-fetching often seen with REST APIs.
GraphQL vs REST
GraphQL and REST solve the same problem — letting applications exchange data — but in different ways.
| REST | GraphQL | |
|---|---|---|
| Requests | One URL per resource | A single entry point |
| Data returned | Fixed shape per endpoint | Client selects the fields |
| Strength | Simplicity, HTTP caching | Avoids over- and under-fetching |
When to choose GraphQL
GraphQL is particularly relevant when:
- clients (especially mobile apps) have varied and changing data needs;
- a screen aggregates many related resources in one view;
- you want to reduce the number of round-trips between client and server.
REST remains a solid choice for simple, heavily cached public APIs. Both can coexist within the same system.
Questions fréquentes
No. GraphQL addresses client-side flexibility needs, but REST remains relevant for simple, heavily cached APIs. The right choice depends on the use case, and both styles can be used together in the same system.
GraphQL was developed internally by Facebook in 2012 and released publicly in 2015. It is now maintained as an open standard by the GraphQL Foundation.
No. Like any API, a GraphQL endpoint must be protected with authentication, authorization and safeguards such as query depth limiting and rate limiting to prevent abuse.
Building a custom software project? We design bespoke software aligned with your roadmap.
See our custom software expertiseDéfinitions liées