A Principled Approach to GraphQL Query Cost Analysis
Alan Cha, Erik Wittern, Guillaume Baudart, James C. Davis and, Louis Mandel, Jim A. Laredo

TL;DR
This paper introduces a fast, formal method for estimating the cost of GraphQL queries without executing them, helping service providers manage resources effectively and prevent overloads.
Contribution
It presents a linear-time, correct static analysis approach for GraphQL query cost estimation that supports common conventions and can be integrated into API management.
Findings
The analysis provides tight upper bounds on query costs.
It outperforms existing static methods by accurately supporting GraphQL conventions.
The approach is validated on real-world GraphQL APIs.
Abstract
The landscape of web APIs is evolving to meet new client requirements and to facilitate how providers fulfill them. A recent web API model is GraphQL, which is both a query language and a runtime. Using GraphQL, client queries express the data they want to retrieve or mutate, and servers respond with exactly those data or changes. GraphQL's expressiveness is risky for service providers because clients can succinctly request stupendous amounts of data, and responding to overly complex queries can be costly or disrupt service availability. Recent empirical work has shown that many service providers are at risk. Using traditional API management methods is not sufficient, and practitioners lack principled means of estimating and measuring the cost of the GraphQL queries they receive. In this work, we present a linear-time GraphQL query analysis that can measure the cost of a query without…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware System Performance and Reliability · Software Testing and Debugging Techniques · Software Engineering Research
