3 ms·
> Whereas, in a REST architecture, the client makes an HTTP request and data is sent as HTTP response, in GraphQL, the client request data with queries. Alread
by bern4444 5y ago
> Whereas, in a REST architecture, the client makes an HTTP request and data is sent as HTTP response, in GraphQL, the client request data with queries.
Already this isn't quite right.
Both (often) operate on HTTP (though of course other protocols could likely be used as well).
The difference lies in the idea, behavior, and ergonomics behind each. A frontend makes an HTTP request to a backend with a query and the back end fetches and returns the data as an HTTP response.
You can easily make a REST API that behaves like a graphql api through query parameters. GraphQL is a way of abstracting over multiple APIs, databases, etc and lets frontends get data without having to ask back end developers to change request handlers.