Generating TypeScript Types From GraphQL Schemas

Friday, Jun 12, 2020 1 minute read Tags: javascript typescript web serverless
Hey, thanks for the interest in this post, but just letting you know that it is over 3 years old, so the content in here may not be accurate.

Last week I did a live stream on creating a web app with React, TypeScript and GraphQL and there was a question that popped up on whether or not you could generate the TypeScript types from the GraphQL schema, as I was creating them by hand.

Today, I did a last-minute stream in which I showed how you could do it using GraphQL Code Generator. It was really simple to integrate and what’s more, I found a problem in the types I had written by hand relative to the GraphQL schema, so it’s a win-win. I even showed off how the pull request feature of Static Web Apps works.