We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
FlowType allows 3 cases of optional fields and nullable types as explained here: https://stackoverflow.com/questions/37165601/flowtype-how-to-annotate-union-with-optional-fields/37174244#37174244
When a user marks a GraphQL field as NonNull, the current code assumes the 3rd case, which is incorrect. It should assume the 2nd as the GraphQL spec does not allow the 3rd case. https://github.com/joarwilk/gql2flow/blob/master/util/interface.js#L104
The text was updated successfully, but these errors were encountered:
I see now this was previously discussed: #12
This makes sense to me but the issue still applies to input types. For example this graphql definition:
input CreateUserInput { name: String! role: String }
Will generate this FlowType:
declare type CreateUserInput = { name: string; role?: ?string; }
Which is too lax. It should be:
declare type CreateUserInput = { name: string; role?: string; }
Sorry, something went wrong.
My proposed solution: mikestaub@159facd
No branches or pull requests
FlowType allows 3 cases of optional fields and nullable types as explained here:
https://stackoverflow.com/questions/37165601/flowtype-how-to-annotate-union-with-optional-fields/37174244#37174244
When a user marks a GraphQL field as NonNull, the current code assumes the 3rd case, which is incorrect. It should assume the 2nd as the GraphQL spec does not allow the 3rd case.
https://github.com/joarwilk/gql2flow/blob/master/util/interface.js#L104
The text was updated successfully, but these errors were encountered: