@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
24 lines (16 loc) • 870 B
Markdown
lang: en
title: 'API docs: context.resolutionoptions.optional'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context
permalink: /doc/en/lb4/apidocs.context.resolutionoptions.optional.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [ResolutionOptions](./context.resolutionoptions.md) > [optional](./context.resolutionoptions.optional.md)
## ResolutionOptions.optional property
A boolean flag to indicate if the dependency is optional. If it's set to `true` and the binding is not bound in a context, the resolution will return `undefined` instead of throwing an error.
<b>Signature:</b>
```typescript
optional?: boolean;
```