SlideShare a Scribd company logo
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
1
A Link Generator for Increasing the Utility of
OpenAPI-to-GraphQL Translations
The Web Conference 2020: Developers Track
Dominik Kus, István Koren, Ralf Klamma
kus,koren,klamma@dbis.rwth-aachen.de
Chair of Computer Science 5 Information Systems & Databases
RWTH Aachen University
April 20, 2020
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
2
Overview
Motivation
Introduction to GraphQL
Migration from OpenAPI to GraphQL
Why Links are so important
The Link Generator
Conclusion: Try it out today!
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
3
Motivation
The Web is powered by APIs
APIs enable all kinds of applications (mobile, web,
microservices, . . . )
Today, most of them are REST(-like)
Limitations
Overfetching, e.g. when only name of project required
Underfetching, e.g. /projects/12
/projects/12/contributors
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
4
Introduction to GraphQL
Alternative to REST: GraphQL
Released in 2015 by Facebook
Quickly gaining popularity
Figure: Examples of GraphQL Adopters
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
4
Introduction to GraphQL
Alternative to REST: GraphQL
Released in 2015 by Facebook
Quickly gaining popularity
Figure: Examples of GraphQL Adopters
Query language approach
Mitigates problems of over- and underfetching
Other advantages (tool support, documentation,
developer friendliness, . . . )
We want to leverage these advantages for existing APIs!
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
5
Migration from REST to GraphQL
Automatic migration
Starting point: machine-readable documentation
For GraphQL: GraphQL Schema
For REST: OpenAPI
1
https://github.com/IBM/openapi-to-graphql
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
5
Migration from REST to GraphQL
Automatic migration
Starting point: machine-readable documentation
For GraphQL: GraphQL Schema
For REST: OpenAPI
Open-source wrapper generator
OpenAPI-to-GraphQL1 [Wittern et al., 2018]
1
https://github.com/IBM/openapi-to-graphql
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
6
OpenAPI-to-GraphQL
Open-source wrapper generator
OpenAPI-to-GraphQL2 [Wittern et al., 2018]
Proxies between GraphQL client and REST API
GraphQL Client GraphQL Wrapper REST API
GraphQL query
REST query
REST response
GraphQL response
2
https://github.com/IBM/openapi-to-graphql
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
7
Why Links are so important
If we use OpenAPI-to-GraphQL on most documentations,
queries look somewhat like this
Listing 1: Query without links
{
project(projectId: 12) {
name
}
projectContributors (projectId: 12) {
name
}
}
Equivalent in REST: /projects/12
/projects/12/contributors
No over- or underfetching
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
7
Why Links are so important
If we use OpenAPI-to-GraphQL on most documentations,
queries look somewhat like this
Listing 2: Query without links
{
project(projectId: 12) {
name
}
projectContributors (projectId: 12) {
name
}
}
But: No connection between a project and its contributors
Counter-intuitive
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
8
OpenAPI Link Definitions
OpenAPI Paths
/project/{id}
/project/{id}/contributors
Parameters: . . .
Response Types: . . .
. . .
Parameters: . . .
Response Types: . . .
. . .
type Project {
id: ID
name: String
}
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
8
OpenAPI Link Definitions
OpenAPI Paths
/project/{id}
/project/{id}/contributors
Parameters: . . .
Response Types: . . .
. . .
Parameters: . . .
Response Types: . . .
. . .
Link
type Project {
id: ID
name: String
contributors: [Person]
}
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
9
Missing link definitions
As shown: link definitions required for nested data
New feature in OpenAPI 3.0
Basically non-existent in real-world documentations3
OpenAPI
Other Unknown Total
1.1 1.2 2.0 3.0
Count 1 44 1106 52 185 190 1578
Percentage 0.1% 2.8% 70.1% 3.3% 11.7% 12.0% 100%
Only 3 (!) documents contain links
⇒ Automatic Link Generation
3
Based on over 1500 documentations in the public
https://apis.guru OpenAPI directory
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
10
Demo
https://openapi-link-generator.herokuapp.com/
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
11
Demo: Example Query
Listing 3: Before
{
project(projectId: 12) {
name
}
projectContributors (projectId: 12) {
name
}
}
Listing 4: After
{
project(projectId: 12) {
name
contributors {
name
}
}
}
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
12
Automatic Link Generation
Solution: OpenAPI-Link-Generator
Takes OpenAPI as input and augments it with link
definitions
Available via npm4
Can be used as Node.js library or command line tool
Also available as Web tool5
Concept
Forward slash implies hierarchical
relationship [Massé, 2012]
e.g. /project and /project/contributors
Add links to paths in such a relationship
Consider path parameters in this process
4
https://www.npmjs.com/package/openapi-link-generator
5
https://openapi-link-generator.herokuapp.com/
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
13
Evaluation of the Link Generator
We tested it on over 1500 real-world API documentations6
Links added to about 34% of API documentations
0 2 4 6 8
0
0.2
0.4
0.6
0.8
Number of paths in OpenAPI doc.
Numberoflinksadded
6
Based on the APIs.Guru OpenAPI directory
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
14
Conclusion: Try it out today!
GraphQL is quickly gaining popularity
Has advantages over REST
Big API providers are migrating to it (e.g. GitHub)
OpenAPI-to-GraphQL makes an existing REST API
available over GraphQL
OpenAPI link definitions improve the quality of the
generated schema
However, they are rarely used
Our link generator tool adds those automatically
Tested on real-world documentations
More information in the accompanying article
https://www.npmjs.com/package/openapi-link-generator
https://openapi-link-generator.herokuapp.com/
https://github.com/rwth-acis/openapi-link-generator
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
15
References
Massé, M. (2012).
REST API design rulebook.
O’Reilly, Farnham.
Wittern, E., Cha, A., and Laredo, J. A. (2018).
Generating GraphQL-Wrappers for REST(-like) APIs.
In Mikkonen, T., Klamma, R., and Hernández, J., editors, Web
Engineering, volume 10845 of Lecture Notes in Computer Science,
pages 65–83, Cham. Springer International Publishing.
A Link Generator
for Increasing the
Utility of
OpenAPI-to-
GraphQL
Translations
Dominik Kus,
István Koren,
Ralf Klamma
Motivation
Introduction to
GraphQL
Migration from
OpenAPI to
GraphQL
Why Links are
so important
The Link
Generator
Conclusion:
Try it out
today!
Lehrstuhl i5
Information
Systems
and Databases
16
The End

More Related Content

PDF
GraphQL London January 2018: Graphql tooling
PDF
Graphql
PPTX
GraphQL Introduction
PDF
GraphQL Fundamentals
PDF
Kafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open Web
PDF
GraphQL over REST at Reactathon 2018
PPTX
GraphQL Introduction
PDF
How to GraphQL
GraphQL London January 2018: Graphql tooling
Graphql
GraphQL Introduction
GraphQL Fundamentals
Kafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open Web
GraphQL over REST at Reactathon 2018
GraphQL Introduction
How to GraphQL

What's hot (20)

PDF
Building and deploying GraphQL Servers with AWS Lambda and Prisma I AWS Dev D...
PDF
GraphQL Europe Recap
PDF
REST vs GraphQL
PDF
React and GraphQL at Stripe
PDF
Wrapping and securing REST APIs with GraphQL
PPTX
Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...
PDF
GraphQL across the stack: How everything fits together
PDF
DevOps - How to get technical buy in
PPTX
Shift Dev Conf API
PDF
Leveraging Gradle @ Netflix (Guadalajara JUG Feb 25, 2021)
PPTX
Introduction to GraphQL
PDF
How web works and browser works ? (behind the scenes)
PDF
Enterprise graph applications
PPTX
React Flux to GraphQL
PPTX
05Nov13 Webinar: Introducing Revolution R Enterprise 7 - The Big Data Big Ana...
PDF
ADDO 2019 DevOps in a containerized world
PDF
Modular GraphQL with Schema Stitching
PDF
Better APIs with GraphQL
PDF
Yannis Zarkadas. Enterprise data science workflows on kubeflow
PPTX
Apache Flink First Half of 2015 Community Update
Building and deploying GraphQL Servers with AWS Lambda and Prisma I AWS Dev D...
GraphQL Europe Recap
REST vs GraphQL
React and GraphQL at Stripe
Wrapping and securing REST APIs with GraphQL
Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...
GraphQL across the stack: How everything fits together
DevOps - How to get technical buy in
Shift Dev Conf API
Leveraging Gradle @ Netflix (Guadalajara JUG Feb 25, 2021)
Introduction to GraphQL
How web works and browser works ? (behind the scenes)
Enterprise graph applications
React Flux to GraphQL
05Nov13 Webinar: Introducing Revolution R Enterprise 7 - The Big Data Big Ana...
ADDO 2019 DevOps in a containerized world
Modular GraphQL with Schema Stitching
Better APIs with GraphQL
Yannis Zarkadas. Enterprise data science workflows on kubeflow
Apache Flink First Half of 2015 Community Update
Ad

Similar to A Link Generator for Increasing the Utility of OpenAPI-to-GraphQL Translations (20)

DOCX
How has netflix embraced graph ql for rapid application development
PDF
Flink Community Update 2015 June
PDF
GraphQL Schema Stitching with Prisma & Contentful
PPTX
GraphQL.pptx
PPTX
GraphQL.pptx
PDF
How easy (or hard) it is to monitor your graph ql service performance
PDF
codersera_com (1).pdf
PPTX
Data Science lifecycle with Apache Zeppelin and Spark by Moonsoo Lee
PPTX
London Oracle Developer Meetup April 18
PDF
Alexander Kolb – Flink. Yet another Streaming Framework?
PDF
Present and future of unified, portable, and efficient data processing with A...
PPTX
03_aiops-1.pptx
PPTX
APIdays Paris 2019 - Delivering Exceptional User Experience with REST and Gra...
PPTX
Create API for your Databases
PPTX
Adding Spark support to Kylin at Bay Area Spark Meetup
PDF
GraphQL with .NET Core Microservices.pdf
PDF
Rise of Intermediate APIs - Beam and Alluxio at Alluxio Meetup 2016
PDF
GlueCon 2019: Beyond REST - Moving to Event-Based APIs and Streaming
PPTX
OracleDeveloperMeetup - London 19-12-17
PPTX
Apache® Spark™ MLlib 2.x: migrating ML workloads to DataFrames
How has netflix embraced graph ql for rapid application development
Flink Community Update 2015 June
GraphQL Schema Stitching with Prisma & Contentful
GraphQL.pptx
GraphQL.pptx
How easy (or hard) it is to monitor your graph ql service performance
codersera_com (1).pdf
Data Science lifecycle with Apache Zeppelin and Spark by Moonsoo Lee
London Oracle Developer Meetup April 18
Alexander Kolb – Flink. Yet another Streaming Framework?
Present and future of unified, portable, and efficient data processing with A...
03_aiops-1.pptx
APIdays Paris 2019 - Delivering Exceptional User Experience with REST and Gra...
Create API for your Databases
Adding Spark support to Kylin at Bay Area Spark Meetup
GraphQL with .NET Core Microservices.pdf
Rise of Intermediate APIs - Beam and Alluxio at Alluxio Meetup 2016
GlueCon 2019: Beyond REST - Moving to Event-Based APIs and Streaming
OracleDeveloperMeetup - London 19-12-17
Apache® Spark™ MLlib 2.x: migrating ML workloads to DataFrames
Ad

More from IstvanKoren (14)

PPTX
Immersive Community Analytics for Wearable Enhanced Learning (HCI Internation...
PPTX
Augmented Reality Lernkontexte - Eine Europäische Perspektive
PPTX
The Exploitation of OpenAPI Documents for the Generation of Web Frontends
PDF
The BBC micro:bit - discover your inner maker!
PDF
DevOps Gamification Workshop at JTEL Summer School 2015
PPTX
Smart Ambient Learning with Physical Artifacts Using Wearable Technologies - ...
PDF
Requirements Bazaar - Meet your Users on the Web
PDF
Unpacking the Layers Box
PDF
Layers box agder docker
PDF
Requirements Bazaar powered by AngularJS and Polymer - Talk at Google Develop...
PDF
Requirements Bazaar FOSDEM 2015 Lightning Talk
PDF
DireWolf Goes Pack Hunting: A Peer-to-Peer Approach for Secure Low Latency Wi...
PDF
Shared Editing on the Web: A Classification of Developer Support Frameworks
PDF
Informatik-Kolloquium XMPP
Immersive Community Analytics for Wearable Enhanced Learning (HCI Internation...
Augmented Reality Lernkontexte - Eine Europäische Perspektive
The Exploitation of OpenAPI Documents for the Generation of Web Frontends
The BBC micro:bit - discover your inner maker!
DevOps Gamification Workshop at JTEL Summer School 2015
Smart Ambient Learning with Physical Artifacts Using Wearable Technologies - ...
Requirements Bazaar - Meet your Users on the Web
Unpacking the Layers Box
Layers box agder docker
Requirements Bazaar powered by AngularJS and Polymer - Talk at Google Develop...
Requirements Bazaar FOSDEM 2015 Lightning Talk
DireWolf Goes Pack Hunting: A Peer-to-Peer Approach for Secure Low Latency Wi...
Shared Editing on the Web: A Classification of Developer Support Frameworks
Informatik-Kolloquium XMPP

Recently uploaded (20)

PPTX
ai tools demonstartion for schools and inter college
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPT
Introduction Database Management System for Course Database
PDF
Understanding Forklifts - TECH EHS Solution
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
assetexplorer- product-overview - presentation
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
top salesforce developer skills in 2025.pdf
PPTX
Transform Your Business with a Software ERP System
PDF
System and Network Administration Chapter 2
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
ai tools demonstartion for schools and inter college
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Introduction Database Management System for Course Database
Understanding Forklifts - TECH EHS Solution
PTS Company Brochure 2025 (1).pdf.......
Wondershare Filmora 15 Crack With Activation Key [2025
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Operating system designcfffgfgggggggvggggggggg
Designing Intelligence for the Shop Floor.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
assetexplorer- product-overview - presentation
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
top salesforce developer skills in 2025.pdf
Transform Your Business with a Software ERP System
System and Network Administration Chapter 2
Computer Software and OS of computer science of grade 11.pptx
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus

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

  • 1. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 1 A Link Generator for Increasing the Utility of OpenAPI-to-GraphQL Translations The Web Conference 2020: Developers Track Dominik Kus, István Koren, Ralf Klamma kus,koren,klamma@dbis.rwth-aachen.de Chair of Computer Science 5 Information Systems & Databases RWTH Aachen University April 20, 2020
  • 2. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 2 Overview Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today!
  • 3. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 3 Motivation The Web is powered by APIs APIs enable all kinds of applications (mobile, web, microservices, . . . ) Today, most of them are REST(-like) Limitations Overfetching, e.g. when only name of project required Underfetching, e.g. /projects/12 /projects/12/contributors
  • 4. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 4 Introduction to GraphQL Alternative to REST: GraphQL Released in 2015 by Facebook Quickly gaining popularity Figure: Examples of GraphQL Adopters
  • 5. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 4 Introduction to GraphQL Alternative to REST: GraphQL Released in 2015 by Facebook Quickly gaining popularity Figure: Examples of GraphQL Adopters Query language approach Mitigates problems of over- and underfetching Other advantages (tool support, documentation, developer friendliness, . . . ) We want to leverage these advantages for existing APIs!
  • 6. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 5 Migration from REST to GraphQL Automatic migration Starting point: machine-readable documentation For GraphQL: GraphQL Schema For REST: OpenAPI 1 https://github.com/IBM/openapi-to-graphql
  • 7. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 5 Migration from REST to GraphQL Automatic migration Starting point: machine-readable documentation For GraphQL: GraphQL Schema For REST: OpenAPI Open-source wrapper generator OpenAPI-to-GraphQL1 [Wittern et al., 2018] 1 https://github.com/IBM/openapi-to-graphql
  • 8. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 6 OpenAPI-to-GraphQL Open-source wrapper generator OpenAPI-to-GraphQL2 [Wittern et al., 2018] Proxies between GraphQL client and REST API GraphQL Client GraphQL Wrapper REST API GraphQL query REST query REST response GraphQL response 2 https://github.com/IBM/openapi-to-graphql
  • 9. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 7 Why Links are so important If we use OpenAPI-to-GraphQL on most documentations, queries look somewhat like this Listing 1: Query without links { project(projectId: 12) { name } projectContributors (projectId: 12) { name } } Equivalent in REST: /projects/12 /projects/12/contributors No over- or underfetching
  • 10. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 7 Why Links are so important If we use OpenAPI-to-GraphQL on most documentations, queries look somewhat like this Listing 2: Query without links { project(projectId: 12) { name } projectContributors (projectId: 12) { name } } But: No connection between a project and its contributors Counter-intuitive
  • 11. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 8 OpenAPI Link Definitions OpenAPI Paths /project/{id} /project/{id}/contributors Parameters: . . . Response Types: . . . . . . Parameters: . . . Response Types: . . . . . . type Project { id: ID name: String }
  • 12. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 8 OpenAPI Link Definitions OpenAPI Paths /project/{id} /project/{id}/contributors Parameters: . . . Response Types: . . . . . . Parameters: . . . Response Types: . . . . . . Link type Project { id: ID name: String contributors: [Person] }
  • 13. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 9 Missing link definitions As shown: link definitions required for nested data New feature in OpenAPI 3.0 Basically non-existent in real-world documentations3 OpenAPI Other Unknown Total 1.1 1.2 2.0 3.0 Count 1 44 1106 52 185 190 1578 Percentage 0.1% 2.8% 70.1% 3.3% 11.7% 12.0% 100% Only 3 (!) documents contain links ⇒ Automatic Link Generation 3 Based on over 1500 documentations in the public https://apis.guru OpenAPI directory
  • 14. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 10 Demo https://openapi-link-generator.herokuapp.com/
  • 15. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 11 Demo: Example Query Listing 3: Before { project(projectId: 12) { name } projectContributors (projectId: 12) { name } } Listing 4: After { project(projectId: 12) { name contributors { name } } }
  • 16. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 12 Automatic Link Generation Solution: OpenAPI-Link-Generator Takes OpenAPI as input and augments it with link definitions Available via npm4 Can be used as Node.js library or command line tool Also available as Web tool5 Concept Forward slash implies hierarchical relationship [Massé, 2012] e.g. /project and /project/contributors Add links to paths in such a relationship Consider path parameters in this process 4 https://www.npmjs.com/package/openapi-link-generator 5 https://openapi-link-generator.herokuapp.com/
  • 17. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 13 Evaluation of the Link Generator We tested it on over 1500 real-world API documentations6 Links added to about 34% of API documentations 0 2 4 6 8 0 0.2 0.4 0.6 0.8 Number of paths in OpenAPI doc. Numberoflinksadded 6 Based on the APIs.Guru OpenAPI directory
  • 18. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 14 Conclusion: Try it out today! GraphQL is quickly gaining popularity Has advantages over REST Big API providers are migrating to it (e.g. GitHub) OpenAPI-to-GraphQL makes an existing REST API available over GraphQL OpenAPI link definitions improve the quality of the generated schema However, they are rarely used Our link generator tool adds those automatically Tested on real-world documentations More information in the accompanying article https://www.npmjs.com/package/openapi-link-generator https://openapi-link-generator.herokuapp.com/ https://github.com/rwth-acis/openapi-link-generator
  • 19. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 15 References Massé, M. (2012). REST API design rulebook. O’Reilly, Farnham. Wittern, E., Cha, A., and Laredo, J. A. (2018). Generating GraphQL-Wrappers for REST(-like) APIs. In Mikkonen, T., Klamma, R., and Hernández, J., editors, Web Engineering, volume 10845 of Lecture Notes in Computer Science, pages 65–83, Cham. Springer International Publishing.
  • 20. A Link Generator for Increasing the Utility of OpenAPI-to- GraphQL Translations Dominik Kus, István Koren, Ralf Klamma Motivation Introduction to GraphQL Migration from OpenAPI to GraphQL Why Links are so important The Link Generator Conclusion: Try it out today! Lehrstuhl i5 Information Systems and Databases 16 The End