enumTypeFromClassMirror function

  1. @deprecated
GraphQLEnumType enumTypeFromClassMirror (
  1. ClassMirror mirror
)

Implementation

@deprecated
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),
  );
}