GraphQL: The API Design Revolution
Ritsilä, Aleksi (2018)
Ritsilä, Aleksi
Haaga-Helia ammattikorkeakoulu
2018
All rights reserved
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-201803113228
https://urn.fi/URN:NBN:fi:amk-201803113228
Tiivistelmä
APIs allow software to speak to each other. Currently the dominant design model is REST. Though it is known to build long lasting APIs, it has issues that come with today’s applica- tions, especially with the rise of mobile app consumers. Queries done with REST require many HTTP endpoints that return fixed data structures which can easily result excess data. Issues come also with frequent updates to the applications since knowing what individual clients need is very difficult.
GraphQL was built by Facebook in 2012 for their mobile and web apps. It was designed precisely for the need of more flexibility and efficiency in client, server communication. But will it take over REST?
GraphQL has one “smart” end point that can take complex operations and return only the data the client needs. The shape of a responses matches the shape of the queries. Thus, GraphQL does minimize the amount of data transferred and enables easy evolution of ap- plications.
GraphCool is an open-sourced framework for the development and deployment of server- less GraphQL backends. With it I created a database and accessed it for purposes of my example project. GraphCools documentation is well done and the environment is clear and easy to work with. It provides an excellent way and place for learning GraphQL.
REST is an architectural concept where as GraphQL is a query language. REST can utilize HTTP content-types, -methods and -caching. However, if a vast field of clients with differ- ent needs require limited data, with inexpensive queries, GraphQLs API could be what you are looking for. It ́s not really a question of “can GraphQL do more than REST” but rather it seems many things are just a lot easier with GraphQL.
GraphQL was built by Facebook in 2012 for their mobile and web apps. It was designed precisely for the need of more flexibility and efficiency in client, server communication. But will it take over REST?
GraphQL has one “smart” end point that can take complex operations and return only the data the client needs. The shape of a responses matches the shape of the queries. Thus, GraphQL does minimize the amount of data transferred and enables easy evolution of ap- plications.
GraphCool is an open-sourced framework for the development and deployment of server- less GraphQL backends. With it I created a database and accessed it for purposes of my example project. GraphCools documentation is well done and the environment is clear and easy to work with. It provides an excellent way and place for learning GraphQL.
REST is an architectural concept where as GraphQL is a query language. REST can utilize HTTP content-types, -methods and -caching. However, if a vast field of clients with differ- ent needs require limited data, with inexpensive queries, GraphQLs API could be what you are looking for. It ́s not really a question of “can GraphQL do more than REST” but rather it seems many things are just a lot easier with GraphQL.