What problem does it solve?
Webiny extensions need a consistent way to access services like Logger, BuildParams, IdentityContext, and CMS use-cases without manual wiring. This Skill documents the universal DI pattern so developers can correctly declare dependencies, register implementations, and resolve services across API, Admin, CLI, and Infrastructure extensions.
Core Features & Use Cases
- Universal createImplementation Pattern: Define a class implementing a factory Interface, declare constructor dependencies, and export via createImplementation with a matching dependencies array.
- Advanced Injection Options: Supports optional dependencies, multi-injection of all registered implementations, decorators, composites, and singleton vs transient lifetime scopes.
- Use Case: When building a custom GraphQL schema extension, use resolver-level DI via addResolver with dependencies like IdentityContext to access the current user's identity at request time.
Quick Start
Show me how to create a Webiny CLI command extension that injects the Ui service using the createImplementation dependency injection pattern.