Conversation
Codecov Report
@@ Coverage Diff @@
## master #53 +/- ##
=======================================
Coverage 87.44% 87.44%
=======================================
Files 61 61
Lines 1107 1107
Branches 194 194
=======================================
Hits 968 968
Misses 138 138
Partials 1 1
Continue to review full report at Codecov.
|
| }); | ||
|
|
||
| it('Will allow registering argument at runtime', () => { | ||
| @ObjectType() |
There was a problem hiding this comment.
This test should keep focusing only on registering args at runtime. Having default values tested here pollutes this test
There was a problem hiding this comment.
yeah I agree, I haven't actually changed this test at all, I have no idea why github has decided to render the diff like this, my own tools don't. Though it does look like something autoformatted the parameter block (line 97), maybe that's it.
| return baz; | ||
| } | ||
| } | ||
| const compiledObject = compileObjectType(Foo); |
There was a problem hiding this comment.
Would be good to test it basing on resolving some field that is based on knowing default value.
There was a problem hiding this comment.
Yeah I couldn't think of a way to do this, maybe defining a schema in the test, compiling it and executing against it?
There was a problem hiding this comment.
Added such a condition, I hope async/await is OK, seemed the easiest way to do it.
Reverted format change to pre-existing test
Found reference to having defaultValue defined in the docs, but it isn't actually in the code (and I thought it'd be good to use).
I figured it should be fairly straightforward to implement, so I've had a go. The only thing I'm not clear about is whether having a defaultValue defined means the type is nullable? I think they are independent still, so I've left isNullable alone.
Hopefully I haven't missed anything, I haven't made an effort to try and understand the whole codebase, just the bits I was interested in.