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

Fix falsy string and int query values #189

Merged
merged 1 commit into from
Aug 6, 2023

Conversation

ant-roli
Copy link
Contributor

@ant-roli ant-roli commented Aug 6, 2023

#133 and #177 fixed this for input objects, but not query values.

Sending a 0 value on an int with min constraint or an empty string on a string with minLength constraint would skip validation previously.

Making the values non-nullable doesn't help, and using defaults (in a resolver) can help, but not for all cases. For instance for an auth query you don't want to give a username a default and cause db queries for something that should be failing validation.

See #187 for an example of the problem.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 5778877049

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 94.855%

Totals Coverage Status
Change from base Build 5619996352: 0.03%
Covered Lines: 357
Relevant Lines: 366

💛 - Coveralls

@confuser confuser merged commit 915eb8d into confuser:master Aug 6, 2023
6 checks passed
@ant-roli ant-roli deleted the fix-falsy-values branch August 7, 2023 11:54
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

Successfully merging this pull request may close these issues.

None yet

3 participants