An empirical evaluation of a new adaptive static query cost tool in GraphQL APIs
2026 (English) Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE credits
Student thesis Alternative title
En empirisk utvärdering av ett nytt adaptivt verktyg för statisk kostnadsanalys av frågor i GraphQL-API:er (Swedish)
Abstract [en]
GraphQL query cost analysis is widely used to protect APIs from excessive resource consumption and denial-of-service attacks. However, existing approaches often fail to accurately reflect actual system load and provide limited guidance for tool selection, configuration, and interpretation of predicted costs across different query categories. This thesis addresses this gap by proposing a novel structure-adaptive static query cost analysis tool and investigating its performance compared to publicly available static tools when predicting actual runtime behavior. The evaluation is conducted within a Node.js environment, focusing on multiple GraphQL query categories, including deeply nested queries and those containing aliases or aggregations. Predicted cost scores are compared with observed system metrics, namely CPU usage, memory consumption, response time, and response size, using statistical correlation. The results show that the proposed adaptive tool achieves slightly better performance in predicting response time and response size compared to existing tools, though no significant improvement is observed for CPU and memory usage. Additionally, the findings reveal that the effectiveness of all evaluated tools depends strongly on the query category; notably, nested queries consistently exhibit the weakest correlation between predicted and actual costs. Overall, this work contributes to a deeper understanding of the limitations and capabilities of static query cost analysis tools, offering practical insights for developers, backend engineers, and system architects when evaluating and configuring these tools.
Place, publisher, year, edition, pages 2026.
Keywords [en]
GraphQL, adaptive, static query complexity analysis, cost analysis
National Category
Computer Sciences
Identifiers URN: urn:nbn:se:lnu:diva-149671 OAI: oai:DiVA.org:lnu-149671 DiVA, id: diva2:2102865
2026-09-222026-09-182026-09-22 Bibliographically approved