Closed snaquaye closed 6 years ago
Why would you expect constructor to be called? If you need it called, instantiate your service using new
keyword. It would be bad if Schema
decorator had such side effects such as instantiating the class.
It might be related to #16 as you need dependency injection. If you need this, you might need to find a library that supports it: https://github.com/chentsulin/awesome-graphql#lib-ts
Can you kindly give an example using services or DI?
Thats good point! I'll try to add it tomorrow!
I think it'd be useful for other entities like ObjectType
too.
It's now fixed and possible with https://github.com/prismake/typegql/pull/39 - I'll create example of DI soon.
Constructor function is not called