~/talk

GraphQL The Devil's API

Talkat PyCon US 2022 · 2022-04-27..05-03· [graphql]
name:Ryan Kuhl
links:none on file
slides:none on file

Naive GraphQL resolvers cause massive DB round trips; a demo shows a simple three-model query going from ~1.05s to ~0.4s after batching, while a different traversal spikes to ~1.4s and fires hundreds of resolver calls. A Python stack using graphine+SQLAlchemy and Flask implements data-loaders that batch IDs into dense SQL queries via promise-style async, restoring acceptable latency and reducing hundreds of DB round trips to one. An open source tool Query Counter detects N+1s and the approach proves effective in the demos.

AI-written summary · about

  1. 0:00Intro
  2. 1:18Outline
  3. 2:05What is GraphQL
  4. 4:00Query Language
  5. 7:15GraphQL Schema
  6. 8:59GraphQL Database
  7. 9:44SQL Alchemy
  8. 10:10GraphQL Libraries
  9. 10:47GraphQL Models
  10. 20:38Latency
  11. 21:33Python Code
  12. 21:56The Math
  13. 22:55Data Loader
  14. 23:36Data Loader Complexity
  15. 24:33Promises
  16. 26:08Dataloader
  17. 28:27Demo
  18. 32:28Bad GraphQL
  19. 34:03When to use GraphQL
  20. 35:18Query Counter
  21. 35:51Shoutouts
  22. 36:52Meetups
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.