Lune

FSE2020顶会

A principled approach to GraphQL query cost analysis

Alan Cha, Erik Wittern, Guillaume Baudart, James C. Davis, Louis Mandel, Jim Alain Laredo

摘要

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 executing it. Our approach can be applied in a separate API management layer and used with arbitrary GraphQL backends. In contrast to existing static approaches, our analysis supports common GraphQL conventions that affect query cost, and our analysis is provably correct based on our formal specification of GraphQL semantics.

We demonstrate the potential of our approach using a novel GraphQL query-response corpus for two commercial GraphQL APIs. Our query analysis consistently obtains upper cost bounds, tight enough relative to the true response sizes to be actionable for service providers. In contrast, existing static GraphQL query analyses exhibit over-estimates and under-estimates because they fail to support GraphQL conventions.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix Strategies 引用了 Exploiting Input Sanitization for Regex Denial of Service
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper4

  1. Exploiting Input Sanitization for Regex Denial of ServiceEfe Barlas, Xin Du, James C. DavisICSE 2022 · 16 次引用
  2. GraphQLify: Automated and Type Safety-Preserving GraphQL API AdoptionSaleh Amareen, Arif Rahman, Sazzadur Rahaman, Amiangshu BosuFSE 2026
  3. Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix StrategiesSk Adnan Hassan, Zainab Aamir, Dongyoon Lee, James C. Davis 等S&P 2023
  4. ORFA: Exploring WebAssembly as a Turing Complete Query Language for Web APIsYuhao Gu, Chunyu Chen, Jiangsu Du, Xiaoxi Zhang 等WWW 2025

相关 Paper

  1. GQL and SQL/PGQ: Theoretical Models and Expressive PowerAmélie Gheerbrant, Leonid Libkin, Liat Peterfreund, Alexandra RogovaVLDB 2025 · 16 次引用
  2. Skyler: Static Analysis for Predicting API-Driven Costs in Serverless ApplicationsBernardo Ribeiro, Mafalda Ferreira, José Fragoso Santos, Rodrigo Bruno 等ASPLOS 2026
  3. Flexible and Expressive Typed Path Patterns for GQLWenjia Ye, Matías Toro, Tomás Díaz, Bruno C. d. S. Oliveira 等OOPSLA 2025 · 1 次引用
  4. Adaptive Text2GQL: Integrating Structural Twig Linking and Evolutionary In-Context LearningFang Niu, Chaokun Wang, Hang Zhang, Songyao WangACL 2026
  5. LORE: Learning-Based Resource Recommendation for Big Data QueriesYan Li, Liwei Wang, Bolong Zheng, Zhiyong PengICDE 2025 · 2 次引用
黄昏的海面,两侧是细线勾勒的悬崖