graphql-flutter icon indicating copy to clipboard operation
graphql-flutter copied to clipboard

[starwars example] pin graphql_starwars_test_server dependency to 0.0.5

Open ajonno opened this issue 5 years ago • 3 comments

Describe the bug graphql test server doesnt run (on Mac)

To Reproduce download the repo zip file, CD into the project directory. run the following as per instructions: flutter packages pub run graphql_starwars_test_server

Mac OSX Catalina 10.15.2

Error

Unhandled 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:angel_container/src/throwing.dart:24:46)
#1      getAnnotation (package:angel_framework/src/util.dart:23:35)
#2      Service._addRoutesInner (package:angel_framework/src/core/service.dart:227:9)
#3      Service.addRoutes (package:angel_framework/src/core/service.dart:218:5)
#4      HookedService.addRoutes (package:angel_framework/src/core/hooked_service.dart:144:11)
#5      Routable.use (package:angel_framework/src/core/routable.dart:127:12)
#6      Angel.use (package:angel_framework/src/core/server.dart:357:18)
#7      mountService (package:graphql_starwars_test_server/graphql_starwars_test_server.dart:273:22)
#8      configureServer (package:graphql_starwars_test_server/graphql_starwars_test_server.dart:25:24)
#9      Angel.configure.<anonymous closure> (package:angel_framework/src/core/server.dart:333:40)
#10     new Future.sync (dart:async/future.dart:224:31)
#11     Angel.configure (package:angel_framework/src/core/server.dart:333:19)

ajonno avatar Jan 02 '20 22:01 ajonno

Second, can confirm

JasCodes avatar Jan 04 '20 17:01 JasCodes

I just published version 0.0.5, which should solve this issue. Leaving open to remember to pin the dependency

micimize avatar Feb 14 '20 16:02 micimize

Add import 'package:angel_container/mirrors.dart';

Then MirrorsReflector() for example: var app = Angel(logger: logger, reflector: MirrorsReflector());

edalvb avatar Oct 12 '20 20:10 edalvb