Constructor and Description |
---|
GraphqlStringCoercing() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
parseLiteral(java.lang.Object input)
Called during query validation to convert a query input AST node into a Java object acceptable for the scalar type.
|
java.lang.String |
parseValue(java.lang.Object input)
Called to resolve an input from a query variable into a Java object acceptable for the scalar type.
|
java.lang.String |
serialize(java.lang.Object input)
Called to convert a Java object result of a DataFetcher to a valid runtime value for the scalar type.
|
Value |
valueToLiteral(java.lang.Object input)
Converts an external input value to a literal (Ast Value).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parseLiteral
public java.lang.String serialize(java.lang.Object input)
Coercing
Note : Throw CoercingSerializeException
if there is fundamental
problem during serialisation, don't return null to indicate failure.
Note : You should not allow RuntimeException
s to come out of your serialize method, but rather
catch them and fire them as CoercingSerializeException
instead as per the method contract.
public java.lang.String parseValue(java.lang.Object input)
Coercing
Note : You should not allow RuntimeException
s to come out of your parseValue method, but rather
catch them and fire them as CoercingParseValueException
instead as per the method contract.
parseValue
in interface Coercing<java.lang.String,java.lang.String>
input
- is never nullpublic java.lang.String parseLiteral(java.lang.Object input)
Coercing
Value
.
Note : You should not allow RuntimeException
s to come out of your parseLiteral method, but rather
catch them and fire them as CoercingParseLiteralException
instead as per the method contract.
parseLiteral
in interface Coercing<java.lang.String,java.lang.String>
input
- is never nullpublic Value valueToLiteral(java.lang.Object input)
Coercing
Coercing.parseValue(Object)
.valueToLiteral
in interface Coercing<java.lang.String,java.lang.String>
input
- an external input value