Return to search

En implementation av GraphQL i .NET Framework med inslag av en jämförelse mot REST API

Inom denna rapport så kommer det gås igenom vilka tekniker och metoder som har används för att skapa en implementation en ny sorts webbaserat API. Det nya API't heter GraphQL och upfyller samma syfte som det mer traditionella REST API som används mycket utav företag och organisationer i dagsläget. Det som skiljer GraphQL mot REST är att GraphQL använder sig av "Query Language" för att kommunicera med API't genom att hämta eller skicka information. Implementationen har utförts inom .NET Framework hos företaget Quicksearch. Utvecklingen har skett inom företagets datasystem och API't kan hämta information från deras databas och skicka det vidare till användaren. Verktygen som har använts för att skapa applikationen är utvecklingsprogrammet Visual Studio tillsammans med programmeringsspråket C\#. Programmet Postman har använts till hjälp för utveckling och testning av API't. Relevanta metoder för att skapa API't inkluderar bibliotek riktat mot GraphQL och sammankoppling mot databasen. Designmönster har varit viktiga i projektet och dessa är "Dependency Injection" och "Model-View-Controller" för att skapa en web applikation. Slutresultatet är ett GraphQL API som kan forma enkla förfrågningar riktat mot en data-modell eller objekt. Även en jämförelse av GraphQL mot REST API har utförts med resultatet att det finns distinkta skillnader mellan de två konceptenför men för att komma fram till en övergripandeslutsats över vilket API som är ett bättre alternativ så behövs ytterligare tester. / This report will walkthrough several techniques and methods that have been used to create a new kind of web-based API. This new kind of API is called GraphQL and fullfils the same purpose as the more traditionally used REST API. What differs between these two types of API is that GraphQL uses a ”Query Language” when the user communicates with the API. The implementation is done in .NET Framework together with a company named Quicksearch. The development has been done within Quicksearch’s computer system and the API can request information from the company’s database and send it back to the user of the API. The tools that have been used to develop the API are Visual Studio as the development enviroment, along with the programming language C#. Postman is a software that have also been used to help develop and test the GraphQL API. Relevant methods used in the development includes libraries directed to create a GraphQL API and libraries used to create the connection to the database. Design patterns have also be important in the development and the most noticeable ones have been ”Dependency Injection” and ”Model-View-Controller” to create the application. The end result is an API that is able to recieve simple queries directed against a simple data-model or object. Aditionally a comparison between GraphQL and REST have been done and the result is that there are distinct differences between the two types of API but there is a lack of scientific reasarch and knowledge to make the conclusion of which is the better alternative and additional tests are required.

Identiferoai:union.ndltd.org:UPSALLA1/oai:DiVA.org:hh-42930
Date January 2020
CreatorsBergius, Johan, Ranhult, Philip
PublisherHögskolan i Halmstad, Akademin för ekonomi, teknik och naturvetenskap, Högskolan i Halmstad, Akademin för ekonomi, teknik och naturvetenskap
Source SetsDiVA Archive at Upsalla University
LanguageSwedish
Detected LanguageEnglish
TypeStudent thesis, info:eu-repo/semantics/bachelorThesis, text
Formatapplication/pdf
Rightsinfo:eu-repo/semantics/openAccess

Page generated in 0.0035 seconds