Misbehavior for scalar type , maybe an edge case ?
Closed this issue · 5 comments
Is the parse function meant to filter null or undefined value ? If that's the case, when the value is number 0, the returned value will be false.
graphql-weaver/src/pipeline/custom-scalar-types-serialization.ts
Lines 28 to 31 in 0885029
And also maybe we need to deal with empty string too since empty string also is false.
You're right, it seems like we forgot those cases there. I'll try to look into it in the next few days. Of course, you're also welcome to submit a PR with a failing test or a fix.
Is it okay change to this ?
function parseValue(value: any) {
return value;
}
@henkesn Do you remember why you added the || false
? In any case, we should add some regression tests.
@gengjiawen Thanks again for the bug report. We just released 0.11.4, please let us know if this does not fix your problem.