---
lang: en
title: 'API docs: context.invocationcontext'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/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.

<b>Signature:</b>

```typescript
export declare class InvocationContext extends Context 
```

## 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>InvocationArgs</code> |  |
|  [description](./context.invocationcontext.description.md) |  | <code>string</code> | Description of the invocation |
|  [methodName](./context.invocationcontext.methodname.md) |  | <code>string</code> |  |
|  [source](./context.invocationcontext.source.md) |  | <code>InvocationSource&lt;unknown&gt; &#124; undefined</code> |  |
|  [target](./context.invocationcontext.target.md) |  | <code>object</code> |  |
|  [targetClass](./context.invocationcontext.targetclass.md) |  | <code>Function</code> | The target class, such as <code>OrderController</code> |
|  [targetName](./context.invocationcontext.targetname.md) |  | <code>string</code> | 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) |  |  |


