mst-gql icon indicating copy to clipboard operation
mst-gql copied to clipboard

It should be possible to generate non-nullable fields

Open mweststrate opened this issue 6 years ago • 1 comments

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'.

mweststrate avatar May 27 '19 19:05 mweststrate

Related to #33 too

Amareis avatar Jul 05 '19 09:07 Amareis