-
Notifications
You must be signed in to change notification settings - Fork 2k
GraphQLNonNull and empty strings #480
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
Comments
Currently GraphQL doesn't handle form-style validation, like ensuring the length of a string (an empty string is definitely not You might be interested in this thread, which talks about using custom input types for validation like this: #361 |
Yeah that's what I thought. Thanks, I'll keep an eye on that thread. |
In the model do it like this:
that will include both null and empty strings |
I assumed that if I have an argument with type
new GraphQLNonNull(GraphQLString)
, it would not allow empty strings. But it seems this is not the case. Is there another way to make sure empty strings are caught for required arguments?The text was updated successfully, but these errors were encountered: