Container
in package
Resolver container for code-API command classes.
Autogenerated GraphQL query and mutation resolvers look up the corresponding code-API command through {@see}. WooCommerce core delegates every lookup to the main WooCommerce DI container.
Sibling plugins that reuse the GraphQL infrastructure and want their command
classes instantiated through a container of their own can ship their own
Container class at <plugin-api-namespace>\Container with the same public
signature: ApiBuilder detects it during generation and routes the generated
resolvers through it. When no such class is present, resolvers fall back to
new $command_class().
Table of Contents
- get() : object
- Resolve a command class to an instance.
Methods
get()
Resolve a command class to an instance.
public
static get(string $class_name) : object
Parameters
- $class_name : string
-
Fully-qualified name of a code-API command class.
