A Declarative Approach to GraphQL Schema Wrapping : wrapping schemas using GraphQL directives

Autor: Jarnemyr, Pontus, Gustafsson, Markus
Jazyk: angličtina
Rok vydání: 2022
Předmět:
Druh dokumentu: Text
Popis: 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.
Databáze: Networked Digital Library of Theses & Dissertations