Interface GraphQLScalar


public interface GraphQLScalar

The coercion of a custom scalar, such as scalar Date: Spring for GraphQL's Coercing. Register one with GraphQL.Builder.scalar(String, GraphQLScalar).

A custom scalar with none passes values through as they are: what a resolver returns is written as JSON, and what a client sends is handed to the resolver as the JSON value (a string, number, boolean, list or map).

  • Method Summary

    Modifier and Type
    Method
    Description
    The value a resolver receives for input, which the client sent, either as a variable or as a literal in the document.
    The value to write for value, which a resolver returned: a string, number, boolean, list or map.
  • Method Details

    • serialize

      Object serialize(Object value)

      The value to write for value, which a resolver returned: a string, number, boolean, list or map.

      Throws
      • GraphQLException: when value cannot be represented
    • parseValue

      Object parseValue(Object input)

      The value a resolver receives for input, which the client sent, either as a variable or as a literal in the document.

      Throws
      • GraphQLException: when input is not a valid value