Urigo/graphql-modules

Global service not working in another service

xoldd opened this issue · 1 comments

xoldd commented

Global service is not defined within another service across modules. But it is defined when accessed with context.injector.get(serviceName) inside resolvers.

Steps to reproduce the behavior:

https://codesandbox.io/s/nostalgic-silence-69ey6t?file=/src/index.ts

Expected behavior

Global service should be defined in both resolvers and services.

Environment:

  • OS: Fedora 35 Workstation
  • @graphql-modules/2.0.0:
  • NodeJS 16.13.2

Additional context

xoldd commented

I just used the syntax constructor(@Inject(PostService) private postService: PostService) {} and it started working. Is this an expected behaviour? If it is, there should be adequate documentation on it.