import { GraphQL } from "https://deno.land/x/drash@v2.8.1/src/services/graphql/graphql.ts";
const { GraphQLEnumType } = GraphQL;
Enum Type Definition
Some leaf values of requests and input values are Enums. GraphQL serializes Enum values as strings, however internally Enums can be represented by any kind of type, often integers.
Example:
const RGBType = new GraphQLEnumType({
name: 'RGB',
values: {
RED: { value: 0 },
GREEN: { value: 1 },
BLUE: { value: 2 }
}
});
Note: If a value is not provided in a definition, the name of the enum value will be used as its internal value.
Constructors
new
GraphQLEnumType(config: Readonly<GraphQLEnumTypeConfig>)Properties
astNode: Maybe<EnumTypeDefinitionNode>
extensionASTNodes: Maybe<ReadonlyArray<EnumTypeExtensionNode>>
extensions: Maybe<Readonly<GraphQLEnumTypeExtensions>>
Methods
getValue(name: string): Maybe<GraphQLEnumValue>
getValues(): Array<GraphQLEnumValue>
inspect(): string
parseLiteral(valueNode: ValueNode, _variables: Maybe<{ [key: string]: any; }>): Maybe<any>
parseValue(value: any): Maybe<any>
serialize(value: any): Maybe<string>
toConfig(): GraphQLEnumTypeConfig & { extensions: Maybe<Readonly<GraphQLEnumTypeExtensions>>; extensionASTNodes: ReadonlyArray<EnumTypeExtensionNode>; }
toJSON(): string
toString(): string