EPISODE · Sep 2, 2022 · 55 MIN
Type safety from Hasura to SWR
from Frontend First · host Frontend First
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 - Intro2:51 - Using GraphQL Language Server to get autocomplete + linting13:05 - Getting type information on the return object from a query passed to SWR24:06 - Generating TypedDocumentNode objects with GraphQL codegen33:33 - Using zod for run-time validationLinks:GraphQL Tag / gqlGraphQL codegenGraphQL codegen over the yearsRyan’s Tweet with TypedDocumentNodeZeusHasuraZod
What this episode covers
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.
NOW PLAYING
Type safety from Hasura to SWR
No transcript for this episode yet
Similar Episodes
Sep 26, 2023 ·65m
Sep 26, 2023 ·66m
Sep 26, 2023 ·69m
Sep 26, 2023 ·64m
Sep 26, 2023 ·66m
Sep 26, 2023 ·61m