Frontend First

Type safety from Hasura to SWR


Listen Later

Ryan shares his experience getting end-to-end type safety from a Hasura backend into a React application. He tells Sam about the different ways GraphQL codegen can be used to generate types, and how he ultimately landed on a solution that combines the TypedDocumentNode type and the zod library.

Topics include:

  • 0:00 - Intro
  • 2:51 - Using GraphQL Language Server to get autocomplete + linting
  • 13:05 - Getting type information on the return object from a query passed to SWR
  • 24:06 - Generating TypedDocumentNode objects with GraphQL codegen
  • 33:33 - Using zod for run-time validation

Links:

  • GraphQL Tag / gql
  • GraphQL codegen
  • GraphQL codegen over the years
  • Ryan’s Tweet with TypedDocumentNode
  • Zeus
  • Hasura
  • Zod
...more
View all episodesView all episodes
Download on the App Store

Frontend FirstBy Sam Selikoff, Ryan Toronto

  • 4.8
  • 4.8
  • 4.8
  • 4.8
  • 4.8

4.8

19 ratings


More shows like Frontend First

View all
Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

Syntax - Tasty Web Development Treats

987 Listeners