REST and GraphQL API Implementations Comparison

Thesis title: Porovnání implementací REST a GraphQL API
Author: Podlipský, Šimon
Thesis type: Diplomová práce
Supervisor: Palovská, Helena
Opponents: Vojíř, Stanislav
Thesis language: Česky
Abstract:
Diplomová práce se věnuje porovnání implementací API skze HTTP protokol s využitím principu REST a s využitím GraphQL. Odpovídá na otázku, jestli je jedna forma API vhodnější než druhá. GraphQL mezi vývojáři v posledních letech nabírá na popularitě a často bývá považováno za nadřazené REST API. Práce však dojde k závěru, že náročnost implementace je pro obě formy podobná. Zároveň je zdůrazňováno, že se možnosti využití obou forem kryjí, avšak každá má navíc něco, co ta druhá nemá, a tak hlavně záleží na kontextu, v jakém je konkrétní forma API realizována. S GraphQL se snadněji pracuje na frontendu, kde klienská aplikace nemusí transformovat získaná data, protože je API flexibilně předá ve formě, kterou si klientská aplikace sama definovala. GraphQL API zároveň samo automaticky generuje plnohodnotnou dokumentaci, zatímco REST API z části vyžaduje manuální tvorbu dokumentace, na což je z pohledu vývoje negativně nahlíženo vzhledem ke vznikajícímu prostor pro chyby. Na druhou stranu REST API lépe využívá vlastností HTTP protokolu na rozdíl od GraphQL, které musí vynalézat vlastní konvence. Obě formy tak mají své výhody a nevýhody, nedá se však jednoznačně říci, že by jedna byla lepší než ta druhá. Zaroveň je možné využívat obě formy najednou podle toho, kde je která vhodnější. Navzájem se nijak nevylučují. Práce také úspěšně demonstruje ideální techniky realizace obou způsobů API.
Keywords: REST; PHP; GraphQL; HTTP; API; JavaScript
Thesis title: REST and GraphQL API Implementations Comparison
Author: Podlipský, Šimon
Thesis type: Diploma thesis
Supervisor: Palovská, Helena
Opponents: Vojíř, Stanislav
Thesis language: Česky
Abstract:
The very master’s thesis is dedicated to the comparison of API implementation through REST principle and also through GraphQL via HTTP protocol and tries to address the question whether one API solution is more feasible than the other one. As GraphQL is gaining popularity among developers during the last few years, APIs realized through the use of GraphQL are often considered superior over REST APIs. The thesis, however, comes to the conclusion that the implementation complexity of both solutions is similar. GraphQL is slightly easier to work with within frontend applications for the client usually has no or little need to further transform received data as they mostly come in a form requested by the client. GraphQL API also documents itself automatically. The REST API, on the other hand, needs manual documenting that is usually considered as a negative aspect from a developer's perspective because space for errors emerges. Nevertheless, REST API fully leverages HTTP protocol’s features where GraphQL often has to invent its own conventions. Both solutions have advantages and disadvantages compared to each other but there’s no obvious saying that one is more capable. Also, it’s possible to have both implemented without affecting the domain layer of the system for they can viably coexist. The thesis also demonstrates viable techniques on how to implement both with success.
Keywords: JavaScript; API; REST; GraphQL; HTTP; PHP

Information about study

Study programme: Ekonomika a management/Management
Type of study programme: Magisterský studijní program
Assigned degree: Ing.
Institutions assigning academic degree: Vysoká škola ekonomická v Praze
Faculty: Faculty of Informatics and Statistics
Department: Department of Information Technologies

Information on submission and defense

Date of assignment: 8. 6. 2017
Date of submission: 20. 11. 2018
Date of defense: 22. 1. 2019
Identifier in the InSIS system: https://insis.vse.cz/zp/62368/podrobnosti

Files for download

    Last update: