enumTypeFromClassMirror function

  1. @Deprecated('No replacement yet')
GraphQLEnumType enumTypeFromClassMirror(
  1. ClassMirror mirror
)

Implementation

@Deprecated('No replacement yet')
GraphQLEnumType enumTypeFromClassMirror(ClassMirror mirror) {
  var values = <GraphQLEnumValue>[];

  for (var name in mirror.staticMembers.keys) {
    if (name != #values) {
      var methodMirror = mirror.staticMembers[name]!;
      values.add(
        GraphQLEnumValue(
          MirrorSystem.getName(name),
          mirror.getField(name).reflectee,
          description: _getDescription(methodMirror.metadata),
          deprecationReason: _getDeprecationReason(methodMirror.metadata),
        ),
      );
    }
  }

  return GraphQLEnumType(
    MirrorSystem.getName(mirror.simpleName),
    values,
    description: _getDescription(mirror.metadata),
  );
}