---
lang: en
title: 'API docs: repository.createbelongstoinclusionresolver'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.createbelongstoinclusionresolver.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [createBelongsToInclusionResolver](./repository.createbelongstoinclusionresolver.md)

## createBelongsToInclusionResolver() function

Creates InclusionResolver for BelongsTo relation. Notice that this function only generates the inclusionResolver. It doesn't register it for the source repository.

Notice: scope field for inclusion is not supported yet

<b>Signature:</b>

```typescript
export declare function createBelongsToInclusionResolver<Target extends Entity, TargetID, TargetRelations extends object>(meta: BelongsToDefinition, getTargetRepoDict: {
    [repoType: string]: Getter<EntityCrudRepository<Target, TargetID, TargetRelations>>;
}): InclusionResolver<Entity, Target>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  meta | [BelongsToDefinition](./repository.belongstodefinition.md) | resolved BelongsToMetadata |
|  getTargetRepoDict | { \[repoType: string\]: [Getter](./context.getter.md)<!-- -->&lt;[EntityCrudRepository](./repository.entitycrudrepository.md)<!-- -->&lt;Target, TargetID, TargetRelations&gt;&gt;; } | dictionary of target model type - target repository i.e where related instances for different types are |

<b>Returns:</b>

[InclusionResolver](./repository.inclusionresolver.md)<!-- -->&lt;[Entity](./repository.entity.md)<!-- -->, Target&gt;


