Open filosganga opened 1 year ago
Thanks for the very detailed report 💯 I'll have a look
I'll be totally honest with you: I'm not very familiar with this part of the code. What you mention makes sense for me.
Would you be ready to making a PR for that? If possible, it'd be great to cover that with some tests. I can then make a new RC release to test that on several internal applications.
Thank you, I will definitely make a PR
Hello, I am playing with the custom scalars, and I have found something weird. Assuming I have a scalar like this one:
And a schema like so:
When the
FutureResolver
tries to resolve the birthday value, it fail with ClassCastException because the Scalar coerceOutput expects a LocalData, however, under the hood our model is Json.Then I notice the
extractScalar
function isResolverBasedAstSchemaBuilder
:That in my opinion should use
coerceInput
orcoerceUserInput
of the scalar before returning the coerced (that is not really coerced). As this is what it does with the other built-in types: it returns Long, BigInt, BigDecimal and so on, while in case of a custom scalar, returns the value taken from theInputUnmarshaller
as-isI have tried changing the last case like this:
And does the trick, however, I am not sure if it should really use
coerceInput
insteadMaking the above change, all the tests are green 🟢