GraphQL-first Django
summary
GraphQL-first Django shows a production headless e‑commerce backend (Sailor) built with Graphene and Django exposing a single GraphQL endpoint used by two React+TypeScript SPAs, with over 350 operations in the API. It explains code‑first types and class‑based mutations, JWT auth via graphql_jwt, performance fixes using data loaders to avoid N+1 queries, a 26‑query debug example, pytest-based tests, and notes subscriptions aren’t supported out‑of‑the‑box (Channels or Ariadne needed); custom error handling was implemented and used successfully.
AI-written summary · about
chapters (18)
- 0:00Introduction and speaker intro
- 1:09What is Sailor e-commerce
- 2:34What is GraphQL
- 7:31GraphQL-first Django architecture
- 8:16Graphene framework overview
- 12:13Defining GraphQL types
- 14:39Implementing queries
- 15:43Creating mutations
- 18:11Form-based mutations
- 19:58Authentication with JWT
- 22:29N+1 problem and data loaders
- 26:45Testing GraphQL APIs
- 27:50Real-time subscriptions
- 29:12Why Django for GraphQL
- 30:38Cons of Graphene and GraphQL
- 32:23Alternative libraries like Ariadne
- 35:45Debugging and error handling
- 38:13Q&A on Sailor and GraphQL
