Better describe what Coercing.valueToLiteral
is for
#3558
Labels
keep-open
Tells Stale Bot to keep PRs and issues open
Coercing.valueToLiteral
is for
#3558
While upgrading to GraphQL Java 21, I stumbled over the method
valueToLiteral
offered by theCoercing
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 forparseValue(Object)
is also valid forvalueToLiteral(Object)
and vice versa" which suggest that the argument tovalueToLiteral
should be in serialized form. However, when looking at implementations of this method, I see that most oftenserialze
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?
The text was updated successfully, but these errors were encountered: