How you generate the types from graphql. I noticed most of the generators create types with all optional keys. Do basically you need to check all the time...
If they're creating types with optional keys it's probably because that's how you're defining your types in GraphQL. E.g. with
type Foo {
bar: String
}
bar would be optional in the Typescript type because it's specified as optional in the GraphQL type. You would need to do the following to make it required:
type Foo { bar: String }
bar would be optional in the Typescript type because it's specified as optional in the GraphQL type. You would need to do the following to make it required:
type Foo { bar: String! }