OpenAPI-to-GraphQL v1.0.0: A name change and update for OASGraph
OASGraph gets a fresh start with a name change, a version 1.0.0 release, and new features. Now it is officially OpenAPI-to-GraphQL. The latest features in the new version include multi-OAS support, a simplified code base, the ability to create nested objects, and more.
The OASGraph library gets a fresh coat of paint. It now has a new name, a version 1.0.0 release, and a few more features under its hood. According to an announcement blog posted by IBM’s Alan Cha on July 1, 2019, OASGraph is OpenAPI-to-GraphQL. In addition, it has now been moved to the general IBM GitHub.
This library allows users to translate APIs described by OpenAPI Specifications (OAS) or Swagger into GraphQL.
OpenAPI-to-GraphQL is a library that helps providers leverage existing REST APIs to use this exciting new technology. Taking as input Swagger or OpenAPI Specifications of existing REST APIs, OpenAPI-to-GraphQL autogenerates a GraphQL interface that resolves client queries by translating them into REST API requests. It is the fastest way to get started with GraphQL, without spending any effort to implement a GraphQL API manually.
See what else is new for OpenAPI-to-GraphQL and how the v1.0.0 release expands upon it and adds new features.
New features & changes
Version 1.0.0 begins a new path for OpenAPI-to-GraphQL. From the announcement post by Alan Cha regarding the latest version: “We believe this switch to a first major version adequately reflects the extensive feedback we received on our code and the improvements that both we and the community made to it. The switch to this new version will also enable us to adhere to proper semantic versioning from now on. ”
— OpenAPI-to-GraphQL (@oasgraph) July 1, 2019
Besides the name change, the upgrade to v1.0.0 also includes:
- Multi-OAS support: Create interfaces from multiple APIs by providing multiple OpenAPI Specifications.
- Create nested objects: Make inter-OAS links by defining link objects.
- Custom resolver functions:
- Add a limit argument to fields:
- Added cookie authentication
- Full API key location support
- Exposed request options
- Clearly displayed error extensions:
- Ability to collapse links added
- Added Prettier, an opinionated code formatter
- Simplified code base
- Improved warning handling
- CORS support
Further info for OpenAPI-to-GraphQL
For more information about this project, view the repo on GitHub.
OpenAPI-to-GraphQL can be used either in the Command Line Interface (for quick testing, with limited feature support) or by opening it as a library in your application. It is written in TypeScript and can be installed via Lerna monorepo management system.
Watch this video on YouTube from Alan Cha and learn how to wrap REST APIs in GraphQL with OpenAPI-to-GraphQL.
Read the introduction to the OpenAPI-to-GraphQL project from IBM to find out more about it. The academic research paper Generating GraphQL-Wrappers for REST(-like) APIs goes into the details about building the project. It also includes an experiment that users can run.