Description
While upgrading to GraphQL Java 21, I stumbled over the method valueToLiteral
offered by the Coercing
interface. So far, when implementing a custom scalar, I haven't bothered about implementing this method and have not encountered any problems so far although the default implementation throws an exception.
In the JavaDoc of the Coercing
interface, it says that "every valid external input values for parseValue(Object)
is also valid for valueToLiteral(Object)
and vice versa" which suggest that the argument to valueToLiteral
should be in serialized form. However, when looking at implementations of this method, I see that most often serialze
is called first on the argument, which suggests otherwise.
Could you please improve the JavaDoc and also the documentation on custom scalars, which does not mention this method at all?