validation icon indicating copy to clipboard operation
validation copied to clipboard

fix: allow nullable input objects and arrays

Open peterc1731 opened this issue 2 years ago • 4 comments

Fixes https://github.com/mercurius-js/validation/issues/57

When inferring types from the schema, the library does not consider nullability for objects or arrays. The test that validates nullable input types ("should support nullable input type arguments") was only validating string type inputs, when adding validation for a few more input types as I've done in this PR, that test fails.

I've applied a fix for the issue as well as updating the tests, I'm not sure if the approach is the best one, but it works and its a simple change with low impact on the rest of the behaviour.

peterc1731 avatar Mar 02 '23 15:03 peterc1731

Thanks for submitting - I'll take a look tonight :)

jonnydgreen avatar Mar 02 '23 15:03 jonnydgreen

@peterc1731 Thanks for addressing this fix! I've seen the significance of this issue, and I've found that this solution works accurately. Is there any reason to hold back from merging this pull request?

bglgwyng avatar Aug 11 '23 06:08 bglgwyng

@peterc1731 are you still interested in addressing @jonnydgreen comment? @bglgwyng maybe would you like to take over?

mcollina avatar Aug 11 '23 08:08 mcollina

@peterc1731 are you still interested in addressing @jonnydgreen comment?

Apologies, completely forgot to get back to this one! I will take a look today.

peterc1731 avatar Aug 13 '23 11:08 peterc1731

@mcollina thinking a semver patch release for this one?

jonnydgreen avatar Oct 12 '24 09:10 jonnydgreen

yes

mcollina avatar Oct 12 '24 09:10 mcollina