Dynamically Serving a GraphQL API with Custom Types at Runtime
summary
Benchling builds a per-customer GraphQL graph at runtime using Strawberry by generating SDL, creating Python dataclasses with forward refs, and emitting resolvers; scale hits include 100 built-ins and customers with up to 5,000 types and 40,000 enum members. To fix slow introspection it caches the generated SDL to S3 with a hash key and background refreshes, achieving a ~50% cache hit and cutting introspection from >60s to <1s. Runtime requests generate a subgraph-per-request (dozens, not thousands of types) to keep queries under a second.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 0:23Benchling use case
- 7:49Existing GraphQL APIs
- 9:12GraphQL frameworks
- 10:16Dynamic graph generation
- 15:19Technical challenges
- 19:32Performance per request
- 21:40Q&A
related talks
41mBuilding high-performance, type-safe GraphQL APIs with Strawberry and Django
37mScaling Schema Cardinality Constructing Types at Runtime
46mBuilding high-performance, type-safe GraphQL APIs with Strawberry and Django
56mDistributed GraphQL APIs
16mHow I Started Mocking My GraphQL Schema
16mIntro to GraphQL
58mGraphQL -- Flexible APIs for Adaptive Clients
24mA GraphQL Survival Kit
