Return to search

A Declarative Approach to GraphQL Schema Wrapping : wrapping schemas using GraphQL directives / En deklarativ metod för inkapsling av GraphQL-scheman

In recent years, GraphQL has become a popular Web API language. Due to GraphQL’spopularity, third-party libraries have also grown steadily alongside it. One such library isGraphQL Tools, which provides tools such as query delegation and schema wrapping. Onecore element of GraphQL is its schema. In part, the schema describes the relations betweendata in a data source. Every GraphQL server needs a schema, which in turn utilizes resolverfunctions that retrieve the data from the data source. Schema wrapping allows developers to create GraphQL schemas that delegate queriesto another remote server. This allows the user to modify the behavior of the remote schema,without modifying its contents. However, some JavaScript knowledge is required to im-plement the schema wrapping. This thesis proposes a declarative approach to wrappingschemas with the help of custom GraphQL directives. The main objective of the approach isto enable less knowledgeable developers to wrap schemas with less effort. The declarative approach was tested by implementing a prototype. The effects on per-formance was tested with a benchmarking tool called Linköping GraphQL Benchmark(LinGBM). The prototype delegated queries to a remote server also created by LinGBM.The benchmarking tool was run against both the wrapper server and the remote server.The results indicated that the overhead of the wrapper server was mostly due to internalfunctions of GraphQL Tools. Therefore, automatically generating a server with the pro-posed declarative approach did not seem to impose significant performance losses. Con-sidering the decreased programming effort by using the declarative approach, the slightperformance loss can be seen as manageable.

Identiferoai:union.ndltd.org:UPSALLA1/oai:DiVA.org:liu-191337
Date January 2022
CreatorsJarnemyr, Pontus, Gustafsson, Markus
PublisherLinköpings universitet, Databas och informationsteknik
Source SetsDiVA Archive at Upsalla University
LanguageEnglish
Detected LanguageEnglish
TypeStudent thesis, info:eu-repo/semantics/bachelorThesis, text
Formatapplication/pdf
Rightsinfo:eu-repo/semantics/openAccess

Page generated in 0.0031 seconds