Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/drash/src/services/graphql/graphql.ts>GraphQL.GraphQLEnumType

A microframework for Deno's HTTP server with zero third-party dependencies
Go to Latest
class GraphQL.GraphQLEnumType
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>
description: Maybe<string>
extensionASTNodes: Maybe<ReadonlyArray<EnumTypeExtensionNode>>
extensions: Maybe<Readonly<GraphQLEnumTypeExtensions>>
name: string

Methods

getValue(name: string): Maybe<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