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.
Identifer | oai:union.ndltd.org:UPSALLA1/oai:DiVA.org:liu-191337 |
Date | January 2022 |
Creators | Jarnemyr, Pontus, Gustafsson, Markus |
Publisher | Linköpings universitet, Databas och informationsteknik |
Source Sets | DiVA Archive at Upsalla University |
Language | English |
Detected Language | English |
Type | Student thesis, info:eu-repo/semantics/bachelorThesis, text |
Format | application/pdf |
Rights | info:eu-repo/semantics/openAccess |
Page generated in 0.0021 seconds