3 ms·
People usually implements web API by defining in advance a REST architecture with all the queries you can do when they expose their list of endpoints. Basically
by sametmax 10y ago
People usually implements web API by defining in advance a REST architecture with all the queries you can do when they expose their list of endpoints. Basically, it's a schema that doesn't say it's name, it's scatered and the user is stuck with it.
With graphql, you have a smaller number of endpoints, but you have one big schema definition. You can then choose who to query it the way you want.
This means not only that a graphql API is more flexible and easier have a entire view of, but also that GRAPHQL is a nicer generic data interface. You can use it not just for HTTP requests, but also between components. You can use it as a source of truth. You can allow joins without having to design them, and even easily implement several data sources for them, including caching.
Graphql kinda have the benefit of SQL and a Web API.