enumType<Value> function

GraphQLEnumType<Value> enumType<Value>(
  1. String name,
  2. Map<String, Value> values, {
  3. String? description,
  4. GraphQLTypeDefinitionExtra<EnumTypeDefinitionNode, EnumTypeExtensionNode> extra = const GraphQLTypeDefinitionExtra.attach([]),
})

Shorthand for building a GraphQLEnumType.

Implementation

GraphQLEnumType<Value> enumType<Value>(
  String name,
  Map<String, Value> values, {
  String? description,
  GraphQLTypeDefinitionExtra<EnumTypeDefinitionNode, EnumTypeExtensionNode>
      extra = const GraphQLTypeDefinitionExtra.attach([]),
}) {
  return GraphQLEnumType(
    name,
    values.entries.map((e) => GraphQLEnumValue(e.key, e.value)).toList(),
    description: description,
    extra: extra,
  );
}