> For the complete documentation index, see [llms.txt](https://divine.qibergames.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://divine.qibergames.com/advanced-usage/openapi/lazy-dependency-access.md).

# Lazy dependency access

Fields annotated with`@Inject(lazy=true)` will be resolved after the whole dependency tree was resolved. This way, when injecting these fields, each of the required dependencies are already resolved.

Note that, these fields will be `null` in the constructor. If you want to use these fields after initialization, check out the `Service lifecycles` section in the `Advanced usage` category.

```java
@Service
class ServiceA {
    @Inject(lazy = true)
    ServiceB serviceB;
}

@Service
class ServiceB {
    @Inject(lazy = true)
    ServiceA serviceA;
}
```

{% hint style="info" %}
Note that lazily injected fields are not accessible in the constructor, as they are resolved after the dependency tree construction.
{% endhint %}
