---
lang: en
title: 'API docs: context.invokemethodwithinterceptors'
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.invokemethodwithinterceptors.html
---

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

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [invokeMethodWithInterceptors](./context.invokemethodwithinterceptors.md)

## invokeMethodWithInterceptors() function

Invoke a method with the given context

**Signature:**

```typescript
export declare function invokeMethodWithInterceptors(context: Context, target: object, methodName: string, args: InvocationArgs, options?: InvocationOptions): ValueOrPromise<InvocationResult>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

context


</td><td>

[Context](./context.context.md)


</td><td>

Context object


</td></tr>
<tr><td>

target


</td><td>

object


</td><td>

Target class (for static methods) or object (for instance methods)


</td></tr>
<tr><td>

methodName


</td><td>

string


</td><td>

Method name


</td></tr>
<tr><td>

args


</td><td>

[InvocationArgs](./context.invocationargs.md)


</td><td>

An array of argument values


</td></tr>
<tr><td>

options


</td><td>

[InvocationOptions](./context.invocationoptions.md)


</td><td>

_(Optional)_ Options for the invocation


</td></tr>
</tbody></table>

**Returns:**

[ValueOrPromise](./context.valueorpromise.md)<!-- -->&lt;[InvocationResult](./context.invocationresult.md)<!-- -->&gt;


