dart-backend / graphql_dart

GraphQL for Dart
https://github.com/dukefirehawk/graphql_dart
BSD 3-Clause "New" or "Revised" License
16 stars 5 forks source link

Missing parameter in Angel() in example/main.dart and example/subscription.dart of angel_graphql #18

Open xrandy00 opened 1 year ago

xrandy00 commented 1 year ago

After cloning the repo and trying to run the example project, both subscription.dart and main.dart throw exception

Unsupported operation: You attempted to perform a reflective action, but you are using ThrowingReflector, a class which disables reflection. Consider using the MirrorsReflector class if you need reflection. Features like controllers, constructor dependency injection, and ioc require reflection, and will not work without it.

For more, see the documentation: https://docs.angel-dart.dev/guides/dependency-injection#enabling-dart-mirrors-or-other-reflection

0 ThrowingReflector.reflectClass (package:angel3_container/src/throwing.dart:30:46)

1 getAnnotation (package:angel3_framework/src/util.dart:23:35)

2 Service._addRoutesInner (package:angel3_framework/src/core/service.dart:239:18)

3 Service.addRoutes (package:angel3_framework/src/core/service.dart:231:5)

4 HookedService.addRoutes (package:angel3_framework/src/core/hooked_service.dart:152:11)

5 Routable.use (package:angel3_framework/src/core/routable.dart:134:12)

6 Angel.use (package:angel3_framework/src/core/server.dart:387:18)

7 main (file:///Users/vojtech.randysek/Work/EmbedIT/Yettel/graphql_dart-master/angel_graphql/example/main.dart:22:25)

8 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:296:19)

9 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)

This is caused by not specifying reflector on line 13 https://github.com/dukefirehawk/graphql_dart/blob/master/angel_graphql/example/main.dart

The correct constructor use can be seen here https://pub.dev/packages/angel3_container

dukefirehawk commented 1 year ago

The issue with the examples have been fixed in angel3_graphql:8.0.1. The two examples should be able to run now.