I’ve been reading about GraphQL; and I was wondering when we already have a standard that has been working so well over the years; what problems does GraphQL claim to solve?
I understand that writing queries becomes very easy but; I might be wrong; don’t you have to configure the GraphQL backend for all the queries, just as you would do it for a REST backend?
Disappointed User
The main benefit I see is the ability to define a mutable model schema that is backwards compatible with the ability to perform complex queries and output them in a single request.
Instead of defining different queries and endpoints you define the schema and mutators based on object types. Then when you ask for a complex list of objects they mutate depending on the models schema functions on a per type basis... i.e. GraphQL will look at what was requested, find the data's requirements, and shape then return the request data.
"GraphQL server operates on a single URL/endpoint, usually /graphql, and all GraphQL requests for a given service should be directed at this endpoint."
"Typical REST APIs require loading from multiple URLs, GraphQL APIs get all the data your app needs in a single request. Apps using GraphQL can be quick even on slow mobile network connections."
en.wikipedia.org/wiki/Object-relational_mapping