Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Do not use Container here #129

Open
1 of 12 tasks
davidsparkles opened this issue Dec 2, 2019 · 0 comments
Open
1 of 12 tasks

Bug: Do not use Container here #129

davidsparkles opened this issue Dec 2, 2019 · 0 comments
Labels

Comments

@davidsparkles
Copy link
Collaborator

davidsparkles commented Dec 2, 2019

Package

  • I do not know.
  • auth
  • boot-loader / graceful-shutdown
  • config
  • db
  • events
  • file-storage
  • graphql
  • notifications
  • queue
  • schema-builder
  • server

Describe the bug

When using Container.get outside a function or class, then it is executed as soon the file is loaded. Dependencies should only be loaded, when they are needed. Not in advance. I had problems faking the dependencies cause the import itself made the the Config be constructed and failed the program.

https://github.com/fullstack-build/fullstack-one/blob/master/packages/db/lib/getClientManager.ts#L11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant