---
lang: en
title: 'API docs: context.invocationcontext'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
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)](./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> |  |
|  [parent](./context.invocationcontext.parent.md) |  | <code>Context</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. |
|  [getGlobalInterceptorBindingKeys()](./context.invocationcontext.getglobalinterceptorbindingkeys.md) |  | Discover all binding keys for global interceptors (tagged by ContextTags.GLOBAL\_INTERCEPTOR) |
|  [invokeTargetMethod()](./context.invocationcontext.invoketargetmethod.md) |  | Invoke the target method with the given context |
|  [loadInterceptors()](./context.invocationcontext.loadinterceptors.md) |  | Load all interceptors for the given invocation context. It adds interceptors from possibly three sources: 1. method level <code>@intercept</code> 2. class level <code>@intercept</code> 3. global interceptors discovered in the context |
|  [toString()](./context.invocationcontext.tostring.md) |  |  |


