Closed ax-vasquez closed 3 years ago
Before, the components using data sourced from sanity were simply typing props.data as any. This was because I had no types in place.
props.data
any
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.
graphql-code-generator
Types are generated during the gatsby develop (and build) commands
gatsby develop
build
Description
Before, the components using data sourced from sanity were simply typing
props.data
asany
. 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
(andbuild
) commands