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

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

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [InvocationContext](./context.invocationcontext.md)

## InvocationContext class

InvocationContext represents the context to invoke interceptors for a method. The context can be used to access metadata about the invocation as well as other dependencies.

**Signature:**

```typescript
export declare class InvocationContext extends Context 
```
**Extends:** [Context](./context.context.md)

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(parent, target, methodName, args, source)](./context.invocationcontext._constructor_.md) |  | Construct a new instance of <code>InvocationContext</code> |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [args](./context.invocationcontext.args.md) | <code>readonly</code> | [InvocationArgs](./context.invocationargs.md) |  |
|  [description](./context.invocationcontext.description.md) | <code>readonly</code> | string | Description of the invocation |
|  [methodName](./context.invocationcontext.methodname.md) | <code>readonly</code> | string |  |
|  [source?](./context.invocationcontext.source.md) | <code>readonly</code> | [InvocationSource](./context.invocationsource.md)<!-- -->&lt;unknown&gt; \| undefined | _(Optional)_ |
|  [target](./context.invocationcontext.target.md) | <code>readonly</code> | object |  |
|  [targetClass](./context.invocationcontext.targetclass.md) | <code>readonly</code> | Function | The target class, such as <code>OrderController</code> |
|  [targetName](./context.invocationcontext.targetname.md) | <code>readonly</code> | string | The target name, such as <code>OrderController.prototype.cancelOrder</code> |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [assertMethodExists()](./context.invocationcontext.assertmethodexists.md) |  | Assert the method exists on the target. An error will be thrown if otherwise. |
|  [invokeTargetMethod(options)](./context.invocationcontext.invoketargetmethod.md) |  | Invoke the target method with the given context |
|  [toString()](./context.invocationcontext.tostring.md) |  |  |


