Skip to main content
QUICK REVIEW

[Paper Review] A Link Generator for Increasing the Utility of OpenAPI-to-GraphQL Translations

Dominik Kus, István Koren|arXiv (Cornell University)|Jan 1, 2020
Scientific Computing and Data ManagementDecision Sciences2 references1 citations
TL;DR

This paper proposes the OpenAPI-Link-Generator, an open-source tool that automatically enhances OpenAPI specifications with link definitions to improve the quality of OpenAPI-to-GraphQL translations. By analyzing path hierarchies and parameter consistency, it adds over 7,500 links across 34% of APIs in the APIs.guru directory, significantly increasing the utility of GraphQL wrappers without modifying underlying services.

ABSTRACT

Standardized interfaces are the connecting link of today's distributed systems, facilitating access to data services in the cloud. REST APIs have been prevalent over the last years, despite several issues like over- and underfetching of resources. GraphQL enjoys rapid adoption, resolving these problems by using statically typed queries. However, the redevelopment of services to the new paradigm is costly. Therefore, several approaches for the successive migration from REST to GraphQL have been proposed, many leveraging OpenAPI service descriptions. In this article, we present the findings of our empirical evaluation on the APIs.guru directory and identify several schema translation challenges. These include less expressive schema types in GraphQL, as well as missing meta information about related resources in OpenAPI. To this end, we developed the open source Link Generator, that analyzes OpenAPI documents and automatically adds links to increase translation utility. This fundamentally benefits around 34% of APIs in the APIs.guru directory. Our findings and tool support contribute to the ongoing discussion about the migration of REST APIs to GraphQL, and provide developers with valuable insights into common pitfalls, to reduce friction during API transformation.

Motivation & Objective

  • To identify and address schema translation challenges in mapping REST APIs to GraphQL using OpenAPI documentation.
  • To improve the utility of OpenAPI-to-GraphQL wrappers by resolving missing semantic relationships between resources.
  • To reduce client-side over- and underfetching by enabling nested, hierarchical queries through automated link generation.
  • To provide a scalable, automated solution that enhances existing OpenAPI specs without requiring changes to backend services.
  • To support sustainable, low-friction migration from REST to GraphQL by improving tooling interoperability.

Proposed method

  • Analyzing 1,568 OpenAPI documents from the APIs.guru directory to identify missing links and schema translation issues.
  • Applying heuristics based on URI path hierarchy (e.g., /A and /A/B) to infer potential parent-child relationships between endpoints.
  • Matching parameters across related endpoints by name and schema structure to ensure consistent query mapping in the generated GraphQL schema.
  • Parsing internal JSON references in OpenAPI documents to support complex, reusable schema definitions during link inference.
  • Generating link definitions in the OpenAPI format that map parent resources to child resources using the OpenAPI 3.0 link specification.
  • Evaluating the tool on real-world APIs and measuring impact via link count and coverage across the dataset.

Experimental results

Research questions

  • RQ1What are the primary schema translation challenges when converting OpenAPI-based REST APIs to GraphQL?
  • RQ2How prevalent are missing semantic relationships between resources in real-world OpenAPI specifications?
  • RQ3To what extent can automated link generation improve the usability of OpenAPI-to-GraphQL wrappers?
  • RQ4What heuristics can effectively infer hierarchical relationships between REST endpoints without explicit metadata?
  • RQ5How many real-world APIs can benefit from automated link augmentation in their OpenAPI documentation?

Key findings

  • The OpenAPI-Link-Generator added over 7,500 link definitions across 34% of the 1,568 OpenAPI documents analyzed in the APIs.guru directory.
  • The tool significantly improves query expressiveness in GraphQL wrappers, enabling nested queries like fetching a repository and its branches in a single request.
  • Missing link definitions were a major cause of underfetching and reduced query expressiveness in OpenAPI-to-GraphQL translations.
  • The heuristic approach based on path hierarchy and parameter consistency successfully inferred valid relationships in a majority of cases without false positives.
  • The tool’s impact was validated on real-world APIs, including GitHub, demonstrating tangible improvements in query usability.
  • The tool is available as a CLI, npm module, and web service, enabling broad adoption and integration into existing API development workflows.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.