Skip to content

Bug: Do not use Container here #129

@davidsparkles

Description

@davidsparkles

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions