Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for GraphQL Required #27

Open
FelipeCoimbra opened this issue Jan 28, 2019 · 3 comments
Open

Support for GraphQL Required #27

FelipeCoimbra opened this issue Jan 28, 2019 · 3 comments

Comments

@FelipeCoimbra
Copy link

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

@nevir
Copy link
Contributor

nevir commented Jan 28, 2019

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)

@FelipeCoimbra
Copy link
Author

Wouldn't it be better to release a new minor (new major would actually be better suited) than creating one single optional flag?

@nevir
Copy link
Contributor

nevir commented Jan 29, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants