REST in Peace? GraphQL vs REST in the Age of Agentic AI
summary
Benchmarks compare REST and GraphQL by building identical backends on Supabase Postgres, a Streamlit UI and an agent using GPT‑4 via OpenAI, measuring token use, tool-call round trips and accuracy. Results vary by query: one test shows GraphQL doing 2 calls and consuming 35,000 tokens while REST answers in one call with 77 tokens but GraphQL later wins some atomic retrievals (fewer tokens) and loses on accuracy. Round trips average 4–5 and sometimes spike to 30. Conclusion: outcome depends on queries, tool definitions and response compression strategies.
AI-written summary · about
chapters (5)
- 0:00Introduction
- 3:58REST vs GraphQL benchmark setup
- 9:54Experiment results
- 16:08API strategy recommendations
- 22:06Benchmark framework & takeaways








