Generating GraphQL-Wrappers for REST(-like) APIs

09/21/2018
by   Erik Wittern, et al.
0

GraphQL is a query language and thereupon-based paradigm for implementing web Application Programming Interfaces (APIs) for client-server interactions. Using GraphQL, clients define precise, nested data-requirements in typed queries, which are resolved by servers against (possibly multiple) backend systems, like databases, object storages, or other APIs. Clients receive only the data they care about, in a single request. However, providers of existing REST(-like) APIs need to implement additional GraphQL interfaces to enable these advantages. We here assess the feasibility of automatically generating GraphQL wrappers for existing REST(-like) APIs. A wrapper, upon receiving GraphQL queries, translates them to requests against the target API. We discuss the challenges for creating such wrappers, including dealing with data sanitation, authentication, or handling nested queries. We furthermore present a prototypical implementation of OASGraph. OASGraph takes as input an OpenAPI Specification (OAS) describing an existing REST(-like) web API and generates a GraphQL wrapper for it. We evaluate OASGraph by running it, as well as an existing open source alternative, against 959 publicly available OAS. This experiment shows that OASGraph outperforms the existing alternative and is able to create a GraphQL wrapper for 89.5 in many cases. A subsequent analysis of errors and warnings produced by OASGraph shows that missing or ambiguous information in the assessed OAS hinders creating complete wrappers. Finally, we present a use case of the IBM Watson Language Translator API that shows that small changes to an OAS allow OASGraph to generate more idiomatic and more expressive GraphQL wrappers.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/31/2020

Creating RESTful APIs over SPARQL endpoints using RAMOSE

Semantic Web technologies are widely used for storing RDF data and makin...
research
08/25/2021

Learning GraphQL Query Costs (Extended Version)

GraphQL is a query language for APIs and a runtime for executing those q...
research
11/16/2020

Bridging the Technology Gap Between Industry and Semantic Web: Generating Databases and Server Code From RDF

Despite great advances in the area of Semantic Web, industry rather seld...
research
03/10/2020

REST vs GraphQL: A Controlled Experiment

GraphQL is a novel query language for implementing service-based softwar...
research
05/18/2020

A Link Generator for Increasing the Utility of OpenAPI-to-GraphQL Translations

Standardized interfaces are the connecting link of today's distributed s...
research
06/18/2019

Migrating to GraphQL: A Practical Assessment

GraphQL is a novel query language proposed by Facebook to implement Web-...
research
07/30/2019

An Empirical Study of GraphQL Schemas

GraphQL is a query language for APIs and a runtime to execute queries. U...

Please sign up or login with your details

Forgot password? Click here to reset