首页> 外文会议>International conference on web engineering >Generating GraphQL-Wrappers for REST (-like) APIs
【24h】

Generating GraphQL-Wrappers for REST (-like) APIs

机译:为REST(-like)API生成GraphQL-Wrappers

获取原文

摘要

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% of the APIs - however, with limitations 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.
机译:GraphQL是一种查询语言,是一种基于语言的范例,用于实现Web应用程序编程接口(API)以实现客户端与服务器之间的交互。客户端使用GraphQL在类型化查询中定义精确的嵌套数据需求,服务器可针对(可能有多个)后端系统(例如数据库,对象存储或其他API)解决这些需求。客户在单个请求中仅接收他们关心的数据。但是,现有REST(-like)API的提供者需要实现其他GraphQL接口才能实现这些优势。我们在这里评估为现有REST(-like)API自动生成GraphQL包装器的可行性。包装器在收到GraphQL查询后,会将其转换为针对目标API的请求。我们讨论了创建此类包装的挑战,包括处理数据卫生,身份验证或处理嵌套查询。我们进一步介绍了OASGraph的原型实现。 OASGraph将描述现有REST(类似)Web API的OpenAPI规范(OAS)作为输入,并为其生成GraphQL包装器。我们通过针对959个公开可用的OAS运行OASGraph以及现有的开源替代方案来对其进行评估。此实验表明,OASGraph的性能优于现有的替代方法,并且能够为89.5%的API创建GraphQL包装器-但是,在许多情况下存在限制。对OASGraph产生的错误和警告的后续分析表明,评估的OAS中缺少或模棱两可的信息妨碍了创建完整的包装。最后,我们给出了IBM Watson Language Translator API的用例,该用例表明,对OAS的微小更改使OASGraph能够生成更惯用和更具表达力的GraphQL包装器。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号