---
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, getTargetRepo: Getter<EntityCrudRepository<Target, TargetID, TargetRelations>>): InclusionResolver<Entity, Target>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  meta | [BelongsToDefinition](./repository.belongstodefinition.md) | resolved BelongsToMetadata |
|  getTargetRepo | [Getter](./context.getter.md)<!-- -->&lt;[EntityCrudRepository](./repository.entitycrudrepository.md)<!-- -->&lt;Target, TargetID, TargetRelations&gt;&gt; | target repository i.e where related instances are |

<b>Returns:</b>

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


