Support for GraphQL Required
I am opening a new issue since the other one (#4) is old and I haven't received any response in the discussion. ts2gql is great but there are a lot of features of the GraphQL SDL that it does not support yet. Required is an essential feature and it would be great to exist support from the original repo.
I believe the most correct approach would be to create a NonNull node as a Wrapping Type and make everything required by default. This combines with the specification of TypeScript that declaring a function parameter requires the function to have this parameter and declaring an interface property requires it's not undefined (unless stated). Unions with null and undefined and ? marks would mark it as not required.
I'm up to implement this feature and submit a PR
Yeah; I think this would be very valuable and we'd accept a PR about it (please make it an optional thing, though; since it's potentially a big migration for people)
Wouldn't it be better to release a new minor (new major would actually be better suited) than creating one single optional flag?
There will likely be other changes added after this one, and we shouldn't expect/force everyone to migrate to the new approach just to pick them up.
I know it'd take quite a while for us to migrate all our usages over