ArXiv TLDR

GraphQLify: Automated and Type Safety-Preserving GraphQL API Adoption

🐦 Tweet
2604.15465

Saleh Amareen, Arif Rahman, Sazzadur Rahaman, Amiangshu Bosu

cs.SE

TLDR

GraphQLify automates REST to GraphQL migration using static analysis, ensuring type safety and boosting performance by embedding the API.

Key contributions

  • Automated framework for migrating existing REST APIs to GraphQL.
  • Leverages static code analysis for precise, end-to-end type-safe GraphQL schema generation.
  • Generates an embedded server, eliminating performance overhead of separate adapter servers.
  • Achieves 100% conversion with zero type mismatches, outperforming SOTA and reducing data fetching 2-4x.

Why it matters

This paper offers a robust solution for migrating REST APIs to GraphQL, a critical step for modernizing web services. By ensuring end-to-end type safety and significantly improving performance over existing methods, GraphQLify makes GraphQL adoption more practical and efficient. Its automated approach simplifies a complex process.

Original Abstract

GraphQL provides a schema-based, strongly typed query language that enables highly efficient client-server communication. This paper introduces GraphQLify, an automated framework designed to migrate existing REST APIs to GraphQL. Unlike prior approaches that rely on relational databases, resource description frameworks (RDF), or machine-parsable specifications, GraphQLify leverages static source code analysis for precise type inference. This novel technique generates GraphQL schemas that guarantee end-to-end type safety, preserving a core advantage of adopting GraphQL. Furthermore, existing migration tools typically generate separate adapter servers, which introduce performance overhead via dynamic request binding and network latency. GraphQLify eliminates this by generating an embedded server that directly invokes the underlying API code, significantly improving performance. We evaluated GraphQLify on 834 APIs across nine popular open-source projects, where it successfully converted 100% of the APIs with zero type mismatches. In contrast, the current state-of-the-art tool, OASGraph, exhibited a 3.5% failure rate and a 42% type mismatch rate on the same dataset. Finally, our performance evaluation demonstrates that for workflows requiring five sequential API calls, clients using GraphQLify reduce data fetching time by a factor of 2 to 4 compared to their REST counterparts.

📬 Weekly AI Paper Digest

Get the top 10 AI/ML arXiv papers from the week — summarized, scored, and delivered to your inbox every Monday.