The Evolution of GraphQL Code Generation
summary
GraphQL Code Generator evolves from handwritten typings in 2017 to generating hooks in 2018–19 and then to emitting a typed DocumentNode around 2020, which embeds operation result and variable types in the GraphQL AST. That change lets Apollo Urql and graphql-request infer types uniformly and allows sunsetting many per-client plugins. A fragmented operation co-location preset is now available to compose component fragments into minimal queries, eliminating “zombie” .graphql files and overfetching, and a persistent operations feature emits a JSON of queries with hashes for easy server-side lookup.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 1:35Early type safety methods
- 3:35Generating React hooks
- 5:07The AST-based approach
- 8:41Fragment-based development
- 12:35Future and conclusions
related talks
27mThe ultimate GraphQL client development experience
30mThe Biggest Change To GraphQL Codegen in 10 Years
09mThe new GraphQL Codegen
12mThe Next Generation of GraphQL and TypeScript
06mAutomagic TypeScript Codegen for GraphQL
25mWeb applications of the future with TypeScript and GraphQL
16mIntro to GraphQL
32mFrom learning to thinking in GraphQL
