package graphql.schema;


public interface Coercing<I, O> {


    /**
     * Called to convert a result of a DataFetcher to a valid runtime value.
     *
     * @param input is never null
     * @return null if not possible/invalid
     */
    O serialize(Object input);

    /**
     * Called to resolve a input from a variable.
     * Null if not possible.
     *
     * @param input is never null
     * @return null if not possible/invalid
     */
    I parseValue(Object input);

    /**
     * Called to convert a AST node
     *
     * @param input is never null
     * @return null if not possible/invalid
     */
    I parseLiteral(Object input);
}

@@ -19,16 +19,54 @@
 hema;%0A%0A%0A
+import graphql.PublicSpi;%0A%0A@PublicSpi%0A
 public i
@@ -620,36 +620,127 @@
 urn 
+A 
 null 
-if not possible/invalid
+value indicates that the literal is not valid. See %7B@link graphql.validation.ValidationUtil#isValidLiteralValue%7D
 %0A   

improve javadoc, mark as public spi