cometkim / gatsby-plugin-typegen

Let's give developers using GatsbyJS better DX with extreme type-safety
https://www.gatsbyjs.org/packages/gatsby-plugin-typegen/
MIT License
204 stars 25 forks source link

Avoid usage of Maybe #134

Closed akzhy closed 3 years ago

akzhy commented 3 years ago

Hi, Is it possible to avoid using Maybe<T> in the generated ts file? Currently whenever I am accessing a property I will have to ensure all the parent nodes are not undefined or it will throw error.

cometkim commented 3 years ago

Sorry @akzhy. I had missed the notification. I think this is a question about explicit vs implicit schema. I'll add a FAQ or document to explain this.

akzhy commented 3 years ago

Hey @cometkim no problem, I fixed the issue by using Gatsby's schema customisation. I just had to specify which fields were non nullable.