GraphQLScalarType <TInternal, TExternal>
Index
Constructors
constructor
Type parameters
- TInternal = unknown
- TExternal = TInternal
Parameters
config: Readonly<GraphQLScalarTypeConfig<TInternal, TExternal>>
Returns GraphQLScalarType<TInternal, TExternal>
Properties
astNode
description
extensionASTNodes
extensions
name
parseConstLiteral
parseLiteral
parseValue
serialize
specifiedByURL
valueToLiteral
Accessors
[toStringTag]
Returns string
Methods
toConfig
Returns GraphQLScalarTypeNormalizedConfig<TInternal, TExternal>
toJSON
Returns string
toString
Returns string
Scalar Type Definition
The leaf values of any request and input values to arguments are Scalars (or Enums) and are defined with a name and a series of functions used to parse input from ast or variables and to ensure validity.
If a type's serialize function returns
null
or does not return a value (i.e. it returnsundefined
) then an error will be raised and anull
value will be returned in the response. It is always better to validateExample:
Custom scalars behavior is defined via the following functions:
replaceVariables()
utility and theparseConstLiteral()
method.