GraphQLEnumType
Implements
- GraphQLSchemaElement
Index
Constructors
constructor
Parameters
config: Readonly<GraphQLEnumTypeConfig>
Returns GraphQLEnumType
Properties
astNode
description
extensionASTNodes
extensions
name
Accessors
[toStringTag]
Returns string
Methods
coerceInputLiteral
Parameters
valueNode: ConstValueNode
optionalhideSuggestions: Maybe<boolean>
Returns any
coerceInputValue
Parameters
inputValue: unknown
optionalhideSuggestions: Maybe<boolean>
Returns any
coerceOutputValue
Parameters
outputValue: unknown
Returns Maybe<string>
getValue
Parameters
name: string
Returns Maybe<GraphQLEnumValue>
getValues
Returns readonly GraphQLEnumValue[]
parseLiteral
Parameters
valueNode: ValueNode
_variables: Maybe<ObjMap<unknown>>
optionalhideSuggestions: Maybe<boolean>
Returns any
parseValue
Parameters
inputValue: unknown
optionalhideSuggestions: Maybe<boolean>
Returns any
serialize
Parameters
outputValue: unknown
Returns Maybe<string>
toConfig
Returns GraphQLEnumTypeNormalizedConfig
toJSON
Returns string
toString
Returns string
valueToLiteral
Parameters
value: unknown
Returns undefined | ConstValueNode
Enum Type Definition
Some leaf values of requests and input values are Enums. GraphQL coerces Enum values as strings, however internally Enums can be represented by any kind of type, often integers.
Example:
Note: If a value is not provided in a definition, the name of the enum value will be used as its internal value.