ax-vasquez / mcnuggies-blog

NextJS site & Sanity Studio code for mcnuggies.dev
http://www.mcnuggies.dev
1 stars 1 forks source link

generate types from gql schema #23

Closed ax-vasquez closed 3 years ago

ax-vasquez commented 3 years ago

Description

Before, the components using data sourced from sanity were simply typing props.data as any. This was because I had no types in place.

Fortunately, there's a Gatsby graphql-code-generator plugin that generates types based on your GQL schema; e.g., the data from the Sanity source.

Types are generated during the gatsby develop (and build) commands