mst-gql
mst-gql copied to clipboard
It should be possible to generate non-nullable fields
Depends on #8
Currently, all fields (except id and __typename) are generated to be a types.maybe, as they might never be instantiated.
However, in strict typescript, this will require a lot of non-null assertions. Also, it can be very good to make it mandatory that queries for a certain type also fetch a certain field.
So it would be could to have an option, for example, that specifies mandatory fields, for example: --mandatoryFields 'User.name,Todo.title'.
Related to #33 too